Skip to content

Fix incremental rendering integration tests broken by length-prefixed protocol (#3195) #3202

@AbanoubGhadban

Description

@AbanoubGhadban

Problem

Two tests in react_on_rails_pro/spec/dummy/spec/requests/incremental_rendering_integration_spec.rb are skipped:

  • sends stream values and receives them in the response
  • streams bidirectionally - each_chunk receives chunks while async_props_block is still running

These were broken by PR #3195 ("Unify incremental rendering to use length-prefixed protocol") which removed the length_prefixed: false fallback from StreamRequest, making the Ruby parser always expect length-prefixed wire format.

The test fixture bundle (packages/react-on-rails-pro-node-renderer/tests/fixtures/bundle-incremental.js) writes raw text via stream.write(value), which the parser can't parse — it expects {metadata JSON}\t{hex-length}\n{content bytes}.

Why the fix is non-trivial

The fixture bundle is shared between:

  • Ruby integration test — reads via stream.each_chunkLengthPrefixedParser → needs length-prefixed format
  • JS unit tests (incrementalRender.test.ts) — reads raw response.data → expects plain text

Fixing the fixture to write length-prefixed format breaks the JS tests. Both need to be updated together.

Branch

This issue exists on upcoming-v16.3.0, not on main.

Context

Skipped in PR #3196. See: #3196 (comment)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions