Skip to content

small bug with uuid#93

Merged
LuckyIntegral merged 6 commits intodevfrom
mzolfagh/uuidMissing
Mar 11, 2026
Merged

small bug with uuid#93
LuckyIntegral merged 6 commits intodevfrom
mzolfagh/uuidMissing

Conversation

@zolfagharipour
Copy link
Copy Markdown
Owner

@zolfagharipour zolfagharipour commented Mar 11, 2026

closes #87

Profile

  • Show "You liked them" and "No connection yet" when missing
  • Invalidate matches cache on block/unblock

Block flow (server)

  • Wrap block in transaction (insert block, delete likes both ways, delete match, update user_stats)
  • Delete likes in both directions on block so users can like again after unblock
  • Emit block notification only after DB commit
  • Rollback on error

Chat

  • Replace matches refetchInterval with staleTime + refetchOnWindowFocus: false
  • Clear selected match when it disappears from list (e.g. after block)

Real-time

  • Invalidate matches on match/block/unlike events
  • Invalidate userProfile on block/unlike
  • Invalidate notifications on any notification

Schema

  • matchId param: number → UUID

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the chat/notification flow to use UUID-based match IDs and reduce client-side polling by relying on real-time notifications to refresh relevant cached data.

Changes:

  • Updated the real-times messages route params schema to accept UUID match IDs.
  • Added server-side “block” notifications and expanded block behavior to remove likes (and adjust stats).
  • Removed 5s polling for matches in chat and replaced it with React Query invalidation driven by socket notifications (plus manual invalidation on block/unblock actions).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
shared/schemas/realTimesSchema.ts Switches matchId params validation from numeric IDs to UUID schema.
server/src/routes/socials/blocks.ts Emits block notifications and performs additional cleanup (likes/stats) during block.
client/src/contexts/SocketContext.tsx Invalidates React Query caches based on incoming notification payloads (match/block/unlike).
client/src/app/app/profile/[id]/page.tsx Invalidates matches list after block/unblock so UI updates immediately.
client/src/app/app/chat/page.tsx Removes periodic polling and adds logic to clear an invalid selected match when it disappears.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread server/src/routes/socials/blocks.ts Outdated
Comment thread server/src/routes/socials/blocks.ts
Comment thread server/src/routes/socials/blocks.ts Outdated
Comment thread server/src/routes/socials/blocks.ts Outdated
Comment thread server/src/routes/socials/blocks.ts Outdated
@LuckyIntegral LuckyIntegral merged commit 72aa625 into dev Mar 11, 2026
2 checks passed
@LuckyIntegral LuckyIntegral deleted the mzolfagh/uuidMissing branch March 11, 2026 19:29
LuckyIntegral added a commit that referenced this pull request Apr 2, 2026
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.

weird behavior in chat

3 participants