fix(ui): load debug data and artifacts for failed runs too - #148
Open
arminfauland wants to merge 1 commit into
Open
fix(ui): load debug data and artifacts for failed runs too#148arminfauland wants to merge 1 commit into
arminfauland wants to merge 1 commit into
Conversation
`handleScrapeEnd()` only fetched debug data and artifacts when the run
finished successfully:
if (status === 'success' && event.scrapeId) {
this.loadRunData(event.runId, event.scrapeId);
}
So a failed run never got them — exactly the case where you want to look
at them. Anyone debugging a failure had to reload the page or query the
API directly.
Dropping the `status === 'success'` guard is enough; `loadRunData()`
already handles its own errors and logs a warning if the endpoints do not
answer, so a failed run that has no artifacts yet is harmless.
Adds runs.store.spec.ts covering handleScrapeEnd: success and failure
paths, the regression itself, and the two guard clauses (missing runId,
missing scrapeId).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LixHBPkhb8h5oDdMqSG4se
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.
The problem
RunsStore.handleScrapeEnd()only fetches debug data and artifacts when a run finished successfully:A failed run therefore never gets them — which is exactly the case where you want to look at them. Debugging a failure currently means reloading the page or querying the API by hand.
The change
Drop the
status === 'success'guard. That is the whole fix.loadRunData()already handles its own errors and logs a warning if the endpoints do not answer, so a failed run that has no artifacts yet is harmless — it simply logs and moves on.Tests
Adds
runs.store.spec.ts, which did not exist. Six cases aroundhandleScrapeEnd:successfailed, keeps the error textscrapeIdrunId, leaving the run untouchedFull UI suite: 182 tests / 25 files, all passing.
nx lint uiclean.Context
Found while investigating #147 (run details staying empty during a run). That one is a separate, larger question and is deliberately not part of this PR — this is the small, independent piece that stands on its own.