Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when history cache file is missing #1056

Merged
merged 3 commits into from
Aug 4, 2023

Conversation

khaykov
Copy link
Member

@khaykov khaykov commented Aug 4, 2023

This PR fixes a crash that can happen when Aztec state with history is restored, but the history cache file was removed by OS.

This crash is pretty rare, but can happen on devices with low storage, when you reopen editor that was destroyed by OS (usually happens if you don't open it for some time).

Test

  1. For easier access to file system consider using an emulator.
  2. Enabled "Do not keep activities".
  3. Open editor, and make a couple of changes.
  4. Confirm that the changes are added to history.
  5. Minimize the app.
  6. From AS device manager, open file browser of the emulator.
  7. Navigate to data/data/org.wordpress.aztec/cache
  8. Delete files that start with HISTORY_LIST_KEY.
  9. Go back to the editor from app drawer.
  10. Confirm that the app is not crashing, and there is no history.

Review

@[USER_NAME]

Make sure strings will be translated:

  • If there are new strings that have to be translated, I have added them to the client's strings.xml as a part of the integration PR.

@nbradbury nbradbury self-assigned this Aug 4, 2023
Copy link
Contributor

@nbradbury nbradbury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! :shipit:

@nbradbury nbradbury merged commit 448622c into trunk Aug 4, 2023
2 checks passed
@nbradbury nbradbury deleted the issue/guard-against-missing-history-file branch August 4, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants