Conversation
Non-blocking _add_client with a loading placeholder page (clicks never dropped), parallel _init_clients, removal of per-connect O(N) work, and telescope/camera _init fast-follows.
- currentWidget() is placeholder check ran after removeWidget(placeholder), so it could never be true; capture was_current before removal instead - discard_all_widgets() (used by GUI._logout()) now cancels/drains _pending_opens before discarding widgets, closing the same stray-callback-after-teardown risk it was written to prevent - spell out _client_disconnected's cancel step and note cancel() isn't synchronous - note ShellWidget's untracked register_event() leak as an out-of-scope follow-up Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LzZDYUczxvz7hTFggdH7DE
Per CLAUDE.md's cross-repo docs convention: a Repos:-tagged pyobs-core plan that touches pyobs-gui should be referenced here too.
…141) * feat: make module widgets appear and respond immediately at startup Widgets now register a clickable 'Loading…' placeholder page the moment a module connects, and their heavy open() chain runs in the background; the real widget is swapped in when it finishes (and if the page was current, shown immediately). Clicks and shortcuts are never dropped during open(), a failed open() tears the client down instead of leaving a permanent dead page, and mid-open disconnects cancel-and-await the open before discarding. Startup is parallelized (asyncio.gather in _init_clients) and the per-connect O(N^2) Shell command-model rebuild / all-clients warning scans are dropped; the Shell rebuilds its own model debounced and only while its page is visible. BaseWidget._showEvent memoizes _init() so rapid show/hide cycles can't double-subscribe, retrying after failure. Telescope/camera _init() fire their subscriptions/fetches concurrently, and camera wait_for_state uses a 2 s timeout instead of the 10 s default. * fix: prevent duplicate/leaked comm subscriptions in widget init retry _init() sub-steps that call comm.subscribe_state() could run twice on retry after a partial gather() failure, since subscribe_state() is not idempotent. Add BaseWidget._init_once() to memoize each sub-step across retries, and use it in CameraWidget/TelescopeWidget. Also cancel a still-in-flight _init_task in discard(), so a widget torn down mid-init can't leak a subscription registered after comm's own disconnect cleanup already ran. Factor the cancel+drain idiom used here and in mainwindow.py into a shared cancel_and_drain() helper.
Needed for HttpFile.headers, added in pyobs-core#799, which #142's VideoWidget Authorization-header forwarding depends on.
…am (#142) Once BaseVideo (pyobs-core PR #799) enforces a shared token, the live view dies with a 401 that the MJPEG parser never surfaces. The widget already opens the video URL as an HttpFile; keep its Authorization header and append it to the raw-socket GET in _showEvent. Without a token the written bytes are unchanged. Companion to pyobs-core feat/basevideo-http-token-auth — land together. Implements specs/plans/2026-08-21-basevideo-http-token-auth.md (pyobs-gui half).
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.
version 2.0.0.dev20