(bugfix): Background server health check #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-background-health-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
The server health check was failing to run in the background. It turns out that
CapacitorKVand@capacitor/preferencesdo not share data despite using the the same data store (UserDefaults and SharedPreferences). This meant the background worker was unable to retrieve the domain set using@capacitor/preferenceswhile the app was open.Solution
setDomainevent that passes the domain to the background worker add stores it usingCapacitorKVfor laterCapacitorKVand@capacitor/preferenceswhenever the domain is changed