-
Notifications
You must be signed in to change notification settings - Fork 15
fix: bind setTimeout to globalThis in SupabaseBroadcastAdapter for browser compatibility #402
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
Conversation
🦋 Changeset detectedLatest commit: 76d65a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
View your CI Pipeline Execution ↗ for commit 76d65a1
☁️ Nx Cloud last updated this comment at |
441c31b to
2e8d068
Compare
2e8d068 to
d391b09
Compare
d391b09 to
b7d08e1
Compare
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-402.pgflow.pages.dev 📝 Details:
_Last updated: _ |
b7d08e1 to
76d65a1
Compare

Fix setTimeout context binding issue in SupabaseBroadcastAdapter
This PR fixes a browser compatibility issue in the
SupabaseBroadcastAdapterclass wheresetTimeoutwas losing its context binding when used in browser environments. The issue would cause an error:"'setTimeout' called on an object that does not implement interface Window".The fix:
setTimeoutto the global context usingsetTimeout.bind(globalThis)in the constructorThis issue only manifested in browser environments, not in Node.js, which explains why our existing tests didn't catch it. I've added a test that simulates the browser's strict context requirements for
setTimeout.The PR also includes a planning document for implementing browser-based testing to catch similar issues in the future.