Skip to content

fix: harden desktop update policy recovery - #9647

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:codex/close-issue-9528
Jul 13, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:codex/close-issue-9528

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Fail open when the desktop update-policy control plane is unavailable, preserving Sparkle and the stable manual download path.
  • Reject malformed policy URLs in both the backend and macOS client, and make malformed policy payloads non-blocking.
  • Clear a previously displayed required prompt if a subsequent policy refresh fails, with recovery telemetry and regression coverage.

Root cause and durable guard

The update-policy control plane was able to leave desktop clients with a stale blocking prompt or an unusable download target when Firestore or policy data failed. The backend now returns an inactive safe default on control-plane failure; the client decodes policy data defensively, verifies HTTP(S) download targets, and clears stale policy state on refresh failure. Tests cover the backend fault boundary, malformed payloads, and stale-required-prompt recovery.

Product invariants affected

  • INV-AUTH-1

APIClient.swift is a path-glob match only. This change does not alter session invalidation, 401 handling, credentials, or authenticated-surface gating.

Verification

  • cd backend && /private/tmp/omi-9528-venv/bin/pytest -q tests/unit/test_desktop_updates.py tests/unit/test_desktop_update_channels.py tests/unit/test_desktop_update_resolver.py — 101 passed
  • cd desktop/macos && xcrun swift test --package-path Desktop --filter 'DesktopUpdatePolicyManagerTests|UpdateFailureDiagnosticsTests|UpdateRelaunchWindowPolicyTests' — 17 passed
  • cd desktop/macos && python3 scripts/check_desktop_test_quality.py — passed
  • make preflight with this PR body — passed
  • Built and launched the isolated named bundle omi-update-policy-recovery; the local automation bridge was reachable. The environment has no reusable signed-in session, so the authenticated banner could not be exercised end to end.

Release gate

Live discovery on 2026-07-14 found the configured static repair page returning 404 while the stable dynamic download endpoint and appcast were healthy. This PR deliberately retains the verified stable endpoint as the safe fallback. Publish and verify the static repair page through the normal stable-promotion workflow, then validate a relaunch into the target build before closing the umbrella issue.

Refs #9528

Review in cubic

@Git-on-my-level
Git-on-my-level merged commit deefbf1 into BasedHardware:main Jul 13, 2026
22 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant