-
Notifications
You must be signed in to change notification settings - Fork 82
Description
Description
SQLiteData reports assertions when using startImmediately: false for the SyncEngine.
Private sync engine has not been set.
Shared sync engine has not been set.
Steps:
- Clone SQLite data and setup SyncUps in Examples project with bundle and cloud kit container ID's
- Change defaultSyncEngine setup in bootstrapDatabase to:
defaultSyncEngine = try SyncEngine(
for: database,
tables: SyncUp.self,
Attendee.self,
Meeting.self,
startImmediately: false
)
- Run app, seed, switch to home screen or change the application state some how
The same doesn't happen with startImmediately: true so this seems like a false assertion or something is running and trying to access sync engines where it shouldn't, because the sync engine wasn't started. If you e.g. have a breakpoint as issue reporter this is disruptive.
Checklist
- I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
- I have determined whether this bug is also reproducible in a vanilla GRDB project.
- If possible, I've reproduced the issue using the
mainbranch of this package. - This issue hasn't been addressed in an existing GitHub issue or discussion.
Expected behavior
When the sync engine is not started via startsImmediately or it's stopped via .stop() there should be no assertions with a valid setup.
Actual behavior
When the sync engine is not started via startsImmediately there's assertions when the application state switches from foreground active to something else.
Reproducing project
As mentioned above one can use SyncUps for this with the only modification being the startsImmediately: false.
SQLiteData version information
main
Sharing version information
No response
GRDB version information
No response
Destination operating system
No response
Xcode version information
No response