Skip to content

Comments

Create control task for 'pre-survey' and clean up stale chat channel#455

Merged
mythilytm merged 13 commits intogian_CHI-175-lexfrom
CHI1789-cleanup_channel
Jun 2, 2023
Merged

Create control task for 'pre-survey' and clean up stale chat channel#455
mythilytm merged 13 commits intogian_CHI-175-lexfrom
CHI1789-cleanup_channel

Conversation

@mythilytm
Copy link
Contributor

@mythilytm mythilytm commented May 11, 2023

Description

  • In Taskrouter callback in Twilio console, added isChatCaptureControl filter attribute to 'Survey' workflow
  • Created a task when the chat channel is captured, with the check on isChatCaptureControl
  • Updated janitorListener to handle cleanup of this stale channel
  • Move control task to completed assignment state

Checklist

  • Corresponding issue has been opened
  • New tests added

Related Issues

Fixes # 1789

Verification steps

  • Deploy this branch to Aselo Development via github actions
  • In serverless console (Twilio console), turn Live logs on.
  • Check that dev web chat's pre-survey is initiated with the lex programmed chatbot configured questions
  • In serverless logs, ensure that this message appears: Move control task to complete state.

Copy link
Collaborator

@gpaoloni gpaoloni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks! Only changes I suggest are related to cleaning the debug logs.

Comment on lines 99 to 100
const cleanupType = taskAttributes.isChatbotCaptureControl ? 'pre-survey' : 'post-survey';
console.log(`Handling clean up ${cleanupType}...`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this one before merging, feels like unnecessary noise.

},
});
},
].map((func) => func()),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was handy for debugging, but it's actually easier to read if this are Promises (rather than functions that return promises and then map the call to each). Can you revert the change?

@mythilytm mythilytm merged commit 7b039d9 into gian_CHI-175-lex Jun 2, 2023
@mythilytm mythilytm deleted the CHI1789-cleanup_channel branch June 2, 2023 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants