Repository navigation
test(app-sdk): give the stale-cache issues test its own app id per run - #36287
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The PR only changes a test file and adds or changes no user-visible control, so no screenshot or blind read is needed. [UX-REVIEWED] 9e05ffd Description read[DESCRIPTION-READ] 7a9ea9a7817dc118c0121923817d470ff36a3b2cbfc94fc0a7dcb8f02f230f80 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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Test-only change that fixes the root cause (an app id reused across runs) with the counter the file already has; nothing blocks. [DESIGN-REVIEWED] 9e05ffd Description read[DESCRIPTION-READ] 80929a34d43053499df454f733277d4c332abab66b8767f28856743cebb506c1 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 |
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: |
|
Backend Tests (3.12, 8) is red on |
564e595 to
9e05ffd
Compare
Code change approver recommendation: ApproveWhy: the decider estimates a 4% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The PR changes one test and no product code. The stale-cache test used to mount under the fixed app id An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
bolichen97
left a comment
There was a problem hiding this comment.
Approving. I read the full diff at 9e05ffd. This is a test-only change: AppSdkIssues.test.tsx gives the stale-cache test a fresh issues-app-stale-<n> app id per run, using the file's existing appSeq. A repeated run then cannot inherit the previous run's route cache. Both mounts inside one run still share the id, which the test relies on. No product code changes.
Not checked: CI is green (97). I ran nothing locally.
Problem / Motivation
Goal:
AppSdkIssues.test.tsxpasses when its tests are repeated in one run, sovitest --repeat-style runs and reordered runs stop failing on a cache left by an earlier run.The test
IssueList > reads the list again when an app reopens it after the route cache expiresmounted its list under the fixed app idissues-app-stale. An external app's query client is held per app id in a module-level map (website/src/app-sdk/appQueryClient.ts), so that client outlives the test. On a repeat, the first mount finds the previous run's cached list and sends no request, andexpect(bodies()).toHaveLength(2)sees 0.KiroCrewCaptain flagged this in its review of #34732.
Why it matters
A test that depends on running once per module is a flake waiting for any change that reorders, repeats or co-hosts the file. It also blocks proving determinism for later changes to the issues SDK, because every repeated run of this file goes red.
Not a goal
appQueryClient.tsis the intended design.What changed (motivation → approach → change)
Symptom: the stale-cache test fails on every repeat after the first. Cause: its fixed app id reuses a query client that outlives the test. Change: the test takes a fresh id from the file's existing
appSeqcounter (issues-app-stale-<n>), the same counterexternalApp()already uses. Both mounts inside one run still share that id, which the test needs so the reopen finds the first mount's client.Backwards compatibility
Compatible: test-only change; no product code, API or config is touched.
Removes nothing: the diff only changes one test's app id.
Tests
Proof: not provable -- frontend test (prove.py runs Python only)
Vitest 4.1 has no
--repeatCLI flag, so the proof runs a throwaway, untracked copy of the file with{ repeats: 4 }on each top-leveldescribe(5 runs of every test in one module instance), then deletes the copy:website/src/app-sdk/are unchanged on the current base a02e90c; 5 runs each):Tests 1 failed | 24 passed (25).× IssueList > reads the list again when an app reopens it after the route cache expires (repeat x4), failing atexpect(bodies()).toHaveLength(2)with 0 received.Tests 25 passed (25).repeats: 19):Tests 25 passed (25).--sequence.shuffle --sequence.seed=13013):Tests 25 passed (25).src/test/AppSdkIssues.test.tsx: 25 passed.Manual verification
N/A — test-only change; the repeat runs above are the verification.
Related Issues
N/A — follow-up to KiroCrewCaptain's review note on #34732; no tracking issue.
Sibling sweep
Swept: git grep -nE "appName=|appId=|issues-app" -- website/src/test/AppSdkIssues.test.tsx website/src/apps/issue-radar/components/IssueList.refreshButton.test.tsx
Sibling: website/src/test/AppSdkIssues.test.tsx:97 -- not affected -- externalApp() already draws a fresh issues-app- per mount from appSeq
Sibling: website/src/test/AppSdkIssues.test.tsx:151 -- not affected -- builtin issue-radar uses AppIdentityProvider only, under a QueryClient each test creates itself
Sibling: website/src/apps/issue-radar/components/IssueList.refreshButton.test.tsx -- not affected -- mounts no app provider and names no app id
The other tests in the file were checked too:
scopedIssuesTransportuses a fake api with no client; the no-identity refusal test and the hook refusal test each build their ownQueryClient; theIssueCardtests mount no app provider.Pattern harvest
Rule candidate: review-prompt
Pattern: a test mounts an
AppApiProviderwith a literalappName, so its per-app query client outlives the testChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)