Skip to content

[BUG]: Profile display name updates do not propagate to the Account Menu or Overview Header #103

@Gautam25Raj

Description

@Gautam25Raj

Affected Apps / Packages

Studio (apps/studio)

Description

When a user updates their name in the Profile page, the update is successfully persisted to the backend database via updateAccountName(). However, the client-side useUserStore Zustand state is never updated with the new name. Because the main layout apps/studio/app/(main)/layout.tsx is a persistent Next.js Server Component layout, it does not re-fetch the user data or re-run AuthInitializer on router.refresh(). Consequently, the Zustand state remains stale. Components subscribing to useUserStore (such as the sidebar AccountMenu and the dashboard OverviewHomeHeader) continue to display the old name until the user manually triggers a hard browser reload.

  • Branch Name: fix/studio-profile-name-sync
  • PR Title: [Fix] [Studio]: update user store display name reactively on change

Steps to Reproduce

  1. Log into the studio and go to the Profile page (/profile).
  2. Click the edit button next to your Display Name.
  3. Enter a new name and click "Save Changes".
  4. The toast message shows success, and the Profile page updates to show the new name.
  5. Look at the sidebar AccountMenu at the bottom and the dashboard Overview header. They still display your old name.
  6. Perform a hard browser refresh (F5), and only then will the correct name appear.

Expected Behavior

Updating the display name should immediately propagate to the AccountMenu, OverviewHomeHeader, and any other components subscribing to useUserStore without requiring a hard browser refresh.

Environment Information

  • App: @veriworkly/studio
  • OS: Windows / macOS / Linux
  • Browser: Chrome / Firefox / Safari / Edge
  • Node.js: 20.x

Relevant Logs

No response

Proposed Fix / Suggestions

Update EditProfileNameModal.tsx to import and call useUserStore to update the store state on success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestfrontendUI/client-side code

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions