Skip to content

v2.0.0.dev20 - #144

Merged
thusser merged 9 commits into
mainfrom
develop
Aug 23, 2026
Merged

v2.0.0.dev20#144
thusser merged 9 commits into
mainfrom
develop

Conversation

@thusser

@thusser thusser commented Aug 23, 2026

Copy link
Copy Markdown
Member

version 2.0.0.dev20

thusser and others added 9 commits August 21, 2026 20:00
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).
@thusser
thusser merged commit 3ea6870 into main Aug 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant