Repository navigation
Description
Context
A macOS beta auth regression reached users before we caught it automatically. The user-visible error was:
Could not securely store sign-in tokens. Please try again.
Investigation showed backend OAuth/Firebase was healthy (/v1/auth/token returned 200), but beta desktop builds failed after Auth Token Exchange Completed with:
event = Auth Flow Failed
failure_class = keychain_token_storage_unavailable
Stable/prod macOS sign-in was green in PostHog during the same window, while beta builds had non-zero starts and zero completions.
Current observability gap
We have enough PostHog auth events to diagnose after the fact:
Sign In StartedAuth Token Exchange CompletedAuth Flow FailedSign In FailedSign In Completed
But macOS auth events currently lack explicit release/environment dimensions:
build_environmentupdate_channelis_betarelease_tag- backend/auth host fields
So beta-vs-stable has to be inferred from build numbers/appcast state. We also do not have a synthetic dev/beta canary environment that continuously exercises signed desktop auth before real users hit a broken beta.
Proposal
Design a better dev/beta canary path for macOS Desktop releases:
-
Instrument release/channel dimensions on every macOS analytics event
bundle_idapp_versionapp_buildrelease_tagupdate_channel(stable/beta)inferred_update_channelis_production_bundleis_non_production_bundleauth_api_hostpython_api_hostdesktop_backend_host
-
Create a signed beta auth canary
- Run against the same signed/notarized app artifact users receive, not only unit-test seams.
- Use a dedicated test account and fresh local profile/keychain/defaults.
- Exercise Google/Apple-equivalent OAuth token-finalization path or a backend-issued auth fixture where provider automation is impractical.
- Validate: token exchange, local token persistence, token refresh/retrieval, app reaches signed-in state.
-
Emit canary telemetry
Synthetic Auth Smoke StartedSynthetic Auth Smoke PassedSynthetic Auth Smoke Failed- Include
stage,failure_class,app_build,update_channel, provider/auth path.
-
Gate beta appcast promotion
- Do not advertise a new beta build until the signed artifact canary passes.
- If canary is skipped/unavailable, fail closed or require explicit manual override.
-
Alert on real-user and canary regressions
- Real-user beta auth: starts >= 2 and completions = 0 over 15–30m.
- Any new/known auth
failure_classwith >= 2 users over 30m. - Canary missing/failing after a beta build publish.
Acceptance criteria
- macOS analytics events include explicit update channel/release/backend-host properties.
- A signed beta auth canary exists and runs automatically for new beta artifacts.
- Canary emits pass/fail telemetry with failure stage/class.
- Beta appcast publication is blocked or explicitly warned when the canary fails or is missing.
- PostHog alert(s) or equivalent stability-channel notifications cover beta auth completion failures and canary failures.
- Documentation explains how to run the canary locally and how to interpret failures.
Related incident evidence
- Broken beta builds observed in PostHog:
0.12.34/12034,0.12.35/12035,0.12.36/12036. - Failure class:
keychain_token_storage_unavailable. - Backend OAuth was healthy; failure occurred in desktop local token persistence.
- A temporary PostHog saved metric was added: macOS Auth Guardrail: beta/stable sign-in health.
Activity
feat(desktop): outcome-based, build-attributable macOS release-health…
aryanorastar commentedon Aug 6, 2026
VERIFY — PARKED (infra/ops epic)
Re-checked 2026-08-06. Partial progress on main (#9162 keychain, #10443 release-health, Codemagic
--auth-storage-canary/qualify-desktop-beta.sh), but remaining ACs need OAuth test-account secrets, synthetic signed-artifact auth canary telemetry, and PostHog alert wiring — maintainer/CI ops scope, not a shrink contributor PR.Git-on-my-level commentedon Sep 8, 2026
Closing with one carve-out. Five of six acceptance criteria are met on main: release/channel super-properties on every macOS event (PostHogManager.swift, #10443); the signed-artifact AuthStorageCanary run by smoke-signed-desktop-artifact.sh --auth-storage-canary in codemagic.yaml; fail-closed guards in check_desktop_auth_session.py and check-release-process-guards.py; documented as mandatory in desktop/macos/AGENTS.md; the original regression fixed by #9162. Not done: AC5, a PostHog alert for beta auth starts with zero completions and for a missing canary after a beta publish. That is a single alert definition in project 302298 and should be filed on its own rather than hold this open.
feat(desktop): outcome-based, build-attributable macOS release-health…