fix: stop frontend polling when backend simulation has failed#448
Open
tt-a1i wants to merge 1 commit into666ghj:mainfrom
Open
fix: stop frontend polling when backend simulation has failed#448tt-a1i wants to merge 1 commit into666ghj:mainfrom
tt-a1i wants to merge 1 commit into666ghj:mainfrom
Conversation
…#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
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.
Summary
Fixes #444 — frontend keeps polling
/config/realtimeand/run-statusforever when the backend has already failed, causing an infinite loading state.Root cause: The frontend polling logic only checked for
completed/stoppedstates but never checked forfailed, so when the backend simulation failed, the frontend kept polling indefinitely.Changes:
Step3Simulation.vue): Detectrunner_status === 'failed'infetchRunStatus(), stop polling and display errorsimulation.py):/config/realtimeendpoint now detectsstatus == "failed"instate.jsonand returnsfailedflag +errormessage in responseStep2EnvSetup.vue): Detectfailedstate infetchConfigRealtime()response, stop polling and display errorAI Assistance Disclosure
I used Codex to review the changes, sanity-check the implementation against existing patterns, and help spot potential edge cases.