Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Nov 19, 2025

Fix setTimeout context binding issue in SupabaseBroadcastAdapter

This PR fixes a browser compatibility issue in the SupabaseBroadcastAdapter class where setTimeout was 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:

  • Properly binds setTimeout to the global context using setTimeout.bind(globalThis) in the constructor
  • Adds comprehensive tests to verify the fix works correctly

This 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.

@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: 2e8d068

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@pgflow/client Patch
@pgflow/core Patch
@pgflow/dsl Patch
@pgflow/edge-worker Patch
@pgflow/example-flows Patch
pgflow Patch

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

Copy link
Contributor Author

jumski commented Nov 19, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nx-cloud
Copy link

nx-cloud bot commented Nov 19, 2025

View your CI Pipeline Execution ↗ for commit 2e8d068

Command Status Duration Result
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 29s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 4m 18s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-19 14:34:36 UTC

@jumski jumski force-pushed the 11-19-fix_settimeout_binding_in_client branch from 441c31b to 2e8d068 Compare November 19, 2025 14:28
@github-actions
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-402.pgflow.pages.dev

📝 Details:

  • Branch: 11-19-fix_settimeout_binding_in_client
  • Commit: 175d3165fb5f98b0a57b94d8286cfb65b042809a
  • View Logs

_Last updated: _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants