Skip to content

[test] Add tests for cyclic arrays in Flight and Flight Reply#237

Closed
everettbu wants to merge 1 commit into
mainfrom
cyclic-array-tests
Closed

[test] Add tests for cyclic arrays in Flight and Flight Reply#237
everettbu wants to merge 1 commit into
mainfrom
cyclic-array-tests

Conversation

@everettbu

@everettbu everettbu commented Dec 13, 2025

Copy link
Copy Markdown

Mirror of facebook/react#35347
Original author: unstubbable


We already had tests for cyclic objects, but not for cyclic arrays.

We already had tests for cyclic objects, but not for cyclic arrays.
@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Dec 13, 2025
@greptile-apps

greptile-apps Bot commented Dec 13, 2025

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

This PR adds test coverage for cyclic array structures in React Flight serialization. Two new tests were added that mirror the existing cyclic object tests:

  • In ReactFlight-test.js: Tests that cyclic arrays can be transported through Flight's client-server communication
  • In ReactFlightDOMReply-test.js: Tests that cyclic arrays can be properly encoded and decoded in Flight Reply

Both tests create an array that references itself (cyclic[1] = cyclic) and verify that the cyclic reference is preserved after serialization/deserialization. The tests follow the exact same patterns as the existing cyclic object tests, ensuring consistency in test coverage.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes are straightforward test additions that follow established patterns in the codebase. The new tests mirror existing cyclic object tests, use correct assertions to verify cyclic references are preserved, and add valuable coverage for array cycles alongside the existing object cycle tests. No implementation code is modified, only tests are added.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/react-client/src/tests/ReactFlight-test.js 5/5 Added test for cyclic array transport, mirroring existing cyclic object test pattern with proper assertions for self-reference and shared object reference
packages/react-server-dom-webpack/src/tests/ReactFlightDOMReply-test.js 5/5 Added test for cyclic array encoding/decoding in Flight Reply, following the same pattern as existing cyclic object test with correct assertions

@greptile-apps greptile-apps 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.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Dec 17, 2025
@everettbu everettbu deleted the cyclic-array-tests branch December 17, 2025 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants