Page MenuHomePhabricator

[native/iOS] initialize database on app start
ClosedPublic

Authored by kamil on Dec 22 2022, 2:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 1, 11:36 AM
Unknown Object (File)
Sun, Apr 28, 6:50 AM
Unknown Object (File)
Sun, Apr 28, 6:50 AM
Unknown Object (File)
Sun, Apr 28, 6:50 AM
Unknown Object (File)
Sun, Apr 28, 6:50 AM
Unknown Object (File)
Sun, Apr 28, 6:47 AM
Unknown Object (File)
Sun, Apr 28, 6:24 AM
Unknown Object (File)
Apr 3 2024, 2:31 AM
Subscribers

Details

Summary

This code will initialize db on iOS.
Context in ENG-2071

Test Plan

Tested on simulator and iOS.

  1. Created malformed db (e.g. simulate bug described in ENG-1910)
  2. Open the app - should be terminated
  3. Open again - app should delete database and perform soft-logout and continue running with proper structure

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Dec 22 2022, 3:32 AM
native/ios/Comm/AppDelegate.mm
204

Why do we want to catch here? As of my experience try - catch in this particular place might not be useful. Application is backgrounded, sot even if the app crashes user is not that directly affected. Additionally, we loos opportunity to receive meaningful crash log and we let application continue to work with possible persisting error in the database.

remove try {} catch() {} for background notifs

native/ios/Comm/AppDelegate.mm
204

Good point with that, removing this

marcin added a reviewer: tomek.
tomek added inline comments.
native/ios/Comm/AppDelegate.mm
72–73 ↗(On Diff #20433)

Can we put this into attemptDatabaseInitialization?

This revision is now accepted and ready to land.Jan 2 2023, 4:34 AM

move call into attemptDatabaseInitialization and test notifs