Fix select options not pushing to browser and remaining shallow copies

- Use set_options() instead of direct .options assignment (3 locations)
  so dropdown changes actually reach the browser
- Wrap res.json() in try/except for non-JSON server responses
- Deep copy in create_batch and promote to match rest of codebase

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 14:22:40 +01:00
parent a0d58d8982
commit 3928f4d225
2 changed files with 17 additions and 10 deletions

View File

@@ -144,7 +144,11 @@ def _render_single_instance(state: AppState, instance_config: dict, index: int,
None, lambda: _fetch_blocking(f'{comfy_url}/queue'))
with status_container:
if res is not None:
queue_data = res.json()
try:
queue_data = res.json()
except (ValueError, Exception):
ui.label('Invalid response from server').classes('text-negative')
return
running_cnt = len(queue_data.get('queue_running', []))
pending_cnt = len(queue_data.get('queue_pending', []))
@@ -238,7 +242,11 @@ def _render_single_instance(state: AppState, instance_config: dict, index: int,
if err is not None:
ui.label(f'Error fetching image: {err}').classes('text-negative')
return
history = res.json()
try:
history = res.json()
except (ValueError, Exception):
ui.label('Invalid response from server').classes('text-negative')
return
if not history:
ui.label('No history found.').classes('text-caption')
return