fix: stabilize user-profile save and hydration flow#319
Open
Rustix69 wants to merge 4 commits intoshopstr-eng:mainfrom
Open
fix: stabilize user-profile save and hydration flow#319Rustix69 wants to merge 4 commits intoshopstr-eng:mainfrom
Rustix69 wants to merge 4 commits intoshopstr-eng:mainfrom
Conversation
Await relay reconnection before nostr publish/subscribe to prevent CLOSED/CLOSING websocket errors during profile saves. Improve user-profile loading by relying on profile context hydration and prefetching the signed-in user profile earlier in app initialization to avoid blank form states.
|
@Rustix69 is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
Author
Screencast.from.2026-04-04.04-38-10.webm |
Await relay reconnects before publish/subscribe and guard fetch EOSE handling so sub.close is never called before subscription initialization. Improve user-profile hydration by using context-driven loading and early current-user profile prefetch to avoid blank fields and delayed updates.
Contributor
|
Thank you! Already covered in #294 Also, please refrain from changing the |
…x/user-profile-save-websocket-hydration
Contributor
|
LGTM |
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
NostrManagerby awaiting relay reconnects beforepublish/subscribe./settings/user-profileby tying loading UI toProfileMapContexthydration state instead of a premature local loading flag.pages/_app.tsx) so profile data is available sooner.Problem
Editing and saving profile details on
/settings/user-profilecould trigger:WebSocket is already in CLOSING or CLOSED stateerrors during publish.Root cause
Changes
utils/nostr/nostr-manager.tskeepAliveasync.subscribeandpublish.pages/settings/user-profile.tsxpages/_app.tsxTest plan
npm test -- --runInBand utils/nostr/__tests__/nostr-manager.test.ts/settings/user-profileand verify fields do not render blank before hydration./settings/user-profileand verify saved values appear promptly.