fix(protocol-dashboard): remove '1.0.0' validator-version fallback so fetch actually runs#14356
Merged
Merged
Conversation
…ersion race-safe The getCurrentVersion selector returned '1.0.0' when the validator's currentVersion wasn't loaded yet. Because useCurrentVersion only dispatches fetchCurrentVersion when the selected value is undefined, the fallback string short-circuited the dispatch and the real version was never fetched. Also harden the setCurrentVersion reducer to initialize the validator slot if it doesn't exist yet, since fetchCurrentVersion may resolve before fetchServiceStakeValues populates services.validator. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
…rageCommitment The version pill's loading spinner was keyed off storageCommitment == null, which usually resolves first (single HTTP call vs two RPC calls for currentVersion). When storage loaded first, the pill swapped from spinner to an empty <Text> while currentVersion was still undefined, then the version text flashed in once the contract calls resolved. Gate the pill on currentVersion's own loading state so it stays as a spinner until the value is actually available. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nfo runs
setServiceTypeInfo overwrites state.services.validator wholesale with
the {isValid, minStake, maxStake} payload from getServiceTypeInfo. If
fetchCurrentVersion resolves first (it has fewer RPC calls), the
already-stored currentVersion gets wiped, the selector returns
undefined, useCurrentVersion re-dispatches, and the user sees a double
load: spinner -> 1.1.0 -> spinner -> 1.1.0.
Merge over the existing currentVersion when applying new service info
so the version stays put once it's been fetched.
Co-Authored-By: Claude Opus 4.7 <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.
Summary
Follow-up to #14355. The dashboard was still showing
1.0.0for the Validator current version after that PR shipped. Root cause: thegetCurrentVersionselector returned'1.0.0'as a fallback whenservices.validator.currentVersionwas undefined, anduseCurrentVersiononly dispatchesfetchCurrentVersionwhen the selected value isundefined. The hardcoded fallback short-circuited the dispatch, so the newgetNumberOfVersions+getVersionlogic introduced in #14355 never ran.?? '1.0.0'fallback from the selector so the fetch dispatches.setCurrentVersionreducer to initializestate.services.validatorif it doesn't exist yet, sincefetchCurrentVersioncan resolve beforefetchServiceStakeValuespopulates it.Test plan
Register a Node→Current Versionshows the latest onchain version (currently1.1.0) instead of1.0.0.setCurrentVersionrunning before service info loads.🤖 Generated with Claude Code