Repository navigation
fix(viewer): pick up settings changed while the viewer starts or reconnects - #3541
Merged
Merged
Conversation
…nnects setup() loads settings, then spends seconds starting the webview before main() subscribes to the viewer channel. A reload published in that window, or while Redis is reconnecting, was dropped by pub/sub and the viewer kept the old settings until the next change. ViewerSubscriber now runs an on_subscribed hook after every successful subscribe, and the viewer uses it to re-read settings (plus rotation and dark mode). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
There was a problem hiding this comment.
Copilot encountered an error: Your billing is not configured or you have Copilot licenses from multiple standalone organizations or enterprises. To use premium requests, select a billing entity via the GitHub site, under Settings > Copilot > Features.
|
vpetersson
approved these changes
Nov 30, 2026
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.



Issues Fixed
Settings changed right after the viewer (re)starts can be silently ignored. Found while testing touch support (internal tracker SIRI-2498).
Description
setup()loads the settings, then spends several seconds starting the webview, and only then doesmain()subscribe to the viewer channel. Redis pub/sub doesn't queue, so areloadpublished in that window is dropped, and the viewer runs on the old settings until something else triggers a reload. The same applies to anything published while the subscriber is reconnecting to Redis.The fix:
ViewerSubscribergets anon_subscribedhook, run after every successful subscribe (first start and every reconnect) and before it starts consuming. A failing hook is logged and doesn't stop the subscriber._catch_up_settings, which re-reads settings from disk and re-applies rotation and dark mode, the same as the settings part of_handle_reload.So anything saved before the subscription is live gets picked up from disk, and anything after arrives as a
reload.Testing
_catch_up_settingscalls the right pieces.pytest -m "not integration": 3374 passed.debug_loggingthrough the API right after the viewer logsLoading browser..., then count debug-level log lines 35 s later:Checklist
🤖 Generated with Claude Code