fix(graphql): address all four tracked nits from PR #178's auto-review - #180
Merged
Conversation
Follow-up to #178 (merged) — resolves every item left open in #179. 1. openEncryptedFrameDetailed's two fromB64 calls sat outside every try, so an iv like "A" (passes BASE64_RE, which doesn't enforce length % 4) made atob throw out of a function documented as "never throws", with no stage assigned. Moved both calls inside the decrypt try, and reduced openEncryptedFrame to a thin rethrow-wrapper over openEncryptedFrameDetailed so the decrypt/parse/validate sequence exists in exactly one place. 2. content.ts's spoofed-graphql-res guard covered null/undefined but not the arrays and non-object primitives assertObject also rejects — a spoofed data:[] or data:"x" from a same-window page script still reached assertObject(raw.data) and closed the bridge. Widened the guard to match assertObject's own object/array/null check, with parametrized tests covering null, undefined, array, string, number, and boolean. 3. capture-logger.ts's "operation ... not yet observed on this tab" error said "open a restaurant page and retry" — the only OpenTable-specific string in extension-core's runtime output, relayed verbatim to every MCP using the graphql capability regardless of vendor. Made it generic: "open a page on the site that triggers this GraphQL operation, then retry". 4. graphql-query.test.ts's integration suite only exercised ok:true — the actual bug the auto-review found (op:'graphql_query' failing validateInnerResponse) could only ever show up on the ok:false path, so this suite could not have caught it. Added an end-to-end case that drives the real WS + encryption + validation + dispatch stack with an ok:false response, asserting graphqlQuery() rejects, the extension WebSocket stays open, AND a second call over the same connection still succeeds — proving the bridge survives, not just doesn't immediately close. Closes #179 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @chrischall's task in 1m 28s —— View job Reviewing PR #180
ReviewThis is a clean, well-scoped follow-up that resolves all four items from #178's auto-review-followup issue (#179). Went through each change against the diff:
No correctness, security, or convention issues found. Test/doc changes are consistent with the source changes throughout, and the PR's own claim of 1064/1064 passing lines up with what's in the diff. Verdict: pass |
Contributor
|
✅ Auto-review verdict: pass — PR correctly and cleanly resolves all four tracked nits from #178's auto-review, with solid test coverage and no correctness/security/convention issues found. |
chrischall
enabled auto-merge (squash)
July 29, 2026 22:29
chrischall
added a commit
that referenced
this pull request
Jul 29, 2026
🤖 I have created a release *beep* *boop* --- ## [1.7.0](v1.6.2...v1.7.0) (2026-07-29) ### Features * **graphql:** route declared GraphQL ops through the tab's own Apollo client ([#178](#178)) ([0c3fdf4](0c3fdf4)) ### Bug Fixes * **extension-chrome:** build content scripts as classic IIFE so Chrome injects them ([#175](#175)) ([f4a3728](f4a3728)) * **graphql:** address all four tracked nits from PR [#178](#178 auto-review ([#180](#180)) ([9d88ac9](9d88ac9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Summary
Follow-up to #178 (merged) — resolves every item left open in the auto-review-followup issue.
openEncryptedFrameDetailed'sfromB64calls sat outside everytry— anivlike"A"passesBASE64_RE(which doesn't enforce length % 4) but still makesatobthrow, out of a function documented as "never throws". Moved both calls inside the decrypttry, and reducedopenEncryptedFrameto a thin rethrow-wrapper overopenEncryptedFrameDetailedso the decrypt/parse/validate sequence exists in exactly one place.content.ts's spoofed-graphql-resguard coverednull/undefinedbut not arrays/primitives thatassertObjectalso rejects — a spoofeddata:[]ordata:"x"from a same-window page script still reachedassertObject(raw.data)and closed the bridge. Widened the guard to matchassertObject's own object/array/null check, with parametrized tests over null, undefined, array, string, number, boolean.capture-logger.ts's error string was OpenTable-specific ("open a restaurant page and retry") — the only vendor-specific string inextension-core's runtime output, relayed verbatim to every MCP using thegraphqlcapability. Made generic.graphql-query.test.tsonly exercisedok:true— the actual bug the auto-review found (op:'graphql_query'failingvalidateInnerResponse) could only ever show up on theok:falsepath, so this suite could not have caught it. Added an end-to-end case driving the real WS + encryption + validation + dispatch stack, assertinggraphqlQuery()rejects, the extension WebSocket stays open, and a second call over the same connection still succeeds.Closes #179
Test plan
npm test— 1064/1064 passingnpm run build— clean across all 7 workspacesnpm run typecheck— clean🤖 Generated with Claude Code