-
-
Notifications
You must be signed in to change notification settings - Fork 116
Description
We have an issue upgrading from 2.25 to 2.33 caused by SQL migration being too slow: #7602
Application gets killed by the OS because dc_accounts_new takes too long.
There are no logs from the migrations available, because application does not even get a chance to call dc_accounts_get_event_emitter before migrations finished.
To make it possible to get logs before migrations finish, we need to be able to create event channel separately with a new API dc_accounts_event_emitter_new and then have API to create account manager with existing event channel dc_accounts_new_with_event_emitter.
JSON-RPC server could also use this to create event emitter first and then allow to call get_next_event before account manager is created, but the whole JSON-RPC object is centered around account manager so this will require some locks around account manager to wait for it in JSON-RPC calls that need it, can be treated as out of scope for this issue.
Not high priority as Android will need a workaround to turn "background ANR" into "foreground ANR" anyway: deltachat/deltachat-android#4116 (comment), then current problem will be solved by the user having to wait on the blank screen but that only happens on upgrade.