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, Apr 3, 2:31 AM
Unknown Object (File)
Wed, Apr 3, 2:31 AM
Unknown Object (File)
Wed, Apr 3, 2:31 AM
Unknown Object (File)
Wed, Apr 3, 2:31 AM
Unknown Object (File)
Wed, Apr 3, 2:31 AM
Unknown Object (File)
Wed, Apr 3, 2:31 AM
Unknown Object (File)
Mar 28 2024, 4:54 PM
Unknown Object (File)
Mar 3 2024, 9:32 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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

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

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