Skip to content

Fixing the intermixing of user and shop profiles and ensuring persistance of user-profile data#322

Merged
calvadev merged 1 commit intoshopstr-eng:mainfrom
Abhishek-Punhani:Issue284
Apr 6, 2026
Merged

Fixing the intermixing of user and shop profiles and ensuring persistance of user-profile data#322
calvadev merged 1 commit intoshopstr-eng:mainfrom
Abhishek-Punhani:Issue284

Conversation

@Abhishek-Punhani
Copy link
Copy Markdown
Contributor

Fixing the intermixing of user and shop profiles and ensuring persistance of user-profile data

Description

When users saved their profile, the display name and about section would mysteriously change to their shop profile data. Additionally, repeated passphrase prompts (2-3 times) occurred on save, and profile data would vanish on page refresh.
Fixed this implementing kind filtering and ensuring saving to db for faster access and ultimately showing relay data.

Resolved or fixed issue

#284

Affirmation

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

@Abhishek-Punhani is attempting to deploy a commit to the shopstr-eng Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@arnavkirti arnavkirti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix, this makes the profile data flow much clearer.

A few minor suggestions (non-blocking):

  • In ProfileWithDropdown, the .catch(() => {}) silently swallows errors.
    Suggestion: at least console.error or integrate with existing toast/error reporting so failures to load profile don’t fail silently.
  • You already use data?.profile?.content, which is good, but the subsequent logic assumes content shape is valid.
    Suggestion: guard content.name and content.picture with defaults (e.g., fallback avatar) so unusual data doesn’t break the dropdown.
  • The new useEffect depends on [pubkey, npub] but only really needs pubkey for the fetch; npub is only used in the setter.
    Suggestion: either remove npub from the dependency array or ensure it is stable to avoid redundant fetches.
  • If the project uses TypeScript types for profile content, it would be good to type the data returned from /api/db/fetch-profile and the content in fetch-service.ts to avoid magic property access.
  • Similarly, consider documenting the expected response shape of fetch-profile (e.g., { profile: { content: { name, picture, about, ... }}}) in the handler file.

@GautamBytes
Copy link
Copy Markdown
Contributor

LGTM Now!

…ence and initial data fetching from db

Signed-off-by: Abhishek-Punhani <punhani.manavabhi@gmail.com>
@Abhishek-Punhani
Copy link
Copy Markdown
Contributor Author

@calvadev I have rebased my branch, it can be merged now

@calvadev calvadev merged commit 8fd3f6c into shopstr-eng:main Apr 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants