Skip to content

fix(user): fix optimistic UI desync on profile appreciation - #368

Merged
trtajim merged 1 commit into
mainfrom
fix/profile-appreciate-optimistic-ui
Sep 25, 2026
Merged

trtajim merged 1 commit into
mainfrom
fix/profile-appreciate-optimistic-ui

Conversation

@trtajim

@trtajim trtajim commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes an issue where clicking appreciate on a user's profile (/u/{username}) caused inverted / desynchronized state between the frontend and database.

Cause

Commit 93d1b60 added only: ['auth', 'flash'] to the router.post call in handleAppreciate. This prevented Inertia from updating profile page props (isAppreciated, appreciationsCount, appreciators, and isLocked) upon server response.

Changes

  • Removed the only: ['auth', 'flash'] partial reload restriction from resources/js/pages/User/Show.vue so page props stay synchronized on toggle.

Summary by CodeRabbit

  • Bug Fixes
    • Appreciation requests now preserve page state for unlocked profiles. For locked profiles, the response does not preserve component state.
    • If an appreciation request fails, the displayed appreciation state and count are restored.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: hscstack/platform/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 55f91312-0944-4ed3-a140-8ee8cfcfb3e0

📥 Commits

Reviewing files that changed from the base of the PR and between e57da20 and 3bd278f.

📒 Files selected for processing (1)
  • resources/js/pages/User/Show.vue
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@trtajim
trtajim merged commit df1e246 into main Sep 25, 2026
5 of 6 checks passed
@trtajim
trtajim deleted the fix/profile-appreciate-optimistic-ui branch September 25, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant