mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 17:05:48 +00:00
* fix(ios): reconcile time tracking and focus mode on app resume iOS suspends the WKWebView WebContent process within seconds of backgrounding, freezing JS timers so tracked time and the focus-mode countdown stall. On resume we now credit the wall-clock gap (capped at MOBILE_BACKGROUND_IDLE_CAP_MS) via a wake-up tick, reset the tracking anchor, flush accumulated time, and nudge the focus reducer to recompute elapsed. On pause we flush accumulated time and drain the op-log write queue inside the existing BackgroundTask.beforeExit budget. Effects are gated by IS_IOS_NATIVE and registered only on iOS; handler bodies are exported as pure functions for unit coverage. Refs #7824, #7826 * fix(ios): persist tracked time in background budget, drop duplicate flush The flushOnPause$ effect duplicated the op-log drain that main.ts already runs inside BackgroundTask.beforeExit, but executed outside that budget and raced the main.ts listener — so accumulated time dispatched by the effect could be lost on suspension. flushPendingWrites also has a 30s timeout, well beyond the iOS budget, so the "drains within budget" premise was false. Move the only needed pause work — flushAccumulatedTimeSpent() — into the existing budgeted main.ts iOS handler before the drain, and remove the pause effect, its OperationWriteFlushService dependency, and onPause$. onResume$ becomes a plain Subject since the iOS producer is a JS listener registered at bootstrap (no cold-start replay race, unlike the native-fed Android shim). Refs #7824, #7826 * test(ios): cover resume effect wiring via extracted factory The reconcileOnResume$ effect field is false under Karma (IS_IOS_NATIVE gate), so the onResume$ -> withLatestFrom(selectTimer) -> handler pipe was untested. Extract the pipe into an exported reconcileOnResume factory and add specs that drive it against a mock store, covering the selector read and per-resume reconciliation that the pure-handler tests could not reach. Refs #7824, #7826 |
||
|---|---|---|
| .. | ||
| 2026-03-22-advanced-onboarding-design.md | ||
| 2026-04-21-schedule-week-range-header.md | ||
| 2026-04-29-focus-mode-time-tracking-sync.md | ||
| 2026-05-12-pr5-dropbox-slice.md | ||
| 2026-05-12-pr5-webdav-slice.md | ||
| 2026-05-12-pr7-super-sync-slice.md | ||
| 2026-05-13-extract-encryption-to-sync-core.md | ||
| 2026-05-14-super-sync-server-perf.md | ||
| 2026-05-15-generic-concurrently-migration-recovery-design.md | ||
| 2026-05-15-super-sync-server-decomposition.md | ||
| 2026-05-15-sync-docs-and-contributor-model-design.md | ||
| 2026-05-21-clean-slate-data-loss-prevention.md | ||
| 2026-05-21-document-mode-tiptap-plugin.md | ||
| 2026-05-22-clientid-migrate-to-sup-ops.md | ||
| 2026-05-22-document-mode-sync-data-model.md | ||
| 2026-05-22-supops-single-connection-alt.md | ||
| 2026-05-22-supops-single-connection.md | ||
| 2026-05-23-persisted-data-update-hook.md | ||
| 2026-05-23-stage-a-keyed-plugin-persistence.md | ||
| 2026-05-27-ios-background-time-tracking.md | ||
| 2026-05-28-android-keyboard-resize-jank.md | ||