Skip to content

Commit 5f90eea

Browse files
committed
[Electric-Coin-Company#1463] Crash of background task
- The TCA's side effect must be called on a main thread to avoid concurrency clash
1 parent 98184e5 commit 5f90eea

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ directly impact users rather than highlighting other crucial architectural updat
66

77
## [Unreleased]
88

9+
### Fixed
10+
- Crash in the background task during the overnight sync.
11+
912
## 1.4 build 2 (2025-03-06)
1013

1114
### Added

secant/AppDelegate.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ extension AppDelegate {
127127
task.expirationHandler = { [rootStore] in
128128
LoggerProxy.event("BGTask startBackgroundTask expirationHandler called")
129129
// stop the syncing because the allocated time is about to expire
130-
rootStore.send(.initialization(.appDelegate(.didEnterBackground)))
130+
DispatchQueue.main.async {
131+
rootStore.send(.initialization(.appDelegate(.didEnterBackground)))
132+
}
131133
}
132134
}
133135

0 commit comments

Comments
 (0)