-
Notifications
You must be signed in to change notification settings - Fork 93
refactor(deployment): send deployment names to the api instead of localstorage #3928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stalniy
wants to merge
1
commit into
feat/deployment-show-api-name-browser
from
feat/deployment-show-api-name-browser-2
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Removing the localStorage mirror write on rename means any deployment that already has a name cached in this browser (named before this change, or by an earlier session) keeps its OLD name there forever after a rename — worse than the PR's documented 'shows no name' case, since the 5 surfaces reading only local storage (deployment list, home, alerts, billing, provider leases via
useLocalNotes.getDeploymentName) now display a stale, incorrect name instead of nothing. Fix: either have those 5 surfaces read the API-resolved name (per the plan's slice 3) before this write is removed, or invalidate/clear the local record on successful rename so it falls back to null rather than a wrong value.Extended reasoning...
User has an old deployment whose local record already has name:"old-name" (written by pre-slice-2 code). They open DeploymentNameModal, PATCH succeeds renaming it to "new-name" on the API; onSuccess (reportRenameSaved, lines 76-80) now only invalidates the getDeployment query and calls onSaved — it never touches deploymentLocalStorage. The local record's
namefield stays "old-name". DeploymentList.tsx, HomeContainer.tsx, AlertsListContainer.tsx, useAccountBalanceOverview.ts and LeaseRow.tsx all calluseLocalNotes().getDeploymentName(dseq), which reads deploymentLocalStorage directly (useLocalNotes.ts lines 25-31) with no API fallback, so they keep showing "old-name" indefinitely even though the API and the rename dialog itself (via useResolvedDeploymentName) now show "new-name". The PR's own claim 'nothing here deletes them' undersells this: the record isn't deleted, but it silently diverges from the truth after every rename, which is a worse UX than the missing-name case the PR explicitly accepts.Verification: normal — acknowledged in diff, but the note's claim does not hold for this subset. On the base branch, DeploymentNameModal's onSuccess ran recordNameInThisBrowser(name) -> deploymentLocalStorage.update(address, dseq, { name }), so renaming a deployment that already had a local record kept that record in sync; the five surfaces reading useLocalNotes.getDeploymentName (useLocalNotes.ts:27-28,…