Skip to content

Land #4551 (RSC prerender cache empty-payload fix): resolve test threads, merge, cherry-pick to release/17.0.0 #4566

Description

@justin808

Goal

Land PR #4551 ([Pro] Fix RSC payload prerender cache storing an empty payload) — the server half of shakacode/react_on_rails_rsc#187 (infinite RSC payload retry loop) — and cherry-pick it to release/17.0.0.

Locked decisions

  • Implementation is approved as-is (CodeRabbit approved, CI green). No implementation changes — only the three open review threads, all test-level:
    1. Ihab: the request spec (react_on_rails_pro/spec/dummy/spec/requests/rsc_payload_spec.rb) never reaches the cached response — the dummy generates a fresh CSP nonce per request, which changes the prerender cache key, so both calls render through Node. Make the second request actually hit the cache (pin/stub the nonce or use a cache key the test controls), and assert the cached path.
    2. Ihab: pin the chunk.dup behavior directly in a helper spec (react_on_rails_pro_helper.rb) so the endpoint test still fails if the code regresses to chunk.delete("html").
    3. Greptile P2: cover the second cache hit in the destructive-consumer replay test (stream_cache_spec.rb).
  • Merge to main via merge queue, then cherry-pick to release/17.0.0 (confirmed RC-line stabilizer: wrong-output bug — an empty payload gets cached and served).

Scope / collision set

Ruby only: react_on_rails_pro/lib/react_on_rails_pro/stream_cache.rb, react_on_rails_pro/app/helpers/react_on_rails_pro_helper.rb, specs, CHANGELOG.md (collides with every other item — rebase last-merged).

Acceptance criteria

Dependencies

None (fully parallel with the other items except the shared CHANGELOG.md line).

Metadata

Metadata

Assignees

No one assigned

    Labels

    release:17.0.0-must-haveMust-have for 17.0.0: critical bug/perf/usability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions