fix(app): Fix failedCommand
caching issues
#16874
Merged
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.
Closes RABR-671, RQA-3213, and RQA-3595
Overview
Fixes rendering issues resulting from state derived from the
failedCommand
, supplied fromuseCurrentlyRecoveringFrom
, a waterfall request hook.3a67269 - No "functional" changes here. Error Recovery once in a blue moon persisting past the point that is should is almost certainly a result of race conditions that occur given multiple state updates happening in sequence. Let's just confine things to
useEffects
properly and simplify the logic a bit.a0e0330 - Since it sounds like we view the error recovery splash flickering as a bug, we should gate error recovery behind insurances that the waterfall requests are completed. The normal React Query pattern for doing this is utilizing the
isFetching
status, so we need to amalgamate our requests'isFetching
statuses together and make sure we only gate the condition behind the first time we enter Error Recovery (since it's possible to continually fetch during Error Recovery if polling conditions occur).8f953a4 - This is just an optimization. We actually can avoid a couple network requests during Error Recovery to get
stepCounts
, since we already have that data.Note: I intentionally did not gate the "At step: ..." copy updating from preventing Error Recovery to render, since this is a command scanning operation, and it could take a while. If we want prevent this updating after the splash screen renders, we should tackle this server side IMO.
Test Plan and Hands on Testing
Changelog
Risk assessment
low - We're well covered by existing tests, and the new
isFetching
logic is pretty innocuous.