Skip to content

test: WebKit hide-on-scroll flake fix + retrieval owner_filter callsite guard#381

Merged
BigSimmo merged 4 commits into
mainfrom
claude/review-followups-guard
Jul 8, 2026
Merged

test: WebKit hide-on-scroll flake fix + retrieval owner_filter callsite guard#381
BigSimmo merged 4 commits into
mainfrom
claude/review-followups-guard

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Follow-ups from the 48h PR review (#2/#3/#5 items). Both are test-layer, zero production-code risk.

#5 — release-browser-matrix WebKit flake

tests/ui-tools.spec.ts:756 ("phone bottom search dock hides while scrolling…") fails only on WebKit (both attempt + retry): WebKit doesn't reliably emit a native scroll event for a programmatic scrollTo, so useHideOnScroll's listener never runs and data-scroll-hidden stays unset. Fix: dispatch an explicit scroll event after each scrollTo. Harmless on Chromium/Firefox (they already pass; the hook's rAF guard dedupes). Needs the WebKit CI leg to confirm green.

#3 — retrieval owner_filter callsite guard (defense-in-depth)

retrieval_owner_matches(owner_filter, …) returns TRUE for every row when owner_filter IS NULL (fails open by design), and RLS is service-role-only, so the app filter is the sole tenant boundary. The full fix (matcher null → deny + an UNSCOPED_ALL sentinel across the RPCs) is a coupled SQL change that can't be regression-verified while Supabase Preview is red (see note below) — so this ships the zero-risk half now: a test asserting every src/ .rpc() owner_filter argument comes from a sanctioned scope helper (retrievalOwnerFilter / requireOwnerScope / ownerScopeForDocumentFilteredRetrieval) or the public sentinel, and is never a literal null. Trips CI if a future callsite reintroduces the fail-open.

Still needs live access (not in this PR)

Verification

tsc ✅ · eslint 0 errors ✅ · guard test passes against current main. (#5 needs the WebKit CI leg.)

🤖 Generated with Claude Code

…callsites

Two follow-ups from the 48h PR review.

- tests/ui-tools.spec.ts (#5): the "phone bottom search dock hides while scrolling" test failed on
  WebKit only (release-browser-matrix) because WebKit doesn't reliably emit a native scroll event for
  a programmatic scrollTo, so useHideOnScroll never ran and data-scroll-hidden stayed unset. Dispatch
  an explicit scroll event after each scrollTo; harmless on Chromium/Firefox (the rAF guard dedupes).

- tests/retrieval-owner-filter-guard.test.ts (#3): defense-in-depth tripwire. The SQL
  retrieval_owner_matches fails OPEN on a null owner_filter and RLS is service-role-only, so the app
  filter is the sole tenant boundary. Until the matcher is made fail-closed (gated on the Supabase
  Preview migration-drift fix so the SQL change is verifiable), this asserts every src .rpc()
  owner_filter argument comes from a sanctioned scope helper / the public sentinel, never a literal null.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@supabase

supabase Bot commented Jul 8, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 8, 2026 06:55
BigSimmo and others added 3 commits July 8, 2026 14:57
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…node drift)

Use the string-returning readdirSync recursive overload instead of withFileTypes so the scan
doesn't depend on Dirent.parentPath/path, which differ across @types/node versions and failed
the CI typecheck (TS2339 Property 'path' does not exist on Dirent).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@BigSimmo
BigSimmo merged commit d5fd4ee into main Jul 8, 2026
5 checks passed
@BigSimmo
BigSimmo deleted the claude/review-followups-guard branch July 9, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant