Skip to content

fix: prevent cloud connection inputMode reset and drop async from input source routes#460

Merged
yondonfu merged 2 commits intomainfrom
mh/fix-input-mode-reset
Feb 13, 2026
Merged

fix: prevent cloud connection inputMode reset and drop async from input source routes#460
yondonfu merged 2 commits intomainfrom
mh/fix-input-mode-reset

Conversation

@yondonfu
Copy link
Copy Markdown
Contributor

@yondonfu yondonfu commented Feb 13, 2026

Summary

  • inputMode reset fix: When cloud connects, refreshPipelineSchemas() creates a new pipelineSchemas object reference. An effect in useStreamState.ts watched this dependency and unconditionally reset inputMode to the pipeline's default, overwriting the user's selection (e.g. "video" snapped back to "text"). Added a useRef to track the previous pipelineId so the effect only resets inputMode when the pipeline actually changes.
  • Drop async from input source routes: The NDI input source API routes (list_input_sources, get_input_source_resolution, get_input_source_preview) were declared async but perform blocking I/O. Removing async lets FastAPI run them in a threadpool, preventing them from blocking the event loop.

Test plan

  • Enable remote inference (pending state), switch to Video mode, wait for cloud connection to establish — mode should remain "video"
  • Switch pipelines — inputMode should still reset to the new pipeline's default
  • Fresh page load — inputMode should initialize to the pipeline's default
  • NDI input source discovery, resolution probe, and preview all work correctly

🤖 Generated with Claude Code

yondonfu and others added 2 commits February 13, 2026 11:00
When cloud connects, refreshPipelineSchemas() creates a new pipelineSchemas
object reference. The inputMode effect watched this dependency and
unconditionally reset inputMode to the pipeline default, overwriting the
user's selection (e.g. "video" snapped back to "text").

Use a ref to track the previous pipelineId so the effect only resets
inputMode when the pipeline actually changes, not on every schema refresh.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Yondon Fu <[email protected]>
@yondonfu yondonfu changed the title fix: prevent cloud connection from resetting inputMode fix: prevent cloud connection inputMode reset and drop async from input source routes Feb 13, 2026
@yondonfu yondonfu merged commit 6a19e3c into main Feb 13, 2026
6 checks passed
@yondonfu yondonfu deleted the mh/fix-input-mode-reset branch February 13, 2026 16:06
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