-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix "share log" error due to leftover loggerDB tmp file
e-mission/e-mission-docs#1110 After sharing the tmp DB file, we try to clear it, but if this operation fails or the app exits before we get to this, for any reason, all subsequent attempts to share the DB file would fail with error 12 (PATH_EXISTS_ERR) A simple solution is to attempt to clear the tmp file before *and* after sharing. I also changed this to async/await syntax to make it clearer what is happening. Testing done: I ran a dev build of emission on an Android test phone. From profile I clicked Share log and saw the "tmp file did not exist, that is fine..." log The share menu came up but before dismissing it I went into app settings and Force Quit the app. This caused a leftover tmp file that was not cleared. (I never saw "Successfully cleaned up file loggerDB" in the console) Then I launched the app again and repeated the same steps. This time I saw "Successfully cleaned up file..." in the console. The user-visible behavior was the same (share menu popped up). After allowing the share menu to dismiss, I saw "Successfully cleaned up file loggerDB" again
- Loading branch information
Showing
1 changed file
with
98 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters