CHI-3872: Fix 'end chat' not launching the post survey for Aselo webchat#4320
Merged
stephenhand merged 6 commits intomasterfrom May 7, 2026
Merged
CHI-3872: Fix 'end chat' not launching the post survey for Aselo webchat#4320stephenhand merged 6 commits intomasterfrom
stephenhand merged 6 commits intomasterfrom
Conversation
# Conflicts: # aselo-webchat-react-app/src/components/endChat/EndChat.tsx
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the Aselo webchat “End chat” flow so that ending a Conversation correctly triggers the post-chat survey behavior, primarily by using conversationSid and the Twilio Conversations API instead of treating a Conversation SID like a Programmable Chat channel SID.
Changes:
- Webchat UI now sends
conversationSidto/endChat(and no longer clears session immediately on “End chat” forfinishTask). - Account-scoped
endChatlambda now posts the “user left” system message via Conversations whenconversationSidis provided, and usesgetWorkspaceSid. - Channel janitor adds clearer conversation/channel branching and improved logging/guardrails.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lambdas/account-scoped/src/conversation/endChat.ts | Use conversationSid + Conversations API to send the end-chat message; additional diagnostics around task state/cleanup. |
| lambdas/account-scoped/src/conversation/chatChannelJanitor.ts | Improve conversation vs channel deactivation branching and logging. |
| aselo-webchat-react-app/src/sessionDataHandler.ts | Update end-chat payload typing from channelSid to conversationSid. |
| aselo-webchat-react-app/src/components/endChat/EndChat.tsx | Send conversationSid to /endChat and avoid clearing session during finishTask flow. |
| aselo-webchat-react-app/src/components/endChat/QuickExit.tsx | Update props to use conversationSid for deferred /endChat request. |
| aselo-webchat-react-app/src/components/endChat/CloseChatButtons.tsx | Wire conversation.sid into conversationSid props for EndChat/QuickExit. |
Comment on lines
44
to
48
| type EndChatPayload = { | ||
| channelSid: string; | ||
| conversationSid: string; | ||
| language?: string; | ||
| token: string; | ||
| }; |
Collaborator
Author
There was a problem hiding this comment.
@copilot apply changes based on this feedback
Contributor
There was a problem hiding this comment.
Fixed in commit 4ead4ef. Updated both deferredRequest('/endChat', ...) test payloads to use conversationSid: 'CH123' instead of channelSid: 'CH123', matching the updated EndChatPayload type.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/techmatters/flex-plugins/sessions/8025f7f6-a573-4d3a-98a0-e3783f79ec94 Co-authored-by: stephenhand <1694716+stephenhand@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist
Other Related Issues
None
Verification steps
AFTER YOU MERGE
You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P