Repository navigation
test(e2e): strip ETag If-None-Match at the network layer - #30371
Merged
chirag-madlani merged 3 commits intoJul 23, 2026
Merged
Conversation
The localStorage opt-out from #30239/#30292 only works when the running UI bundle contains the interceptor guard. In the upgrade AUT (1.11.13 -> main) the served bundle does not evaluate the guard, so the client still sends If-None-Match, the server answers 304, and the UI renders a stale body — the flaky-assertion source persists. Strip the If-None-Match header on /api/v1/** at the Playwright network layer instead. This sits below the app, so it works regardless of which bundle runs or whether its guard fires: the server always receives an unconditional GET and returns the current body. Installed once per page (WeakSet-guarded) from redirectToHomePage, which every affected spec routes through (createNewPage calls it too). Kept alongside the existing localStorage opt-out as defense in depth. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
redirectToHomePage covers specs that call it, but ~79 specs get their page from the fixtures/pages and support/fixtures/userPages fixtures without going through it. Install stripEtagConditionalReads on those role pages too, so fixture-based specs get fresh entity reads regardless of the deployed bundle. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
🔴 Playwright Results — 9 test failure(s), 3 pipeline/setup failure(s)✅ 4508 passed · ❌ 9 failed · 🟡 32 flaky · ⏭️ 98 skipped Pipeline and setup failures
Genuine Failures (failed on all attempts)❌
|
The network-layer ETag strip was reached via redirectToHomePage and the role fixtures. These specs bypass both — the 3 Glossary status-filter specs use the built-in `page` fixture (navigating in their own beforeEach) and SearchRBAC creates raw `browser.newPage()` contexts. Install stripEtagConditionalReads directly at those page-acquisition points so every failing spec is reachable by the fix regardless of how it obtains its page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
chirag-madlani
approved these changes
Jul 23, 2026
chirag-madlani
deleted the
fix/etag-strip-conditional-reads-network-layer
branch
July 23, 2026 09:15
Code Review ✅ ApprovedStrips If-None-Match headers on API requests at the Playwright network layer to prevent stale reads in E2E tests. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
6 tasks done
This was referenced Aug 3, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#30239 / #30292 added a localStorage opt-out so E2E sessions skip client-side conditional (
If-None-Match) reads. That only works when the running UI bundle contains the interceptor guard.In the upgrade AUT (
1.11.13 ➡ main) it doesn't help. Trace evidence from a failing run (TestSuiteMultiPipeline):OM_DISABLE_ETAG_CONDITIONAL_READS: "true"under the app origin.index-DWyuxoxX.js) still sendsIf-None-Match; the response comes backContent-Length: 0(304) and the UI renders a stale body.no-store, so the browser would never revalidate; 1.11.13's UI has no interceptor at all).So the guard is not taking effect in the deployed bundle, and a UI-side opt-out can't be relied on there.
Change
Strip
If-None-Matchon/api/v1/**at the Playwright network layer:This sits below the app, so it works regardless of which bundle runs or whether its guard fires — the server always receives an unconditional GET and returns the current body, and the interceptor's 200-branch overwrites its own cache with fresh data.
Installed once per page (WeakSet-guarded) from
redirectToHomePage. Every ETag-affected failing spec routes through it (2–13× each), andcreateNewPagecalls it too. Kept alongside the existing localStorage opt-out as defense in depth.Validation
CustomMetric+FollowingWidget(12 entity types) pass with the strip installed — auth and reads work fine throughroute.continue.Honest limitation: the underlying failure is a same-session refetch race that only manifests under AUT load — it does not reproduce locally (local reloads clear the interceptor's in-memory cache). So I can prove the strip is installed and non-breaking, but the end-to-end proof for the stale-read case is the next AUT run. The mechanism itself is HTTP-guaranteed: no
If-None-Match→ fresh200.Scope
Test-only; unblocks AUT. The underlying product defect — the ETag being derived from
version/updatedAtonly, so it ignores requestedfieldsand child state — remains open and tracked separately.🤖 Generated with Claude Code
Greptile Summary
This PR disables conditional ETag reads in Playwright API traffic. The main changes are:
If-None-Matchfrom/api/v1/**requests.Confidence Score: 5/5
No additional blocking issue qualifies for this follow-up review.
Important Files Changed
Reviews (3): Last reviewed commit: "test(e2e): strip If-None-Match on specs ..." | Re-trigger Greptile
Context used (3)