-
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: do not treat utf8 requests as binary #15946
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
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 |
Hmm, the integration test does not fail even for previous settings, really want to see a failing test first |
The e2e test fails without the fix, passes with the fix |
Internal Jira issue: TR-749 |
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.
Co-authored-by: Zach Bloomquist <[email protected]>
Is there as known workarround? |
|
* develop: (49 commits) fix: `cy.type()` should not change the value attr of button-like inputs. (#16154) fix: properly detect `cy.intercept(url, routeMatcher, handler)` overload (#16167) fix: consider multiple routes when looking for aliases (#16180) fix: pass contextIsolation: true (#16165) chore: fix failing "should handle aborted requests" test (#16170) feat(issue-3741): added keyboard support for folder (#15648) fix(webpack-dev-server): remove hard dependency on html-webpack-plugin v4 (#16108) chore(deps): downgrade electron to v12.0.0-beta.14 (#16113) fix: accept absolute paths in vite dev server (#16148) fix: cy.then shows wrong type when collection of HTMLElement's is provided (#15869) fix: do not treat utf8 requests as binary (#15946) chore: fix types docs: fix broken links for @cypress/react example recipes (#15674) update circle yml ignore undefined beforeEach fix: make vite-dev-server work on windows (#16103) chore: add triple slash reference chore: remove conflicting types chore: rebuild yarn lock resolve conflicts in master(fe0b63c) and develop ...
cy.intercept('POST', 'http://localhost:5000/api/sample') | ||
cy.visit('/fixtures/utf8-post.html') |
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.
Since the fetch(...)
is async you need to cy.wait(...)
for the intercept to finish otherwise there's a race condition where the test could finish before the fetch()
does and lead to a false negative.
User facing changelog
We were incorrectly detecting "normal" utf8 request body as binary encoding, which caused the test runner crash. The detection was caused by multi-byte Unicode characters in some languages.
Additional details
PS: there is an open issue for the existing module we use to detect the encoding bevry/istextorbinary#13 which exactly matches our issue.
How has the user experience changed?
No more crashing in the provided reproducible example
PR Tasks