UniversalDevicesInc / UD-Mobile-iOS

Issue-only repository for tracking issues related to the UD Mobile iOS App
6 stars 0 forks source link

SQLite Authorization Denied on some devices in background. #96

Closed JavierRefuerzo closed 3 months ago

JavierRefuerzo commented 7 months ago

The issues is caused by iOS refusing to let the app read it's own files when the app is in the background.  Firebase reports 3 users with this crash in the last 30 days, but each user has many crashes. The devices are 13, 13-mini, and 14 pro on 17.4.1 & 17.3.1.

` Crashed: com.apple.main-thread 0 libswiftCore.dylib 0x398c0 assertionFailure(:_:file:line:flags:) + 264

1 Go2iSY 0x38fe18 specialized SceneDelegate.scene(_:willConnectTo:options:) + 35 (SceneDelegate.swift:35)

2 Go2iSY 0x38ac04 @objc SceneDelegate.scene(_:willConnectTo:options:) + 4302056452 (:4302056452) 3 UIKitCore 0x1923b4 +[UIScene _sceneForFBSScene:create:withSession:connectionOptions:] + 1080 4 UIKitCore 0x24e3b8 -[UIApplication _connectUISceneFromFBSScene:transitionContext:] + 808 5 UIKitCore 0x24dee0 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 360 .... 25 ??? 0x1b2472d84 (Missing) `

crash_info_entry_0 Go2iSY/SceneDelegate.swift:35: Fatal error: SQLite error 23: authorization denied

Possibly related to: https://github.com/tekartik/sqflite/pull/935 https://github.com/groue/GRDB.swift/issues/571

JavierRefuerzo commented 3 months ago

Fixed in 1.1.73 Backup import will now reset imported files to FileProtectionType.completeUntilFirstUserAuthentication Existing files with incorrect FileProtectionType will present an error to users and allow reset in Backup View.

JavierRefuerzo commented 3 months ago

Changing the File protection type did not correct the issue.

JavierRefuerzo commented 3 months ago

Added 5 loops with 5 second delay. Based on logs it appears the database will initialize a short time later. So maybe this delay will allow time for the database to start.