Skip to content

fix: restore raw StoreProduct.releaseDate, normalize only in PDP JSON-LD - #3508

Merged
lariciamota merged 4 commits into
mainfrom
fix/release-date-raw-passthrough
Oct 2, 2026
Merged

lariciamota merged 4 commits into
mainfrom
fix/release-date-raw-passthrough

Conversation

@lariciamota

@lariciamota lariciamota commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What

Puts StoreProduct.releaseDate back to the raw value Intelligent Search returns. The ISO 8601 normalization added in #3465 now runs only where the PDP builds its application/ld+json.

Before (4.7.0 – 4.8.x) After
StoreProduct.releaseDate (GraphQL) "2026-03-23" "1774224000000", as returned upstream (same as before 4.7.0)
PDP JSON-LD releaseDate "2026-03-23" "2026-03-23", unchanged

Why

#3465 (SO-666) needed an ISO date in the structured data, but it did the normalization in the API resolver. That changed the field's format for everyone who reads it, and store customizations that parse the epoch-ms value broke. Search & Recommendation reported this as a bug against FS 4.8.0, related feature ELOR-5408. The change first shipped in 4.7.0.

The JSON-LD is the only consumer that needs ISO, and it is built in @faststore/core, so the conversion now lives there.

Changes

  • @faststore/api: the resolver returns releaseDate ?? '' again, and utils/releaseDate.ts is removed. The schema description no longer says ISO 8601, because upstream doesn't guarantee that format. The type stays String!.
  • @faststore/core: the normalizer moves to src/utils/productJsonLd.ts as toProductJsonLdReleaseDate, next to toProductJsonLdOffer. p.tsx applies it only to ProductJsonLd. Its behavior is unchanged: epoch ms or seconds and ISO strings become a UTC calendar day, and empty or unparseable input gives ''.
  • Generated: __generated__/schema.ts and @generated/graphql.ts were regenerated with codegen. Only the description text changed.

Notes for review

  • Behavior change: this reverts the format change from 4.7.0. A store that already adapted to ISO on 4.7 or 4.8 gets epoch ms again. That seems unlikely, since the ISO format was out for about a month and the epoch format had been the contract since feat: Product releaseDate #1438, but it should go in the changelog.
  • Hotfix to main: this targets main directly, following the precedent of fix(core): prevent IS redirect hang and improve scroll restoration #3437 (4.5.1), so it ships as 4.9.1 without waiting for the next dev → main graduation. It should be back-merged into dev afterwards. There are no 4.7.x/4.8.x maintenance branches, so stores on 4.7 or 4.8 get the fix by bumping to 4.9.1.

Testing

  • packages/api: the resolver tests pass (25). The new releaseDate tests check that epoch ms and ISO values come through unchanged and that null or undefined give ''.
  • packages/core: productJsonLd.test.ts and productJsonLdRendering.test.tsx pass (37). This includes the 13 normalizer cases that moved over from the API.
  • tsc --noEmit reports no errors in src for either package, and Biome is clean.
  • Render the reported SKU through ci/codesandbox. Check that a customization reading releaseDate gets epoch ms and that the JSON-LD still passes the Google Rich Results Test.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • Product data now returns catalog-provided release dates unchanged, or an empty string when no value is available.
    • Structured product metadata converts interpretable release dates to UTC dates and omits missing or invalid dates.
    • Structured metadata supports release dates provided as epoch milliseconds, epoch seconds, or ISO 8601 strings.
    • Empty product identifiers are omitted from structured metadata.

@lariciamota
lariciamota requested a review from a team as a code owner October 1, 2026 20:22
@lariciamota
lariciamota requested review from eduardoformiga and gabpaladino and removed request for a team October 1, 2026 20:22
@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: vtex/faststore/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 3e392787-e9ec-4f14-920e-7d368e29c439

📥 Commits

Reviewing files that changed from the base of the PR and between a858737 and 5b3ad56.

⛔ Files ignored due to path filters (2)
  • packages/api/src/__generated__/schema.ts is excluded by !**/__generated__/** and included by packages/**
  • packages/core/@generated/graphql.ts is excluded by !**/@generated/**, !**/@generated/** and included by packages/**
📒 Files selected for processing (2)
  • packages/api/src/platforms/vtex/typeDefs/product.graphql
  • packages/api/test/unit/platforms/vtex/resolvers/product.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/api/src/platforms/vtex/typeDefs/product.graphql

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

The VTEX API now passes through Intelligent Search release dates. The product page normalizes release dates to UTC calendar dates and maps product identifiers before passing them to ProductJsonLd.

Changes

Product release date flow

Layer / File(s) Summary
Preserve API release date
packages/api/src/platforms/vtex/typeDefs/product.graphql, packages/api/src/platforms/vtex/resolvers/product.ts, packages/api/src/platforms/vtex/utils/releaseDate.ts, packages/api/test/unit/platforms/vtex/resolvers/product.test.ts
The resolver returns the Intelligent Search value unchanged, or an empty string when it is nullish. The GraphQL description and tests reflect this behavior. The previous date normalization utility is removed.
Normalize identifiers for JSON-LD
packages/core/src/utils/productJsonLd.ts, packages/core/src/pages/[slug]/p.tsx, packages/core/test/utils/productJsonLd.test.ts, packages/core/test/utils/productJsonLdRendering.test.tsx
A utility normalizes release dates to UTC YYYY-MM-DD strings and maps nonempty gtin and mpn values. The product page passes the mapped identifiers to ProductJsonLd. Tests cover date formats, invalid or absent inputs, and rendered JSON-LD.

Priority: ⬆️ High

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: 🔵 Low · up to 5b3ad

The PDP continues to emit normalized JSON-LD dates, but the public GraphQL field again exposes raw catalog values. Stores relying on the ISO output introduced in 4.7 may need to adjust; merge is reasonable with the stated upgrade notice.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 6 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: restoring raw StoreProduct.releaseDate values and limiting normalization to PDP JSON-LD generation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 6 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@codesandbox-ci

codesandbox-ci Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

// Stores read this field directly, so its format is a public contract. The
// JSON-LD normalization lives in `@faststore/core` and must not leak here.
it('passes epoch milliseconds through unchanged', () => {
expect(resolve('1774224000000')).toBe('1774224000000')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Functional.LargerDefect] 🟡 RESTRICT

The StoreProduct.releaseDate resolver's tests change from asserting normalization of epoch/ISO input into an ISO calendar date to asserting a raw passthrough. The adjacent comment explicitly states this field 'is a public contract' read directly by stores, so GraphQL consumers will now receive raw values (e.g. '1774224000000' or a full ISO datetime) instead of a normalized calendar date ('2026-03-23'). No migration guide, deprecation notice, or BREAKING CHANGE marker is visible for this contract change.

Action: Confirm whether releaseDate is an already-shipped/stable GraphQL field. If so, add a deprecation/migration note and a BREAKING CHANGE marker per AGENTS.md, or keep normalizing in the resolver and only reuse the new util internally so the public contract doesn't change.

To dismiss: reply /dk-review dismiss [reason] under this comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/dk-review dismiss This PR restores the pre-4.7.0 contract and does not introduce a new one. releaseDate has returned the raw Intelligent Search value (epoch ms) since #1438. #3465 switched it to ISO without a BREAKING CHANGE marker, and that broke store customizations, which is the regression fixed here. Adding BREAKING CHANGE would make Lerna cut a major for a regression fix and would rule out backporting it as a patch to 4.7.x/4.8.x. Keeping the normalization in the resolver is the reported bug. The behavior change is described under "Notes for review" in the PR description and will be called out in the changelog.

@dk-pr-review

dk-pr-review Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

DK Review — Audit Summary

Verdict: ✅ CLEAN

Severity Count
BLOCK 0
RESTRICT 0
SUGGEST 3

Only BLOCK and RESTRICT findings anchored to a changed line are commented inline on the diff. The 3 findings below open no review thread.

Scenarios evaluated: feature-flags, general-review, quality-ratchet
Scenarios skipped: dependency-governance (no matching files), pipeline-config (no matching files), agent-skills-review (no matching files)


📋 Findings (3)

SUGGEST

  1. [general.broken-references] packages/api/test/unit/platforms/vtex/resolvers/product.test.ts:607 — Comment cites issue/PR "feat: Product releaseDate #1438" as the origin of the raw-passthrough behavior. This reference cannot be verified from the diff — confirm the number is correct before merge, since an incorrect ticket reference will mislead future readers trying to trace the history of this field.
    → Double-check that feat: Product releaseDate #1438 is the correct issue/PR number, or link the full URL so it's unambiguous which repo/tracker it refers to.
  2. [Functional.LargerDefect] packages/api/src/platforms/vtex/typeDefs/product.graphql:70 — This PR changes the observable contract of the public StoreProduct.releaseDate field a second time: 4.7.0 normalized it to ISO 8601, and this PR reverts it to raw passthrough (epoch ms or ISO string, unvalidated). Any downstream store that adapted to the ISO behavior shipped in 4.7.0 will silently regress. AGENTS.md's Test-Driven Stability principle requires breaking changes to include migration guides and deprecation warnings, and none is evident in this diff.
    → Call out this behavior reversal explicitly in the PR description/changelog (and consider a BREAKING CHANGE note) so consumers who adapted to the brief 4.7.0 ISO-normalized output are aware they need to parse the field themselves again.
  3. [quality.new-logic-enforcement] packages/core/test/utils/productJsonLd.test.ts:202 — The new toProductJsonLdIdentifiers function is only tested with all-fields-empty and all-fields-empty-with-invalid-releaseDate cases. There is no test for the mixed case where gtin/mpn are valid while releaseDate is invalid (or vice versa), so the claimed per-field omission behavior ('omits every identifier that is empty') is not actually verified for partial combinations.
    → Add a test case with a valid gtin/mpn and an invalid or empty releaseDate (and the inverse) to confirm each identifier is independently included/omitted rather than all-or-nothing.

DK Review v1.0.0 | To dismiss a finding: reply /dk-review dismiss [reason] under its comment

@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@faststore/api

npm i https://pkg.pr.new/vtex/faststore/@faststore/api@5b3ad56

@faststore/cli

npm i https://pkg.pr.new/vtex/faststore/@faststore/cli@5b3ad56

@faststore/components

npm i https://pkg.pr.new/vtex/faststore/@faststore/components@5b3ad56

@faststore/core

npm i https://pkg.pr.new/vtex/faststore/@faststore/core@5b3ad56

@faststore/diagnostics

npm i https://pkg.pr.new/vtex/faststore/@faststore/diagnostics@5b3ad56

@faststore/lighthouse

npm i https://pkg.pr.new/vtex/faststore/@faststore/lighthouse@5b3ad56

@faststore/sdk

npm i https://pkg.pr.new/vtex/faststore/@faststore/sdk@5b3ad56

@faststore/ui

npm i https://pkg.pr.new/vtex/faststore/@faststore/ui@5b3ad56

commit: 5b3ad56

['an unparseable value', 'not-a-date'],
])('passes %s through unchanged', (_label, input) => {
expect(resolve(input)).toBe(input)
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Functional.Interface] 🔴 BLOCK

The StoreProduct.releaseDate resolver's output contract changed from a guaranteed ISO calendar date or empty string to a raw pass-through of unvalidated platform data (including empty strings, whitespace, and unparseable garbage such as 'not-a-date'). The PR's own comment states 'Stores read this field directly, so its format is a public contract,' yet this is a breaking change to that contract with no deprecation warning or migration guide, and any GraphQL consumer that doesn't independently re-normalize via the new core utility will now receive inconsistent or malformed date strings where it previously received a safe, normalized value.

Action: Either keep minimal validation/normalization in the resolver so the public GraphQL field remains a stable contract, or, if the contract is intentionally being relaxed, document the breaking change with a deprecation notice and migration guide per AGENTS.md section VI and communicate it to downstream store consumers.

To dismiss: reply /dk-review dismiss [reason] under this comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/dk-review dismiss Same finding as the earlier RESTRICT on this field, which was dismissed. Passing malformed values through is the pre-4.7.0 contract, not something this PR adds. Before #3465 the resolver was exactly releaseDate ?? '', so empty, whitespace and unparseable values already reached consumers unchanged. The new tests pin that restored behavior so it can't drift silently again. Normalizing in the resolver is the regression reported by Search & Recommendation, and a BREAKING CHANGE marker would force a major for a regression fix that has to ship as a patch on 4.7.x/4.8.x.


it('converts epoch milliseconds to an ISO calendar date', () => {
expect(resolve('1774224000000')).toBe('2026-03-23')
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Evolvability.Organizational] 🟡 RESTRICT

The VTEX-specific epoch-vs-seconds threshold heuristic and raw date-format parsing (previously exercised in the platform-specific resolver test) has been relocated into @faststore/core's platform-agnostic JSON-LD utility (toProductJsonLdReleaseDate). Per AGENTS.md, @faststore/api is meant to 'handle platform-specific integrations' while @faststore/core orchestrates packages generically; housing VTEX's raw epoch-encoding quirks in core couples the integration layer to one platform's data format, so every future platform integration must re-teach core about its own raw date encoding instead of normalizing at the platform boundary.

Action: Consider keeping platform-specific raw-value normalization (epoch threshold detection, etc.) in the @faststore/api VTEX platform layer, and have @faststore/core's JSON-LD utility only operate on an already-normalized, platform-agnostic date value.

To dismiss: reply /dk-review dismiss [reason] under this comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed that core is the wrong long-term home for epoch detection, but it's out of scope for this PR. The clean fix is to normalize at the platform boundary and expose that value through the schema, e.g. a releaseDate(format: ISO) argument or a separate field. Either way it adds to the public GraphQL surface, which doesn't belong in a fix that will be backported as a patch. For now core reads the format the schema description documents ("usually epoch milliseconds, some accounts store an ISO 8601 string"), and epoch ms isn't a VTEX-specific encoding. I'm tracking the move to the API layer as a follow-up.

@hellofanny hellofanny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's good: This is a solid regression fix with proper test coverage (25 API + 37 core tests, all passing). The move of normalization from the resolver to JSON-LD builder correctly isolates the ISO formatting to where it's actually needed.

Context for the DK Review findings: The [Functional.Interface] BLOCK is technically correct—this does change the contract from 4.7.0–4.8.x. However, it's reframing the actual issue: #3465 introduced ISO without a BREAKING CHANGE marker and broke stores parsing epoch ms. This PR restores the pre-4.7.0 contract (the original contract since #1438). The dismissal is reasonable: adding BREAKING CHANGE would force a major version, which blocks backporting as a patch to 4.7.x/4.8.x where the regression exists.

Two details to confirm before merge:

Changelog entry: The PR description mentions the format change will be in the changelog. ✅ Confirm this is queued so upgraders from 4.7/4.8 see it.
Architecture note (non-blocking): The epoch-vs-seconds threshold logic now lives in @faststore/core, coupling it to VTEX's date encoding. Consider a follow-up to move VTEX-specific normalization back to the resolver boundary—this keeps core truly platform-agnostic. (This can be a separate refinement; the current design works.)

The regression fix is sound and ready.

@lariciamota

Copy link
Copy Markdown
Contributor Author

@hellofanny thanks for the review!

  • Changelog: Lerna builds it from conventional commits, so after the squash merge this shows up under Bug Fixes as "restore raw StoreProduct.releaseDate, normalize only in PDP JSON-LD". I'll also call it out in the graduate PR description so people upgrading from 4.7/4.8 see it.
  • Architecture: agreed, I'm tracking it as a follow-up: normalize in the VTEX platform layer and expose the ISO value through the schema, so core no longer needs the epoch heuristic. More detail in the reply on the dk-review thread.

lariciamota and others added 2 commits October 1, 2026 18:34
#3465 normalized `StoreProduct.releaseDate` to ISO 8601 in the API
resolver so the PDP JSON-LD would be Schema.org compliant. That changed
the field's format for every consumer, breaking store customizations
that read the epoch-milliseconds value Intelligent Search has always
returned (reported on FS 4.8.0, shipped in 4.7.0).

The resolver now passes the value through again, as it did before 4.7.0.
The normalizer moves to `@faststore/core` (`toProductJsonLdReleaseDate`
in `src/utils/productJsonLd.ts`) and is applied only where the PDP builds
`ProductJsonLd`, so the structured data still publishes `YYYY-MM-DD`.

The schema description no longer claims ISO 8601, which the upstream
value does not guarantee; generated types were regenerated via codegen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lariciamota
lariciamota force-pushed the fix/release-date-raw-passthrough branch from 5112345 to 637ef22 Compare October 1, 2026 21:34
@lariciamota
lariciamota changed the base branch from dev to main October 1, 2026 21:34
Comment thread packages/core/src/pages/[slug]/p.tsx Outdated
{...(product.gtin && { gtin: product.gtin })}
{...(product.mpn && { mpn: product.mpn })}
{...(product.releaseDate && { releaseDate: product.releaseDate })}
{...(releaseDate && { releaseDate })}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

productJsonLd.test.ts covers toProductJsonLdReleaseDate, and productJsonLdRendering.test.tsx only checks that next-seo omits an absent prop (mpn). Nothing renders this page with an epoch and reads the script.

This line is the whole SEO fix. Putting product.releaseDate back here leaves the suite green and publishes "1774224000000" in the application/ld+json again. Add a rendering assertion that product.releaseDate = "1774224000000" shows up as "2026-03-23".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed in a858737.

The identifier props (gtin, mpn, releaseDate) now come from toProductJsonLdIdentifiers in src/utils/productJsonLd.ts, and this line spreads {...toProductJsonLdIdentifiers(product)}. productJsonLdRendering.test.tsx renders ProductJsonLd from that helper with releaseDate: "1774224000000" and asserts the script publishes "2026-03-23" with no empty gtin/mpn. I checked that it catches the regression: if the helper passes releaseDate through raw, that test fails.

I didn't render the whole page. p.tsx pulls in ~40 imports (CMS sections, session, router, getStaticProps), and a page-level test would mostly exercise mocks. The trade-off is that going back to the bug now means removing the helper call here, which a review would see, but no test enforces it. If you think page-level coverage is worth that cost, I can add it in a follow-up.

`p.tsx` normalized `releaseDate` inline, so reverting that line to
`product.releaseDate` would publish the raw epoch again while every test
stayed green: the normalizer was covered, the page's use of it was not.

The JSON-LD identifier props (`gtin`, `mpn`, `releaseDate`) now come from
`toProductJsonLdIdentifiers` in `src/utils/productJsonLd.ts`, which `p.tsx`
spreads into `ProductJsonLd`. A rendering test feeds it an epoch through
next-seo and asserts the published script carries `"2026-03-23"`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
// Stores read this field directly, so its format is a public contract. The
// JSON-LD normalization lives in `@faststore/core` and must not leak here.
it('passes epoch milliseconds through unchanged', () => {
expect(resolve('1774224000000')).toBe('1774224000000')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Functional.LargerDefect] 🔴 BLOCK

The StoreProduct.releaseDate resolver's behavior silently changed from normalizing epoch/ISO inputs to a canonical ISO calendar date, to passing the raw value through unchanged. This is a breaking change to a documented public GraphQL field contract ('Stores read this field directly, so its format is a public contract') with no deprecation notice or migration guide, risking regressions for any consumer other than @faststore/core that relied on the previous normalized output.

Action: Document this as a breaking change (changelog/migration guide, possibly a major version bump per Conventional Commits), or keep normalizing at the API layer and have @faststore/core consume the already-normalized value instead of re-deriving it.
Source: AGENTS.md Architectural Principles VI: 'Breaking changes MUST include migration guides and deprecation warnings.'

To dismiss: reply /dk-review dismiss [reason] under this comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/dk-review dismiss Same finding dismissed twice already on this PR (discussion_r4160216521, discussion_r4160475956). The breaking change was #3465 in 4.7.0. This PR restores the raw-passthrough behavior the field has had since #1438. A BREAKING CHANGE marker would make Lerna cut a major for a regression fix, and normalizing in the resolver is the bug that was reported. In 5b3ad56 I reworded the test comment to say this explicitly.

['an unparseable value', 'not-a-date'],
])('passes %s through unchanged', (_label, input) => {
expect(resolve(input)).toBe(input)
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Functional.Check] 🟡 RESTRICT

The resolver now passes malformed releaseDate values (empty string, whitespace, unparseable text like 'not-a-date') straight through to the GraphQL response instead of sanitizing them, removing the validation that previously guaranteed callers never saw 'Invalid Date' or garbage strings. Any API consumer that doesn't go through @faststore/core's new toProductJsonLdReleaseDate/toProductJsonLdIdentifiers will now receive unvalidated raw data.

Action: If validation is intentionally being pushed to consumers, state this explicitly in the GraphQL schema field description so external integrators are aware, or add a lightweight sanity check at the resolver boundary for obviously-invalid values.

To dismiss: reply /dk-review dismiss [reason] under this comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Took the first option in 5b3ad56. The schema description now says the value is passed through exactly as the catalog returns it, without validation or normalization, that it may be empty, and that consumers should parse and validate it before use (generated types regenerated). I didn't add a sanity check at the resolver. Rewriting values there, even obviously invalid ones, is the kind of change that broke stores in 4.7.0, and before #3465 this field never filtered anything.

@lariciamota
lariciamota requested a review from lemagnetic October 2, 2026 12:27
The schema description now says the value is passed through exactly as
the catalog returns it, may be empty, and must be parsed and validated
by the consumer. Generated types were regenerated via codegen.

The resolver test comment now frames the passthrough as the field's
original behavior that 4.7.0 briefly changed, and the ISO case is split
into a plain date and a date-time so each test title matches its input.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonar-workflows

Copy link
Copy Markdown

@lariciamota
lariciamota merged commit fb0112d into main Oct 2, 2026
18 of 19 checks passed
lariciamota added a commit that referenced this pull request Oct 5, 2026
## Summary

- Traz para `dev` os commits de `main` que ficaram de fora depois da
`v4.9.0`: o fix de `releaseDate` (#3508), a `v4.9.1`, o fix de
session/cart (#3511) e a `v4.9.2`.
- O único commit que existia só em `dev` era o release `4.9.1-dev.0`
(bump de versão). Ele conflita com a `4.9.2` e foi resolvido ficando na
versão da `main`. A árvore desta branch é idêntica à `origin/main`.
- Mergear este PR em `dev` (merge commit, sem squash) deixa `dev`
atualizada com `main`.

## Test plan

- [ ] Conferir que o diff contra `dev` é só o que entrou na `main` desde
a `v4.9.0` (releaseDate, session/cart e bumps `4.9.1` / `4.9.2`)
- [ ] Mergear com **Create a merge commit**, sem squash, para `dev`
passar a conter os commits da `main`
- [ ] CI verde
- [ ] Depois do merge, o workflow `release:dev` publica o próximo
prerelease a partir da `v4.9.2`


Made with [Cursor](https://cursor.com)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Product release dates now retain their original values in product
data, while dates in product structured data are normalized to ISO
format.
* Session updates for cart validation and region changes no longer
include UI-only status flags, helping prevent those flags from being
stored or sent as session data.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: vtexgithubbot <[email protected]>
Co-authored-by: Cursor <[email protected]>
@eduardoformiga eduardoformiga mentioned this pull request Oct 15, 2026
2 of 7 tasks
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.

3 participants