Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update tests
This bug is now fixed.
  • Loading branch information
sebmarkbage committed Dec 19, 2024
commit 1e9061fc2b919f907c98afeacb39e998dcdf33c1
Original file line number Diff line number Diff line change
Expand Up @@ -2902,16 +2902,7 @@ describe('ReactFlightDOM', () => {
abortFizz('bam');
});

if (__DEV__) {
expect(errors).toEqual([new Error('Connection closed.')]);
} else {
// This is likely a bug. In Dev we get a connection closed error
// because the debug info creates a chunk that has a pending status
// and when the stream finishes we error if any chunks are still pending.
// In production there is no debug info so the missing chunk is never instantiated
// because nothing triggers model evaluation before the stream completes
expect(errors).toEqual(['bam']);
}
expect(errors).toEqual([new Error('Connection closed.')]);

const container = document.createElement('div');
await readInto(container, fizzReadable);
Expand Down Expand Up @@ -3066,17 +3057,8 @@ describe('ReactFlightDOM', () => {
});

// one error per boundary
if (__DEV__) {
const err = new Error('Connection closed.');
expect(errors).toEqual([err, err, err]);
} else {
// This is likely a bug. In Dev we get a connection closed error
// because the debug info creates a chunk that has a pending status
// and when the stream finishes we error if any chunks are still pending.
// In production there is no debug info so the missing chunk is never instantiated
// because nothing triggers model evaluation before the stream completes
expect(errors).toEqual(['boom', 'boom', 'boom']);
}
const err = new Error('Connection closed.');
expect(errors).toEqual([err, err, err]);

const container = document.createElement('div');
await readInto(container, fizzReadable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2574,17 +2574,7 @@ describe('ReactFlightDOMBrowser', () => {
root.render(<ClientRoot response={response} />);
});

if (__DEV__) {
expect(errors).toEqual([new Error('Connection closed.')]);
expect(container.innerHTML).toBe('');
} else {
// This is likely a bug. In Dev we get a connection closed error
// because the debug info creates a chunk that has a pending status
// and when the stream finishes we error if any chunks are still pending.
// In production there is no debug info so the missing chunk is never instantiated
// because nothing triggers model evaluation before the stream completes
expect(errors).toEqual([]);
expect(container.innerHTML).toBe('<div>loading...</div>');
}
expect(errors).toEqual([new Error('Connection closed.')]);
expect(container.innerHTML).toBe('');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -1245,16 +1245,7 @@ describe('ReactFlightDOMEdge', () => {
),
);
fizzController.abort('bam');
if (__DEV__) {
expect(errors).toEqual([new Error('Connection closed.')]);
} else {
// This is likely a bug. In Dev we get a connection closed error
// because the debug info creates a chunk that has a pending status
// and when the stream finishes we error if any chunks are still pending.
// In production there is no debug info so the missing chunk is never instantiated
// because nothing triggers model evaluation before the stream completes
expect(errors).toEqual(['bam']);
}
expect(errors).toEqual([new Error('Connection closed.')]);
// Should still match the result when parsed
const result = await readResult(ssrStream);
const div = document.createElement('div');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -508,16 +508,7 @@ describe('ReactFlightDOMNode', () => {
),
);
ssrStream.abort('bam');
if (__DEV__) {
expect(errors).toEqual([new Error('Connection closed.')]);
} else {
// This is likely a bug. In Dev we get a connection closed error
// because the debug info creates a chunk that has a pending status
// and when the stream finishes we error if any chunks are still pending.
// In production there is no debug info so the missing chunk is never instantiated
// because nothing triggers model evaluation before the stream completes
expect(errors).toEqual(['bam']);
}
expect(errors).toEqual([new Error('Connection closed.')]);
// Should still match the result when parsed
const result = await readResult(ssrStream);
const div = document.createElement('div');
Expand Down
Loading