Repository navigation
fix(apps): retry without re-granting trust from the trust-saved dialog state - #23257
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: a small handler fix for a real consent bug, with every retry path now reporting trust refusals by code. Notes
[DESIGN-REVIEWED] f743a21 Description read[DESCRIPTION-READ] b507c2786e6579b8390d80af0a11c8fba7cc1a37ef314563ccb6ca2d2982ed16 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: no control, string or layout changes. "Try again" now does only what its label says, and a missing trust lands in the existing not-saved state, whose button says it writes trust. [UX-REVIEWED] f743a21 Description read[DESCRIPTION-READ] daa79fc2a0b1314ec332aaf465a9d427f81a6a669b4a9aa0d56961f4bbacda1d That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix is in the shared What this change shipsInventory (4 items) — 4 justifiedIntent: when a user clicks "Try again" in the trust-saved dialog, only the action is retried and no trust grant they may have removed gets written back (#21459). FIX.
[FIRST-PRINCIPLES-REVIEWED] f743a21 Description read[DESCRIPTION-READ] 200f71187a64d34ca484f29037f269f1bd6d0adada057a2290333890fa4d9cf0 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
CI on c1ea1ed (this PR changes only website/ files):
|
c1ea1ed to
f743a21
Compare
|
Rebased once onto main for the #23264 Windows fix. |
bolichen97
left a comment
There was a problem hiding this comment.
Deep review passed — retrying from the trust-saved dialog no longer calls the only trust-grant endpoint. It performs only the requested enable, install, or update action, and current-head checks are clean.
[Security: this changes an application-consent retry path. The retry preserves the user's existing decision and cannot recreate revoked trust; the normal explicit trust action remains the only grant path.]
…6958) test_reduced_backend_scope_populates_every_ci_shard runs scripts/ci-surface-tests.py --surface backend in a subprocess capped at 45s. On loaded windows-latest runners the scan sometimes passes 45s, so Backend Tests (Windows) (7) goes red on PRs that never touch CI files. On Windows the scan now gets a named lost-run ceiling of 425s: 10x the slowest passing Windows call measured (42.251775s, windows-pytest-progress-7 of run 39911553168, the PR #23257 head). The module declares pytest.mark.timeout(850) so the ceiling is half the test timeout and an expired scan fails by name instead of killing the xdist worker. Other platforms keep 45s. A scan that does time out now fails with the command, the ceiling and the tail of what the child wrote. Carries LuckVd's change from #23386 without the PR numbers in the code comment, which the Comment History Gate refuses. Closes #23365 Co-authored-by: w <w@k.local> Co-authored-by: LuckVd <37114923+LuckVd@users.noreply.github.com>
Problem / Motivation
Goal: In the app trust dialog's trust-saved state, "Try again" retries the action and writes no trust.
After a trust grant lands and the retried enable, install or update fails, the dialog shows the trust-saved state with a "Try again" button. That button ran the same handler as the first consent, which writes the trust grant again before retrying. A trust the user removed in Settings while the dialog stayed open was written back by a button whose label does not mention trust.
Why it matters
A trust grant lets an app run its own code. A control that writes one must say so; a retry button that silently re-writes a grant the user just removed undoes their decision.
Not a goal
What changed (motivation → approach → change)
The symptom is a trust grant written by "Try again". The cause is that
useTrustGate().confirmalways calledapi.trustAppbeforegate.retry, whatever state the dialog was in.confirmnow reads thegrantedstate. When the dialog is in the trust-saved state, it skipsapi.trustAppand calls onlygate.retry. If that retry is refused because the trust is missing (isTrustDeniedError), the earlier grant no longer stands: nothing is rolled back, and the dialog moves to the not-saved state, whose "trust and try again" button names the grant it writes. The trusted-apps views are refreshed on that path too. The app detail page's install and update retry now throws its trust refusal with thecodeproperty set, so the dialog recognizes it the same way as a refused enable. The first click and the not-saved retry still write trust exactly as before.Backwards compatibility
Compatible: the first consent and the not-saved retry behave as on main; only the trust-saved retry stops writing a grant.
Removes nothing: the change drops a redundant write from one button; no path, record, key or function is removed.
Tests
website/src/test/TrustAppModal.test.tsx:retries without writing trust again from the trust-saved state (#21459): after a landed grant and a failed retry, "Try again" re-runs the enable andtrustAppstays at one call.returns to the not-saved state when the trust-saved retry finds the trust gone (#21459): on the Library enable path, a retry refused for missing trust shows the trust-and-retry button, writes no trust and rolls nothing back.returns the update dialog to the not-saved state when the trust-saved retry finds the trust gone (#21459): the same on the app detail page's update path.The first two fail against main's
TrustAppModal.tsx, and the third fails against main'sAppDetailPage.tsx; all pass with the fix. Each new test passed under 5 shuffled-order runs.TrustAppModal,AppDetailPage*,useAppUpdatesandDiscoverPage.updatesTabsuites: 194/194 pass.tsc -p tsconfig.app.jsonand eslint clean.Manual verification
N/A — unit coverage sufficient: the change is one branch in a hook, exercised end to end through the Library page in the tests above.
Screenshots / video
Why no screenshot: no component, string or layout changes; the dialog renders the same existing states, and only the handler behind one button changes.
Related Issues
Closes #21459
Sibling sweep
Swept: git grep -n "api.trustApp|trustApp(|new Error(APP_EXECUTION_DENIED" -- website/src
Sibling: website/src/pages/AppDetailPage.tsx -- changed here -- its retry threw the trust refusal without a code.
Pattern harvest
Not generalizable: the defect is one handler shared by two dialog states with different labels; no repeatable code shape to lint for.
Checklist