Skip to content

fix(explorer): normalize invalid account filters and scope crawl exclusions - #1450

Open
juandolealt wants to merge 1 commit into
mainfrom
pyramid/4f725f40-79ea-4505-b283-5b03f2ef3970
Open

juandolealt wants to merge 1 commit into
mainfrom
pyramid/4f725f40-79ea-4505-b283-5b03f2ef3970

Conversation

@juandolealt

Copy link
Copy Markdown
Member

Changes

  • Ignore malformed non-string optional a filters on legacy token and address routes instead of throwing HTTP 500. TanStack parses ?a=444 as a number before the former string validator runs.
  • Preserve valid address filters, pagination and existing string-filter behavior.
  • Make token account-query robots exclusions outrank Allow: /token/, whether a is first or later in the query string.
  • Add regressions for all four Search Console examples and existing crawl policy.

Verification

  • New regressions reproduce the original bugs: 16 failures before the fix; all 39 pass after it.
  • Explorer: 518 node tests pass (one existing social-card test skipped), 213 worker tests pass, typecheck and production build pass.
  • Changed-file Biome and root precommit pass.
  • Root pnpm check/pnpm check:types still fail on 120 missing Env-binding type errors in untouched apps/contract-verification; reproduced in that workspace alone, with no explorer type errors.
  • Built-runtime HTTP checks: a=444, 505, 527, 622 all redirect to the normal address page and return 200; a valid address filter remains intact.

Screenshots

Production before Local fix after
Uncaught account-filter validation error Normal address route after filtering malformed input

The local preview confirms routing and the UI shell; external transfer-data panels remain loading. Production is unchanged. Google needs to recrawl after deployment.

Full Search Console audit and evidence: https://pyramid.tehq.net/threads/d6b799aa-f253-497f-b115-629462c8669c

@tempoxyz-bot

tempoxyz-bot commented Nov 9, 2026 •

Copy link
Copy Markdown

👁️ Cyclops Security Review

✅ Reviewed 06119bc (latest) · Coverage: partial · no open findings · report
⚠️ Not checked: Malformed account-filter normalization and transfer-data consumption: ruled out without reading the cited code at this commit
⚠️ Not checked: Legacy-token tab selection: ruled out without reading the cited code at this commit

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Bundle Size Report

Metric Size Δ Change
Total 18.0 MB +118.0 B (+0.0%)
Gzip 4.0 MB +127.0 B (+0.0%)
Brotli 3.4 MB +108.0 B (+0.0%)

Compared against main branch (baseline from 11/8/2026, 8:47:41 PM)

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Cloudflare Deployments

App Environment Status Preview
explorer devnet [OK] Deployed View Preview
explorer mainnet [OK] Deployed View Preview
explorer nextfork [OK] Deployed View Preview
explorer testnet [OK] Deployed View Preview
explorer zone-prover [OK] Deployed View Preview
fee-payer devnet [>>] Skipped No changes
fee-payer moderato [>>] Skipped No changes
og - [>>] Skipped No changes
reth-snapshots-viewer - [>>] Skipped No changes
tempo-snapshots-viewer - [>>] Skipped No changes
tokenlist - [>>] Skipped No changes

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment on lines 10 to 12
page: z.optional(z.number()),
limit: z.optional(z.number()),
tab: z.optional(z.string()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟣 pre-existing, not blocking: pre-existing: Legacy token URLs with a malformed page, limit or tab still fail route validation, the same way ?a=444 did before this fix. Only a gets the catch fallback; page/limit use bare z.optional(z.number()) and tab uses z.optional(z.string()). Fix: wrap every optional param in this redirect-only schema with z.catch(..., undefined), as accountFilterSearchSchema does, so beforeLoad always redirects to the address page. Examples: ?page=abc stays a string and ?tab=123 becomes a number after JSON parsing.
A small fix can ride a push you are already making; otherwise a short reply is enough.

Why this was flagged

TanStack's defaultParseSearch JSON-parses query values. So /token/0x...?tab=123 gives tab the number 123, and /token/0x...?page=abc gives page the string "abc". The schema at apps/explorer/src/routes/_layout/token/$address.tsx:10-12 rejects both, and validation fails before beforeLoad can redirect. That is the HTTP 500 failure this PR fixes for a at line 13. The diff changes only a, so these sibling params on the same legacy redirect route behave as on the base branch, and crawled or hand-edited legacy links still error instead of redirecting. Nothing else guards it: there is no catch or coerce on lines 10-12, and the route renders component: () => null, so it only exists to redirect.

Verification: The trigger is a legacy token URL whose page/limit value is not valid JSON, or whose tab value parses as a non-string. In apps/explorer/src/routes/_layout/token/$address.tsx:9-14 the diff wraps only a in the catch fallback. validateSearch therefore throws before beforeLoad (lines 15-39) can issue its redirect. The base branch fails the same way, so this is pre-existing.

This branch has not been deployed

No deployments
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.

2 participants