-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: guard against infinite response event generation (fix #9379) #9381
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
base: main
Are you sure you want to change the base?
fix: guard against infinite response event generation (fix #9379) #9381
Conversation
| return | ||
| } | ||
|
|
||
| if (data.event.startsWith('response:')) { |
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 should not receive this even here at all, this doesn't fix the issue, it hides it
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.
Thanks for the review @sheremet-va - agreed this is a symptom and not the root cause.
investigating further and adding test case. will share plan
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.
I still don't know exactly how iframes of two or more tests end up communicating, potentially an iframeId collison.
I've simulated the behavior with a second broadcast channel that echos with the response: prefix unguarded. Additionally added the guard around postMessage. With the browser package from main, the test exhibits the infinite loop that crashed my computer a few times. With the guards, it passes without error.
Avoid infinite response event loop by only sending response messages for events that were successfully handled. Changes: - Add eventHandled flag to track successful event processing - Only call channel.postMessage for handled events - Add reproduction test 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Description
Resolves #9379
response:prefix events even before main switchPlease don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.