Skip to content

fix: return minimal JSON-safe bootstrap snapshots - #857

Merged
roncohen merged 6 commits into
mainfrom
fix/minimal-bootstrap-snapshot
Dec 2, 2026
Merged

roncohen merged 6 commits into
mainfrom
fix/minimal-bootstrap-snapshot

Conversation

@roncohen

@roncohen roncohen commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

Bootstrap snapshots copy evaluation details the client does not use. They can also contain undefined properties, which Next.js rejects when the snapshot is returned directly from getServerSideProps.

What changed

  • Return JSON-safe snapshots without the repeated flag key, matched rule ID, allocation indices, rule destinations, or undefined properties. Keep the flag values and metadata needed to restore client state, record checks, and refresh flags.
  • Keep value required in the Node SDK's snapshot type, so apps can upgrade Node without upgrading their browser SDK at the same time. Node omits flags without an evaluated value; reads still use their fallback. An evaluated null is preserved.
  • Let Browser and framework SDKs read v2 snapshots without ruleResults. The SDKs still write rule results and their IDs because older v2 readers reject snapshots without them. The full evaluator, raw result APIs, and live response validation are unchanged.

Verification

  • Generated documentation with yarn docs and ran the Node, Browser, React, Vue, and React Native test suites.
  • Checked that both direct and bound Node snapshots are assignable to the published Browser and React SDK 2.0.0 types.
  • Passed a snapshot from the built Node SDK directly through the Next.js Pages Router props validator and loaded the same snapshot with the published Browser SDK 2.0.0.
  • Verified that checks retain the selected variant and its source version when a snapshot omits rule results, and that live responses without rule results are still rejected.

@roncohen
roncohen marked this pull request as ready for review December 1, 2026 14:39

@reflag-review reflag-review 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.

Risk: medium

no actionable findings

@reflag-review reflag-review 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.

Risk: medium

no actionable findings

@reflag-review reflag-review 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.

Risk: medium

no actionable findings

@roncohen
roncohen enabled auto-merge December 2, 2026 13:32
@roncohen
roncohen added this pull request to the merge queue Dec 2, 2026
@roncohen
roncohen removed this pull request from the merge queue due to a manual request Dec 2, 2026
@roncohen
roncohen enabled auto-merge December 2, 2026 13:42

@reflag-review reflag-review 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.

Risk: medium

no actionable findings

@roncohen
roncohen added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 0dafcd5 Dec 2, 2026
9 checks passed
@roncohen
roncohen deleted the fix/minimal-bootstrap-snapshot branch December 2, 2026 14:03
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