Repository navigation
Add desktop update policy banner - #8834
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
4 issues found across 8 files
Confidence score: 3/5
- In
backend/database/desktop_update_policy.py, the new helper bypasses the usualget_firestore_client()pattern and can reintroduce import-time Firestore client access, which makes tests harder to isolate and increases regression risk around initialization behavior—refactor it to acquire the client insideget_desktop_update_policybefore merging. - In
desktop/macos/Desktop/Sources/DesktopUpdatePolicyManager.swift,downloadURLis treated as trusted Firestore string data and may allow non-HTTP(S) URL schemes to be opened, which could trigger unintended app/system actions from the update CTA—validate and restrict schemes tohttp/httpsbefore callingNSWorkspace.shared.open. - In
docs/runbooks/desktop-update-policy.md, theminimum_build_numbername conflicts with its documented ceiling behavior, which can cause operator misconfiguration and incorrect policy rollout decisions—rename it to a ceiling-style term (for examplemaximum_build_number) and align wording before rollout.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fda9e6ae0a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let currentBuild { | ||
| endpoint += "¤t_build=\(currentBuild)" | ||
| } | ||
| return try await get(endpoint, requireAuth: false) |
There was a problem hiding this comment.
Avoid attaching BYOK keys to policy polling
When BYOK is enabled, this new unauthenticated policy poll still goes through get, which calls buildHeaders(requireAuth:) with its default includeBYOK: true; that attaches the user's provider API keys even though /v2/desktop/update-policy does not need LLM/STT credentials. Because refresh() runs this on launch and app activation, BYOK users will repeatedly send their secrets to a public update-policy endpoint where they can be exposed in request logs or intermediaries. Add an includeBYOK: false path for GETs or build this request without BYOK headers.
Useful? React with 👍 / 👎.
fda9e6a to
0295aa3
Compare
|
Addressed the review comments in 0295aa3: switched the policy helper to lazy get_firestore_client() with a test override, disabled BYOK headers for the unauthenticated policy poll, restricted CTA URLs to http/https, renamed the rollout ceiling to maximum_build_number while keeping the old field as an accepted alias, and rewrote the changelog copy from the user perspective. Re-ran backend tests/py_compile/diff-check; pre-push hooks also passed. The desktop Swift build is still blocked locally by the existing unrelated #Preview macro plugin issue. |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0295aa3b65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| .onAppear { | ||
| log("DesktopHomeView: Showing mainContent (signed in and onboarded)") | ||
| updatePolicyManager.refresh(force: true) |
There was a problem hiding this comment.
Start update checks before sign-in gates
Because the only forced refresh is inside the signed-in/onboarded mainContent branch, users who are stuck on sign-in or onboarding on an affected build never call the unauthenticated /v2/desktop/update-policy endpoint and therefore cannot see a required manual-update prompt. If this policy is used to recover from an auth/onboarding regression in an old desktop build, those users remain stranded; start the manager at a top-level view and render required prompts across all auth states.
Useful? React with 👍 / 👎.
| private func dismissedKey(for policy: DesktopUpdatePolicyResponse) -> String { | ||
| dismissedPrefix + policy.id |
There was a problem hiding this comment.
Avoid reusing one dismissal key for unnamed banners
Dismissal is keyed only by policy.id; when ops updates the single Firestore document without adding/changing an id (the new runbook sample omits one, so the backend defaults it to current), every optional banner shares this same key. A user who dismisses one banner will silently suppress later update banners with different copy or build ceilings until their defaults are cleared; include the policy/build version in the key or require a unique id for dismissible policies.
Useful? React with 👍 / 👎.
0295aa3 to
1a3929c
Compare
1a3929c to
cd194d7
Compare
cd194d7 to
c0bd17e
Compare
Summary
Review Fixes
get_firestore_client()inside the update-policy helper with a keyword-onlyfirestore_clientoverride for tests.http/httpsbefore opening them.maximum_build_number; the backend still accepts the oldminimum_build_numberalias for compatibility.Current Recovery Notes
v0.11.507+11507-macosnow hasmandatory: truein release metadata, and the live stable appcast includes<sparkle:criticalUpdate />for0.11.507+11507.v0.11.400+11400-macos,v0.11.450+11450-macos,v0.11.480+11480-macos,v0.11.507+11507-macos) includeCrispManager, backend/v1/crisp/unread, andDesktopHomeViewstartup of Crisp, so Crisp support-message prompts should be available for signed-in/running clients.Tests
cd backend && uv run --with pytest --with pytest-asyncio --with httpx --with fastapi pytest tests/unit/test_desktop_updates.py tests/unit/test_announcement_malformed_type.pycd backend && uv run python -m py_compile database/desktop_update_policy.py routers/updates.pygit diff --check HEADLocal Desktop Build Note
cd desktop/macos && xcrun swift build -c debug --package-path Desktop, but this local toolchain is blocked by existing#Previewmacro /PreviewsMacros.SwiftUIViewplugin errors across unrelated desktop files before a full desktop build can complete.