-
Notifications
You must be signed in to change notification settings - Fork 0
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
Expiration check #46
Expiration check #46
Conversation
Moved to drafts because sdk/packages/chat-widget/src/index.tsx Lines 247 to 279 in 7be3c14
|
return lastExpirationResponse?.type === "bot" | ||
? lastExpirationResponse.payload.expirationTimestamp | ||
: undefined; |
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.
minor nit (and less precise but)
return lastExpirationResponse?.type === "bot" | |
? lastExpirationResponse.payload.expirationTimestamp | |
: undefined; | |
return lastExpirationResponse?.payload.expirationTimestamp; |
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.
I would rather do more precise and a bit clearer on the data structure.
new Date().getTime() > lastExpirationTimestamp | ||
) { | ||
setState({ | ||
conversationId: uuid(), |
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.
curious how this works for a multimodal when someone is already on the phone. Should this fail hard instead of resetting with a new conversation ID? What's the UX here
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.
This package does not cover multimodal.
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.
oh yeah! whoops
7be3c14
to
580eef2
Compare
typeof lastExpirationTimestamp === "number" && | ||
new Date().getTime() > lastExpirationTimestamp | ||
) { | ||
setState({ |
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.
💭 this seems like it should raise an exception or signal in some way that there's a new conversation starting
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.
@michaelglass totally with you there, we are discussing the behind-the-scenes way to do this, basically any 'your conversation has expired' type of text content needs to be controlled inside the platform, so you can imagine some kind of explicit special message passing will happen here, but later.
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.
Can we add a conversationEnded
subscription thinger here.
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.
@sam-trost that sounds like a bit of a change in direction, I would rather have a discussion about it at some point this week.
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.
the code here looks fine. I'm not sure if it's the right approach.
580eef2
to
01469c1
Compare
01469c1
to
af4e47e
Compare
Abandoning this in favor of #124 |
If the conversation expired since the user interacted with the bot last, reset to a new ID.