fix(web): guard request-status-card against undefined deployRequest#735
Open
benhegartysefe wants to merge 1 commit into
Open
fix(web): guard request-status-card against undefined deployRequest#735benhegartysefe wants to merge 1 commit into
benhegartysefe wants to merge 1 commit into
Conversation
The monitor-result page flips `loading` to false as soon as any of its three parallel subscriptions completes; the result-statuses and attempts calls routinely finish before the request call, so request-status-card renders while `deployRequest` is still undefined. Line 158 read `deployRequest.Log` without optional chaining and threw "can't access property Log, this.deployRequest is undefined", aborting the render. The request-controls bindings had the same unguarded pattern and would have thrown next. Add optional chaining to all deployRequest accesses in the render path, matching the rest of the file. Card now renders harmlessly until data loads. Typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The Monitor result page throws a console error on load:
Root cause — a render race
page-monitor-result.tskicks off three parallel subscriptions (request status, result statuses, attempts) and flipsloadingtofalsein each subscription'scompletecallback. The result-statuses and attempts calls routinely finish before the request call — visible in the console ordering (done loading result Statuses/done loading attemptsarrive beforedone loading request). So<request-status-card>renders whiledeployRequestis stillundefined.request-status-card.tsthen readthis.deployRequest.Log(line 158) without optional chaining — the one access in the file that didn't use?.— and threw, aborting the render. The<request-controls>bindings (lines 308–321) had the same unguarded pattern and would have thrown next once line 158 was fixed.Fix
Add optional chaining to every
deployRequestaccess in the render path, matching the convention already used throughout the rest of the file. The card now renders harmlessly until the request data arrives and the component self-heals on the next update.npx tsc --noEmitis clean.Scope
request-status-card.tsonly — diff-local, no behavioural change once data is loaded.🤖 Generated with Claude Code