-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: AST rewriting when inline script is very long #8048
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@@ -58,7 +58,7 @@ parentPort!.on('message', (req: RewriteRequest) => { | |||
} | |||
|
|||
try { | |||
const output = _getOutput() | |||
const output = await _getOutput() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@panzarino i thought this wasn't working like we expected, did you figure it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was working, turns out the issue I was seeing was from somewhere else and it was completely unrelated. I also tested the async functions specifically and it was working fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. i'm still confused as to why/when the chunk splitting happens tho.
@flotwig it's split by the |
@panzarino That doesn't explain why this only happens after a certain body size, since the other test cases emit as one chunk. |
@flotwig Wasn't aware of that, not sure why its not working like that this time then. Should I be concerned with the failing server performance test? |
I think that's flake. |
User facing changelog
Fixes an issue where AST rewriting would return an output before the body was done being written. This would happen when the response body was too large and the response would be sent while the body was still being modified.
Additional details
This following test case would fail with the previous implementation, but now passes: https://github.com/cypress-io/cypress/pull/8048/files#diff-2aeeae49664314a9a544ffdea59ec137R55.
From the issue, here's an example of a body getting cut off:
Here's what the response looks like now:
Note: Thanks to Murphy's law, the test case from this issue still does not pass (due to something unrelated).
PR Tasks