Page MenuHomePhabricator

[native][android] Move database and MMKV initialization to CommCoreJSIModulePackage
ClosedPublic

Authored by ashoat on Sat, Apr 13, 4:56 PM.
Tags
None
Referenced Files
F1714982: D11659.id39115.diff
Tue, May 7, 4:12 PM
Unknown Object (File)
Tue, Apr 30, 6:33 PM
Unknown Object (File)
Tue, Apr 30, 12:38 PM
Unknown Object (File)
Tue, Apr 30, 12:13 PM
Unknown Object (File)
Sun, Apr 28, 7:24 PM
Unknown Object (File)
Mon, Apr 22, 3:16 PM
Unknown Object (File)
Mon, Apr 22, 2:39 PM
Unknown Object (File)
Sun, Apr 21, 7:34 AM
Subscribers
None

Details

Summary

This diff prevents the Android app from getting into a state that causes a crash loop, described in ENG-7696. It however does not resolve the crash loop if it already occurring.

Test Plan
  1. Deleted the app off the simulator and redeployed, and the problem was gone (app stopped crash looping after being closed/reopened)
  2. Deployed this fix to production and confirmed it fixed the issue for all 3 users that were affected

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Why moving this code to CommHybrid fixes the issue?

ashoat edited the test plan for this revision. (Show Details)EditedMon, Apr 15, 3:13 AM

Why moving this code to CommHybrid fixes the issue?

I believe because it executes later. More details here. My thinking was that it's safe to call from CommHybrid, since it's called from CommCoreJSIModulePackage.getJSIModules.

Since by that point other JSI libraries (presuamably including Expo libraries) seem ready for setup, I figured it was safe to call SecureStore from that location.

Why moving this code to CommHybrid fixes the issue?

I believe because it executes later. More details here. My thinking was that it's safe to call from CommHybrid, since it's called from CommCoreJSIModulePackage.getJSIModules.

Since by that point other JSI libraries (presuamably including Expo libraries) seem ready for setup, I figured it was safe to call SecureStore from that location.

Maybe we can call it from getJSIModules? We're calling CommSecureStore.getInstance().initialize(secureStoreModuleSupplier); there and it is somehow connected.

This revision is now accepted and ready to land.Mon, Apr 15, 4:16 AM

Maybe we can call it from getJSIModules? We're calling CommSecureStore.getInstance().initialize(secureStoreModuleSupplier); there and it is somehow connected.

Probably a good idea. I'll test and confirm that this still works before landing.

Move to CommCoreJSIModulePackage

ashoat retitled this revision from [native][android] Move database and MMKV initialization to CommHybrid to [native][android] Move database and MMKV initialization to CommCoreJSIModulePackage.Mon, Apr 15, 4:39 AM
ashoat edited the summary of this revision. (Show Details)