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)
Tue, Jun 18, 3:02 AM
Unknown Object (File)
Tue, Jun 18, 3:02 AM
Unknown Object (File)
Tue, Jun 18, 3:02 AM
Unknown Object (File)
Tue, Jun 18, 3:00 AM
Unknown Object (File)
Thu, Jun 13, 6:46 PM
Unknown Object (File)
Thu, Jun 13, 7:48 AM
Unknown Object (File)
Thu, May 30, 11:53 AM
Unknown Object (File)
May 13 2024, 9:14 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/data/sqlite-data-handler.js
97 ↗(On Diff #25563)

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 ↗(On Diff #25563)

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.