-
Notifications
You must be signed in to change notification settings - Fork 61
Fix version dropdown sync by broadcasting to all users #4045
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?
Conversation
Changed broadcast_from! to broadcast! for workflow_saved events to ensure the saving user also receives version updates. This fixes two related issues where the version dropdown would show stale information until page refresh. The sender needs to receive the broadcast to: - Update their SessionContextStore.latestSnapshotLockVersion - Clear their VersionDropdown cache to fetch fresh version list Fixes #3985, #4024
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4045 +/- ##
=======================================
Coverage 88.84% 88.84%
=======================================
Files 422 422
Lines 19118 19118
=======================================
Hits 16985 16985
Misses 2133 2133 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds test verifying that workflow_saved broadcasts reach all users including the sender when saving workflows. This ensures all connected users can update their SessionContextStore and clear cached version lists. The test creates two editors in the same workflow channel, has one user save the workflow, and asserts that the broadcast is received by all participants. Addresses test coverage for broadcast! usage in workflow_channel.ex. Related to #3985 and #4024.
|
Pasting @stuartc's message from Slack:
I agree - I think this should be investigated further. We should hold off on merging this change for now. |
|
Will continue looking into this on Monday. I made some progress locally on potentially handling this better in the frontend. But I found some other bugs that are also on main 🫠 Example:
|
Description
There were a number of issues to do with the version number in the header in collaborative editor when a new version is saved:
Aswell as other strange bugs between multiple user sessions when one user saves:

This PR should hopefully fix all of these issues!
Changed
broadcast_from!tobroadcast!forworkflow_savedevents to ensure the saving user also receives version updates. This fixes two related issues where the version dropdown would show stale information until page refresh.The sender needs to receive the broadcast to:
SessionContextStore.latestSnapshotLockVersionVersionDropdowncache to fetch fresh version listCloses #3985 and #4024
Validation steps
One user:
Two users
Additional notes for the reviewer
There were some weird bugs where sometimes users would get stuck on latest. You should play around on this branch and try to break it outside of the steps mentioned above.
AI Usage
Please disclose how you've used AI in this work (it's cool, we just want to know!):
You can read more details in our Responsible AI Policy
Pre-submission checklist
:owner,:admin,:editor,:viewer)