Skip to content

fix: resolve raw UUID in feed events for new reviews and NextAuth rou…#60

Open
MayurKharat0390 wants to merge 3 commits into
AditthyaSS:mainfrom
MayurKharat0390:fix/live-feed-uuid
Open

fix: resolve raw UUID in feed events for new reviews and NextAuth rou…#60
MayurKharat0390 wants to merge 3 commits into
AditthyaSS:mainfrom
MayurKharat0390:fix/live-feed-uuid

Conversation

@MayurKharat0390
Copy link
Copy Markdown

Description

This Pull Request addresses two major backend and compilation bugs in the application:

  1. Live Feed UUID Bug (Dynamic Entity Names in Reviews):

    • The Problem: When a user posted a new review, the backend API handler (src/app/api/reviews/route.ts) created a feedEvent with the raw entityId UUID string as the entityName (under the assumption that client-side enrichment would handle it). However, the client-side rendering components (FeedTicker and FeedPage) render event.entityName directly, displaying unreadable UUIDs in the activity feed (e.g., 8fa3-4bc9... reviewed by @username).
    • The Solution: Queried the Model or Tool from the database prior to creating the feedEvent to retrieve the actual human-readable name, ensuring correct rendering (e.g., v0 reviewed by @username).
  2. Next.js App Router NextAuth Compilation Failure:

    • The Problem: Next.js App Router route handlers (route.ts) only allow standard HTTP method exports (GET, POST, etc.). Exporting authOptions directly from src/app/api/auth/[...nextauth]/route.ts triggered a compilation failure during production builds.
    • The Solution: Removed the export keyword from authOptions since it is only referenced internally in that file, resolving the build error.

Verification & Build Results

  • Successfully executed npm run build.
  • Project compiled with zero TypeScript or route compilation errors.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

@MayurKharat0390 is attempting to deploy a commit to the aditthyass' projects Team on Vercel.

A member of the Team first needs to authorize it.

@AditthyaSS
Copy link
Copy Markdown
Owner

Hey @MayurKharat0390 , thank you for the contribution 🚀

I noticed that there are merge conflicts in this PR ⚠️

Please sync your branch with the latest main branch, resolve the conflicts, and push the updated changes. Once the conflicts are resolved, I will continue with the review process 😊

Let me know if you need any assistance while resolving them. Thanks again for the contribution ⭐

@MayurKharat0390
Copy link
Copy Markdown
Author

Hey @AditthyaSS,

I have synced this branch with the latest main branch and resolved the merge conflicts in src/app/api/reviews/route.ts by merging the logic:

  1. We keep the newly introduced double-submission check to only emit events for new reviews.
  2. We resolve the entity name by querying the database, ensuring we emit the human-readable Model/Tool name to the activity feed instead of a raw UUID.

Also, I have included the missing @@unique([userId, entityType, entityId]) database constraint on the Review model in prisma/schema.prisma (introduced by PR #48) to fully fix the compilation type errors.

Everything compiles successfully and is ready for your review! 🚀

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.

2 participants