Repository navigation
fix(apps-vtex,blocks): PLP pagination stuck on page 1 for ?page=N (#391) - #394
Merged
Merged
Conversation
…uests Two compounding defects (production repro on farmrio-storefront): 1. productListingPage.ts used `Number.isFinite(rawPage)` to validate `props.page`, but `Number.isFinite` does NOT coerce — a string page value silently fell back to page 0 instead of being parsed. Extracted the page-resolution logic into an exported `resolvePage()` helper that coerces first and only falls back to the URL parse when the coerced value is non-finite. 2. resolve.ts's commerce-loader URL search-param auto-injection populated `props.page` with the raw 1-indexed URL string, bypassing the loader's own 1-indexed → 0-indexed conversion and producing an off-by-one on top of the un-coerced-string bug. `page` is now skipped in that injection loop (loaders that read `__pageUrl` apply their own conversion); `count`/`pageOffset` are coerced to numbers instead of raw strings. Fixes #391 Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
🎉 This PR is included in version 7.22.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
JonasJesus42
added a commit
that referenced
this pull request
Sep 28, 2026
Every row now has a "Fix no framework" column, verified against actual git log / regression tests in this repo rather than the problem description alone: a PR/commit reference where a real fix landed, or an explicit stamp that no framework change resolves it (platform limitation, by-design behavior, different repo, or site-code authoring mistake). Also corrects two stale claims found during verification: matchers ARE registered by default already (registerBuiltinMatchers() is called from createSiteSetup()); the pagination-string-coercion fix is PR #394, not #391. And rewrites the bulk-redirect-table entry in the worker memory section - it's no longer a manual per-site script, the framework now natively offloads exact redirect rules to KV (commit 4ea6df7). Co-Authored-By: Claude Sonnet 5 <[email protected]>
2 tasks
JonasJesus42
added a commit
that referenced
this pull request
Sep 28, 2026
…562) ## Summary - Consolidates every documented migration problem (Fresh/Deno → TanStack Start, and the `@decocms/start` → package-split migration) into a single validation checklist: `MIGRATION_KNOWN_ISSUES.md` - Sourced from `CLAUDE.md`, `.agents/skills/deco-to-tanstack-migration/references/*`, `.agents/skills/decocms-v6-to-v7-upgrade/`, `.cursor/skills/deco-server-functions-invoke/`, `MIGRATION_TOOLING_PLAN.md`, regression tests with historical incident comments, and persisted memory (VTEX creds, Studio/decofile, crypto-key-in-CF-Workers, wrangler bindings, NativeWind/image gotchas) - 12 categories (SSR/hydration, cache, package split, migration-script tooling, CSS/Tailwind, VTEX/commerce, matchers, HTMX/islands, CMS/Studio, deploy/secrets, SEO, native-app companion), each item with symptom / root cause / source / how-to-validate - Meant to be run against every future site migration as a checklist, and extended with new findings as they come up ## Test plan - [ ] Docs-only change, no build/test impact - [ ] Skim each category once for accuracy against current codebase state <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds `MIGRATION_KNOWN_ISSUES.md`, a consolidated checklist of every documented migration problem (Fresh/Deno → TanStack Start and the `@decocms/start` → package-split migration) to run against every future site migration. Each item carries a framework-fix status — fixed, partial, or no framework fix — stamped against real `git log`/regression tests rather than the problem descriptions. Verification also corrected two stale claims (matchers are registered by default already; the pagination-coercion fix is PR #394, not #391) and rewrote the bulk-redirects entry: exact redirect rules are now offloaded to KV natively instead of via a per-site script. A dedicated category covers Cloudflare Worker memory and KV offload, including the fast-deploy three-piece requirement, the `loadBlocks()` module-scope trap, and streaming large proxy responses. Docs-only change, no build or test impact. <sup>Written for commit 272d8da. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/decocms/blocks/pull/562?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> --------- Co-authored-by: Claude Sonnet 5 <[email protected]>
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
productListingPage.tsusedNumber.isFinite(rawPage)to validateprops.page, butNumber.isFinitedoes NOT coerce — a string page value silently fell back to page 0. Extracted the logic into an exported, unit-testedresolvePage()helper that coerces first and only falls through to the URL parse when the coerced value is non-finite.resolve.ts's commerce-loader URL search-param auto-injection populatedprops.pagewith the raw 1-indexed URL string, bypassing the loader's own 1-indexed→0-indexed conversion (a second, independent off-by-one on top of the string bug).pageis now skipped in that injection loop;count/pageOffsetare coerced to numbers instead of raw strings.Fixes #391
Test plan
resolvePage()unit tests: string coercion, malformed URL param, props.page priority over URL, floor/negative clampingresolve.tstests:pagenever auto-injected,count/pageOffsetcoerced to numberbunx vitest rungreen for both touched packagestsc --noEmitclean for apps-vtex and blocks🤖 Generated with Claude Code
Summary by cubic
Fixes PLP pagination getting stuck on page 1 when using ?page=N by correctly coercing and converting page values. Prevents off-by-one errors from URL param injection. Fixes #391.
apps-vtex: AddedresolvePage()to coerceprops.page, parse?page=(1-indexed → 0-indexed), floor values, and clamp negatives.blocks: Stopped auto-injectingpagefrom URL into loader props;countandpageOffsetare now coerced to numbers.Written for commit 765d418. Summary will update on new commits.