-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat:updates for conversations #1955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,16 +84,17 @@ export default function ViewData({ | |
| isPreview: viewData.isPreview, | ||
| linkId: link.id, | ||
| brand: brand, | ||
| viewerId: "viewerId" in viewData ? viewData.viewerId : undefined, | ||
| viewerId: viewData.viewerId || ("viewerId" in viewData ? viewData.viewerId : undefined), | ||
| isMobile: isMobile, | ||
|
Comment on lines
+87
to
88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simplify viewerId assignment; conversationsEnabled gating looks good The viewerId: viewData.viewerId || ("viewerId" in viewData ? viewData.viewerId : undefined),This is equivalent to just - viewerId: viewData.viewerId || ("viewerId" in viewData ? viewData.viewerId : undefined),
+ viewerId: "viewerId" in viewData ? viewData.viewerId : undefined,The updated
Also applies to: 93-98 🤖 Prompt for AI Agents |
||
| isDataroom: !!dataroomId, | ||
| documentId: document.id, | ||
| dataroomId: dataroomId, | ||
| conversationsEnabled: | ||
| !!dataroomId && | ||
| ("conversationsEnabled" in viewData | ||
| ? viewData.conversationsEnabled | ||
| : false), | ||
| (!!dataroomId && | ||
| ("conversationsEnabled" in viewData | ||
| ? viewData.conversationsEnabled | ||
| : false)) || | ||
| (!dataroomId && link.enableConversation === true), | ||
| assistantEnabled: document.assistantEnabled, | ||
| allowDownload: | ||
| document.downloadOnly || | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anonymous viewer email construction will throw at runtime
In the anonymous viewer path you’re treating the
ipAddressimport as if it were a string:But
ipAddressis a function from@vercel/functions(as you correctly use elsewhere viaipAddress(request)). Here,ipAddressis never called, soipAddress?.replaceattempts to invoke.replaceon the function object, which doesn’t exist and will throw when this branch is hit.This will break any non‑preview, non‑email‑protected view where
emailis absent (the new anonymous viewer flow).A safe version would be:
The
viewerIdbeing returned in the response (viewerId: viewer?.id || undefined) is otherwise consistent with the new viewer flow and will be useful for conversations.Also applies to: 679-683
🤖 Prompt for AI Agents