(bugfix): Background server health check #3

Merged
antman merged 2 commits from fix-background-health-check into main 2026-07-13 06:35:15 +00:00
Owner

Motivation

The server health check was failing to run in the background. It turns out that CapacitorKV and @capacitor/preferences do 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/preferences while the app was open.

Solution

  • Added a setDomain event that passes the domain to the background worker add stores it using CapacitorKV for later
  • Added a dispatchEvent invocation in the domain state subscription, ensuring we update both CapacitorKV and @capacitor/preferences whenever the domain is changed
  • Started documenting capacitor oddities
  • Temporarily added a notification in the positive case — when the server is up — to help with testing. Will remove in a subsequent PR
## Motivation The server health check was failing to run in the background. It turns out that `CapacitorKV` and `@capacitor/preferences` do 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/preferences` while the app was open. ## Solution * Added a `setDomain` event that passes the domain to the background worker add stores it using `CapacitorKV` for later * Added a dispatchEvent invocation in the domain state subscription, ensuring we update both `CapacitorKV` and `@capacitor/preferences` whenever the domain is changed * Started documenting capacitor oddities * Temporarily added a notification in the positive case — when the server is up — to help with testing. Will remove in a subsequent PR
antman merged commit ac4d6f7ba7 into main 2026-07-13 06:35:15 +00:00
antman deleted branch fix-background-health-check 2026-07-13 06:35:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kill-the-cloud/phone-app!3
No description provided.