Page MenuHomePhabricator

[native] Prevent media cache errors from crashing app
ClosedPublic

Authored by ashoat on Apr 21 2023, 2:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 11, 7:11 AM
Unknown Object (File)
Thu, Nov 7, 6:04 AM
Unknown Object (File)
Tue, Oct 22, 12:32 PM
Unknown Object (File)
Tue, Oct 22, 12:32 PM
Unknown Object (File)
Tue, Oct 22, 5:01 AM
Unknown Object (File)
Mon, Oct 21, 11:59 AM
Unknown Object (File)
Sep 15 2024, 12:30 PM
Unknown Object (File)
Sep 13 2024, 8:29 PM
Subscribers

Details

Summary

Context is in ENG-3620.

Test Plan

I compiled a prod build to my physical device. I had a repro where I logged out and back in twice in a row, the app would crash.

With this change, the app no longer crashed. After enabling prod logs by editing native/babel.config.cjs, I was able to see this log in Xcode:

[javascript] [Error: clear_media_cache_failed]

Diff Detail

Repository
rCOMM Comm
Branch
ashoat/mediacache
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

native/data/sqlite-data-handler.js
97

This gets triggered when the user logs out, and is the main case that I was able to repro. It did not lead to the "frozen log-in state" mentioned in the Linear issue (only occurred in dev)

129

This gets triggered when the database is detected as corrupted, and in dev mode leads to the "frozen log-in state" issue. I stopped being able to repro this randomly, but based on reading the code it seems like the issue shouldn't occur after the changes in this diff

ashoat published this revision for review.Apr 21 2023, 2:33 PM
This revision is now accepted and ready to land.Apr 21 2023, 2:33 PM
This revision was landed with ongoing or failed builds.Apr 21 2023, 2:34 PM
This revision was automatically updated to reflect the committed changes.