fix: always emit AccountsBackgroundFetchDone

A second background_fetch() while one is already running returned
without emitting the event, and the FFI returned 1 for it,
so a UI waiting for an event hangs dc_get_next_event().
Emit the event in any case, so waiting for it is safe.
This commit is contained in:
holger krekel
2026-09-13 10:29:52 +02:00
parent dced877c90
commit a8e1110bcd
6 changed files with 67 additions and 18 deletions
+2 -1
View File
@@ -278,7 +278,8 @@ impl CommandApi {
/// Performs a background fetch for all accounts in parallel with a timeout.
///
/// The `AccountsBackgroundFetchDone` event is emitted at the end even in case of timeout.
/// The `AccountsBackgroundFetchDone` event is emitted at the end even in case of timeout,
/// and immediately if another background fetch is already running.
/// Process all events until you get this one and you can safely return to the background
/// without forgetting to create notifications caused by timing race conditions.
async fn background_fetch(&self, timeout_in_seconds: f64) -> Result<()> {