Cache Home status across navigation#9372
Conversation
Persist connector metrics and device-history status under the signed-in user, migrate legacy cache keys once, and clear in-memory status on session reset. Track the owner of legacy onboarding import summaries to prevent cross-account reuse. Verification: xcrun swift test --package-path Desktop --scratch-path /tmp/omi-pr9372-account-cache-build --filter 'HomeStatusStoreTests|ImportConnectorStatusStoreTests|OnboardingFlowTests|OnboardingDataSourceRowStatusTests' (24 passed). Built and launched the omi-home-cache-scope named bundle, navigated Apps to Home through omi-ctl, and found no related app-log errors.
Migrate ViewModelContainer account ID reads to DefaultsKey so the PR merge result remains within the raw-key hygiene baseline.\n\nVerified:\n- python3 desktop/macos/scripts/check-userdefaults-key-ratchet.py\n- exact PR merge simulation: 183 raw keys (baseline 184)\n- xcrun swift test --package-path Desktop --scratch-path /tmp/omi-pr9372-account-cache-build --filter 'DefaultsKeyTests|StartupWarmupPolicyTests' (46 passed)
|
Thanks for the careful work here. This looks like a cohesive desktop performance/privacy improvement: moving Home status into a long-lived store should make returning to Home feel much faster, and I like that the PR adds account-scoped persistence plus focused tests for stale-cache throttling, concurrent refresh coalescing, import-triggered count refreshes, stale-response protection, and account switching. I’m not seeing a concrete blocker in the diff from static review, and the relevant desktop Swift build/tests/checks are green. I’m leaving this as a positive maintainer signal rather than a formal approval because the change touches account-scoped cached status for connector metrics, memory-import state, export status, and Omi-device history. That is a user-data/privacy-sensitive surface, so a human maintainer should sanity-check the intended account-boundary behavior before merge. Specific things I’d want the maintainer to confirm:
Overall: promising and well-tested, but needs human maintainer review because it changes cached per-account status behavior. |
What changed and why
Keep Home status and connector metrics in a long-lived store so returning to Home renders cached values immediately instead of repeating connector, Apple Notes, file, export, and knowledge-count discovery. Refreshes remain stale-aware, imports refresh the affected knowledge counts, and session resets clear cached account state.
Product invariants affected
none
How it was verified
omi-home-status-cachedesktop bundle and confirmed cached status remains available when leaving and returning to Home.xcrun swift build -c debug --package-path Desktop --scratch-path /tmp/omi-home-status-cache-swift-buildcompleted successfully on the latestupstream/main.Tests
xcrun swift test --package-path Desktop --scratch-path /tmp/omi-home-status-cache-swift-build --filter HomeStatusStoreTestspassed 6/6 tests.Scoped cleanups (optional)
none