-
Notifications
You must be signed in to change notification settings - Fork 411
Fixing race condition #6551
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?
Fixing race condition #6551
Conversation
🎭 Playwright Test Results⏰ Completed at: 11/03/2025, 05:02:18 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.27 MB (baseline 3.27 MB) • 🟢 -15 BMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 725 kB (baseline 725 kB) • 🟢 -24 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 8.18 kB (baseline 8.18 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 293 kB (baseline 293 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 6 added / 6 removed UI Components — 12.5 kB (baseline 12.6 kB) • 🟢 -111 BReusable component library chunks
Status: 1 added / 1 removed Data & Services — 11.4 kB (baseline 10.4 kB) • 🔴 +1 kBStores, services, APIs, and repositories
Status: 1 added / 1 removed Utilities & Hooks — 1.07 kB (baseline 1.07 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 5.32 MB (baseline 5.32 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 2.55 MB (baseline 2.55 MB) • ⚪ 0 BBundles that do not match a named category
|

Summary
Original PR and discussion: Comfy-Org/litegraph.js#1082
Original Example HTML to visually describe the issue: https://github.com/Comfy-Org/litegraph.js/blob/8e5c4452cd67ccd91146ba79514bb001c470900a/public/mousemoving_example_with_blur.html
The ordering of mouseup and mousemove events is not defined. So there may be a mouseup event before the next mousemove event where buttons=0, but there may also be a mouseup immediately after.
The original code was designed to handle the case where a user click and drags, then tabs out. It turns out, you still get mousemove events in that case, so we can reset the CanvasPointer the moment it happens, as opposed to attempting to detect if it did happen in the past. The original code was designed under the assumption that if there was no mouseup, and then there was a mousemove with buttons=0, then we must have lost the focus at some point. Unfortunately, on some computers (notably my Macbook M2) this has the side effect of making it so that if your mouse pointer was even slightly moving when releasing the mouse button, it would reset and not connect the graph nodes. Extremely frustrating.
Changes
Review Focus
To replicate this, use a high pixel density display and a sensitive mouse device, such as a Retina Display and a macbook touchpad. This also happens in low resolution displays with less sensitive mouse devices, but the race condition is much harder to create, because you need to move at least 1 pixel during the release of the mouse button. If you want to replicate the bug, and you're on a non-Retina display or you have a basic USB mouse, you'll need to move your mouse rather vigorously. If you're on a macbook M2, just use the computer normally.
┆Issue is synchronized with this Notion page by Unito