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)
Sun, Nov 10, 11:08 PM
Unknown Object (File)
Mon, Nov 4, 2:07 PM
Unknown Object (File)
Mon, Nov 4, 6:12 AM
Unknown Object (File)
Fri, Nov 1, 5:34 AM
Unknown Object (File)
Wed, Oct 30, 7:57 AM
Unknown Object (File)
Wed, Oct 30, 7:57 AM
Unknown Object (File)
Wed, Oct 30, 7:57 AM
Unknown Object (File)
Wed, Oct 30, 7:57 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
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