Skip to content

fix: stop frontend polling when backend simulation has failed#448

Open
tt-a1i wants to merge 1 commit into666ghj:mainfrom
tt-a1i:fix/stop-polling-on-failure
Open

fix: stop frontend polling when backend simulation has failed#448
tt-a1i wants to merge 1 commit into666ghj:mainfrom
tt-a1i:fix/stop-polling-on-failure

Conversation

@tt-a1i
Copy link
Copy Markdown

@tt-a1i tt-a1i commented Apr 2, 2026

Summary

Fixes #444 — frontend keeps polling /config/realtime and /run-status forever when the backend has already failed, causing an infinite loading state.

Root cause: The frontend polling logic only checked for completed/stopped states but never checked for failed, so when the backend simulation failed, the frontend kept polling indefinitely.

Changes:

  • Step3 (Step3Simulation.vue): Detect runner_status === 'failed' in fetchRunStatus(), stop polling and display error
  • Backend (simulation.py): /config/realtime endpoint now detects status == "failed" in state.json and returns failed flag + error message in response
  • Step2 (Step2EnvSetup.vue): Detect failed state in fetchConfigRealtime() response, stop polling and display error
  • Both steps: Add consecutive error counter (max 10) to stop polling on persistent network/API errors

AI Assistance Disclosure

I used Codex to review the changes, sanity-check the implementation against existing patterns, and help spot potential edge cases.

…#444)

The frontend kept polling /config/realtime and /run-status indefinitely
even after the backend had already failed, causing an infinite loading
state for users.

- Step3: detect runner_status === 'failed' in fetchRunStatus and stop polling
- Backend /config/realtime: detect status == "failed" in state.json, return
  failed flag and error message in response
- Step2: detect failure in fetchConfigRealtime response and stop polling
- Both steps: add consecutive error counter (max 10) to stop polling on
  persistent network/API errors
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error, polling forever: "127.0.0.1 - - [02/Apr/2026 09:54:44] "GET /api/simulation/sim_ce99d27a2b27/config/realtime HTTP/1.1" 200 -"

1 participant