Fix tiny UI race after add SSH key in instance create form#3177
Merged
david-crespo merged 2 commits intomainfrom Apr 10, 2026
Merged
Fix tiny UI race after add SSH key in instance create form#3177david-crespo merged 2 commits intomainfrom
david-crespo merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Apr 10, 2026
oxidecomputer/console@b6c8d10...1cc2ce6 * [1cc2ce61](oxidecomputer/console@1cc2ce61) oxidecomputer/console#3177 * [0df8ff04](oxidecomputer/console@0df8ff04) oxidecomputer/console#3176 * [aec681b4](oxidecomputer/console@aec681b4) oxidecomputer/console#3173 * [0fe17297](oxidecomputer/console@0fe17297) oxidecomputer/console#3168
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Apr 10, 2026
oxidecomputer/console@b6c8d10...1cc2ce6 * [1cc2ce61](oxidecomputer/console@1cc2ce61) oxidecomputer/console#3177 * [0df8ff04](oxidecomputer/console@0df8ff04) oxidecomputer/console#3176 * [aec681b4](oxidecomputer/console@aec681b4) oxidecomputer/console#3173 * [0fe17297](oxidecomputer/console@0fe17297) oxidecomputer/console#3168
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.
It's barely worth fixing, but codex flagged it in #3173 and it's real. Watch the
select allcheckbox below when I submit the create SSH key form. In the very short interval of time after the key is created and but before list of keys refetches, the select all checkbox flashes checked (all are selected) before flipping back to intermediate when the list comes in. It's trivial and it's not worth keeping the e2e test I used to prove and fix it (removed in 966aac1), but it is worth fixing now that I know about.2026-04-10-ssh-key-race.mp4
The checkbox showing the wrong thing is not actually the entire bug — if the user toggles select all during this interval, the behavior is slightly weird because the list of keys is out of sync, but it's nearly impossible for a human user to move fast enough to run into the issue, and the state after the request comes back will be up to date. The real fix would be to make
onSuccesswait until after the invalidate is complete. But we don't have any other examples ofasync onSuccess, so I don't want to rush that fix in.const handleDismiss = onDismiss ? onDismiss : () => navigate(pb.sshKeys()) const createSshKey = useApiMutation(api.currentUserSshKeyCreate, { - onSuccess(sshKey) { - queryClient.invalidateEndpoint('currentUserSshKeyList') + async onSuccess(sshKey) { + await queryClient.invalidateEndpoint('currentUserSshKeyList') onSuccess?.(sshKey) handleDismiss() // prettier-ignore