fix(admin): invalidate controllerVersion on machineRedeploy and machineUpgrade success#1880
Open
pandemicsyn wants to merge 1 commit intomainfrom
Open
fix(admin): invalidate controllerVersion on machineRedeploy and machineUpgrade success#1880pandemicsyn wants to merge 1 commit intomainfrom
pandemicsyn wants to merge 1 commit intomainfrom
Conversation
…neUpgrade success In both restartMachine mutation onSuccess callbacks, immediately invalidate the controllerVersion query so the Gateway section does not show stale data (e.g. 'Unavailable until redeploy') after an upgrade succeeds. The gatewayStatus invalidation was already present via invalidateGatewayQueries(). The deferred re-invalidation via useEffect (polling until machine is running) is preserved alongside this immediate invalidation.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.4-20260305 · 449,029 tokens |
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
Adds an immediate
controllerVersionquery invalidation to theonSuccesscallbacks of bothmachineRedeployandmachineUpgrademutations inKiloclawInstanceDetail.tsx.Previously, the Gateway section could show stale data (e.g. "Unavailable until redeploy") for up to 5 minutes after a redeploy or upgrade succeeded because the
controllerVersionquery has a 5-minutestaleTimeand was only re-invalidated once the machine polled back torunningstate — not at mutation success time.The fix adds an immediate invalidation at
onSuccess(guarded bydata?.user_id), clearing the stale cache right away. The existing deferred re-invalidation via theuseEffectpolling loop (fires once the machine is confirmedrunning) is preserved alongside this immediate invalidation.Verification
controllerVersioninvalidation in theuseEffectrestart-completion hook (lines 1133–1140 in the file).Visual Changes
N/A
Reviewer Notes
The double-invalidation is intentional: the immediate invalidation at
onSuccesskicks out the stale cached value before the machine has restarted, and theuseEffectinvalidation fires a second time once the machine is confirmedrunningand the newcontrollerVersionis actually available. This is the correct two-phase pattern for post-restart UI updates.