Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds bin-ownership middleware for chat routes, migrates runtime endpoints from port 5000 to 8000, tightens repository return shapes with explicit column selections and ISO timestamps, removes public userId fields from API models, extends session duration, updates LLM model, and introduces document library/viewer UI and related store state. Changes
Sequence DiagramsequenceDiagram
participant Client as Client
participant MW as requireBinOwnership
participant Session as Session/Auth
participant ChatsRepo as Chats Repo
participant BinsRepo as Bins Repo
participant Handler as Chat Route Handler
Client->>MW: Request (includes chatId or binId)
MW->>Session: extract session / userId
alt no session
Session-->>MW: undefined
MW-->>Client: 401 Unauthorized
else session found
Session-->>MW: userId
alt binId provided
MW->>BinsRepo: findByIdAndUserId(binId, userId)
alt bin found & owned
BinsRepo-->>MW: bin
MW->>Handler: next()
Handler-->>Client: route handler runs
else not found / not owned
BinsRepo-->>MW: null
MW-->>Client: 404 Not Found
end
else chatId provided
MW->>ChatsRepo: findChatById(chatId)
alt chat found
ChatsRepo-->>MW: chat (includes binId)
MW->>BinsRepo: findByIdAndUserId(chat.binId, userId)
alt bin found & owned
BinsRepo-->>MW: bin
MW->>Handler: next()
Handler-->>Client: route handler runs
else not owned
BinsRepo-->>MW: null
MW-->>Client: 403 Forbidden
end
else chat not found
ChatsRepo-->>MW: null
MW-->>Client: 404 Not Found
end
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Free 📒 Files selected for processing (1)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary by CodeRabbit
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.