Skip to content

Fix script page changes not propagating to other connected clients - #1151

Merged
Tim020 merged 2 commits into
devfrom
feature/fix-script-page-sync-1149
Jun 6, 2026
Merged

Fix script page changes not propagating to other connected clients#1151
Tim020 merged 2 commits into
devfrom
feature/fix-script-page-sync-1149

Conversation

@Tim020

@Tim020 Tim020 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • After saving script changes, the backend now broadcasts a SCRIPT_PAGE_CHANGED WebSocket message to all connected clients
  • Vue 2 client handles this with a new SCRIPT_PAGE_CHANGED Vuex action that reloads both the script store and tmpScript for the changed page
  • Vue 3 client handles this with a new scriptPageChanged Pinia action (auto-routed by the WS convention-based dispatcher) that does the same

Root Cause

The post() and patch() handlers in server/controllers/api/show/script/script.py committed changes to the DB but sent no WebSocket notification to other clients. The only post-save broadcast was GET_COMPILED_SCRIPTS (fired asynchronously after script compilation), which neither client had a handler for that refreshes editable page state.

Test plan

  • Start the backend and Vue 3 dev server
  • Open two browser windows on Show Config → Script Editor
  • Window A enters edit mode, makes a change to a line, and saves
  • Window B should display the updated content without a manual page refresh
  • Repeat on the Vue 2 client at /ui/
  • Backend tests pass: cd server && pytest
  • Vue 3 unit tests pass: cd client-v3 && npm run test:run
  • Vue 2 unit tests pass: cd client && npm run test:run

Fixes #1149.

🤖 Generated with Claude Code

…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>
@Tim020 Tim020 added the claude Issues created by Claude label Jun 6, 2026
@github-actions github-actions Bot added small-diff Small pull request client Pull requests changing front end code server Pull requests changing back end code client-v3 labels Jun 6, 2026
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Client V3 Test Results

23 tests  ±0   23 ✅ ±0   0s ⏱️ ±0s
 2 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 3dbc914. ± Comparison against base commit 213dd10.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Client Test Results

128 tests  ±0   128 ✅ ±0   0s ⏱️ ±0s
  6 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3dbc914. ± Comparison against base commit 213dd10.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Python Test Results

  1 files  ±0    1 suites  ±0   1m 47s ⏱️ -1s
631 tests ±0  631 ✅ ±0  0 💤 ±0  0 ❌ ±0 
636 runs  ±0  636 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 3dbc914. ± Comparison against base commit 213dd10.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Playwright E2E Results (chromium)

160 tests  ±0   160 ✅ ±0   1m 32s ⏱️ -2s
 14 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3dbc914. ± Comparison against base commit 213dd10.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Playwright E2E Results (firefox)

160 tests  ±0   160 ✅ ±0   1m 37s ⏱️ ±0s
 14 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3dbc914. ± Comparison against base commit 213dd10.

♻️ This comment has been updated with latest results.

Addresses SonarCloud warnings on PR #1151.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

@Tim020
Tim020 merged commit 9d621e9 into dev Jun 6, 2026
35 checks passed
@Tim020
Tim020 deleted the feature/fix-script-page-sync-1149 branch June 6, 2026 20:40
@Tim020 Tim020 linked an issue Jun 6, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude Issues created by Claude client Pull requests changing front end code client-v3 server Pull requests changing back end code small-diff Small pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post script save updates not reflected on other connected clients

1 participant