-
Notifications
You must be signed in to change notification settings - Fork 2k
Help Center: No 'help-center' event in support interactions #106892
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: trunk
Are you sure you want to change the base?
Help Center: No 'help-center' event in support interactions #106892
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
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.
Great great change. Thank you!! I left some comments.
|
|
||
| try { | ||
| if ( ! supportInteraction && chatIdString ) { | ||
| const newInteraction = await startNewInteraction( { |
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.
| const newInteraction = await startNewInteraction( { | |
| supportInteraction = await startNewInteraction( { |
| event_external_id: returnedChat.chat_id.toString(), | ||
| const chatIdString = returnedChat.chat_id?.toString?.() ?? String( returnedChat.chat_id ); | ||
| let supportInteraction = currentSupportInteraction; | ||
| let interactionOdieId = odieId; |
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.
Do we need interactionOdieId at all?
| ( interaction: SupportInteraction ) => { | ||
| setChat( ( prevChat ) => ( { | ||
| ...prevChat, | ||
| supportInteractionId: interaction.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.
Probably for later. Maybe we can always rely on the event ID on the URL and get rid of the one in the chat.
| interactionId: currentSupportInteraction!.uuid, | ||
| eventData: { | ||
| event_external_id: returnedChat.chat_id.toString(), | ||
| const chatIdString = returnedChat.chat_id?.toString?.() ?? String( returnedChat.chat_id ); |
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.
Not sure I understand this line. Both parts seem to return chat_id.
| updateInteractionContext( updatedInteraction ); | ||
| } | ||
| } catch ( error ) { | ||
| // eslint-disable-next-line no-console |
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.
Deserves an event for sure.
| } ); | ||
| } | ||
| activeInteractionId = interaction.uuid; | ||
| updateInteractionContext( interaction ); |
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 line worries me. It will redirect to another URL and re-render everything. I wonder what problems will that bring. Maybe we can do it at the very end of the function when everything is done?
if ( interactionId && ! interactionIdFromURL) {
// update the URL
}
Fix https://linear.app/a8c/issue/DOTCOM-15086/do-not-open-a-new-interaction-every-time
When a user reaches /odie, we create a new support interaction, with a first event 'help-center'.
After the first message to Odie, we add another event to the same interaction, 'odie'. The same thing happens when we escalate to live chat.
Problem: Every time a user lands in /odie, a new support interaction is created. That is probably useless, it happens a lot that users go away and then return and then open /odie by mistake. Those are all new, forgotten, support interactions in the database.
This PR tries to improve that by not using the 'help-center' event anymore, thus creating a new support interaction only when we talk with Odie or we directly escalate to live chat.
Testing steps