fix: refresh profile on websocket reconnect#28
Merged
Conversation
After a resize restarts the shard the websocket drops and reconnects, but the profile was never re-fetched, so the UI kept showing the old size and price. On reconnect (when previously disconnected) re-pull the profile with refresh so it reflects the new state. The first open is skipped since beforeMount already loads the profile. 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
After a subscribed resize, the controller restarts the shard to apply the new VM size. This drops the management websocket; the client reconnects (1s interval in
App.vue), but the profile is never re-fetched — so the Settings UI keeps showing the old size and price even though the backend has updated them.Fix
In the websocket
onopenhandler, when the socket was previously disconnected (a reconnect, not the first open), dispatchforce_query_profile_data(which fetches/management/profile?refresh=true, forcing shard-core to re-pull the controller self-view). The first open is skipped becausebeforeMountalready loads the profile.Pairs with the controller-side fix that promotes the price and clears the pending-resize slot on approval (FreeshardBase/freeshard-controller#292).
Note
Not built locally (Vue-CLI toolchain not installed in this worktree). The change mirrors existing call sites —
force_query_profile_data(store.js),websocket.disconnectedSincestate, and the same.catch(() => {})pattern used inSettings.vue.🤖 Generated with Claude Code