Fix script page changes not propagating to other connected clients - #1151
Merged
Conversation
…ate in real-time
When one client saved script changes, other connected clients did not see
the updates without a manual refresh. The backend was missing a WebSocket
broadcast after the save commit in both the POST and PATCH handlers.
Adds ws_send_to_all("NOOP", "SCRIPT_PAGE_CHANGED", {"page": page}) to
both handlers, and adds matching action handlers in the Vue 2 Vuex store
(SCRIPT_PAGE_CHANGED) and Vue 3 Pinia store (scriptPageChanged) that
reload the changed page into both the script store and tmpScript (the
data source the editor template renders from) when the page is loaded.
Fixes #1149.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Addresses SonarCloud warnings on PR #1151. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
SCRIPT_PAGE_CHANGEDWebSocket message to all connected clientsSCRIPT_PAGE_CHANGEDVuex action that reloads both the script store andtmpScriptfor the changed pagescriptPageChangedPinia action (auto-routed by the WS convention-based dispatcher) that does the sameRoot Cause
The
post()andpatch()handlers inserver/controllers/api/show/script/script.pycommitted changes to the DB but sent no WebSocket notification to other clients. The only post-save broadcast wasGET_COMPILED_SCRIPTS(fired asynchronously after script compilation), which neither client had a handler for that refreshes editable page state.Test plan
/ui/cd server && pytestcd client-v3 && npm run test:runcd client && npm run test:runFixes #1149.
🤖 Generated with Claude Code