twiliotwilio-apitwilio-programmable-chattwilio-flex

Accepted Twilio chat task that pass 24 hours are deleted, but the conversation is not


I noticed that if a worker goes offline by closing their computer or tab while a task is accepted, the task will be deleted after 24 hours if the worker does not come back online, but the conversation will not.

What happens next is that any inbound messages will be directed to that conversation, and the worker will not see them. The only fix I have found so far is to manually close the conversations using the CLI.

This also happens if you accept a task in Twilio Flex and then go to the console and delete it.

Is there a programmatic way to address this, or am I missing something?


Solution

  • This is a case of situation that we called "orphaned conversation". Since, there is no channel janitor for Twilio Conversation based messaging which would manage the session as for long lived chat/message under the Twilio Programmable Chat/Messaging.

    As for Twilio Flex, you'd need to implement "Park an Interaction": https://www.twilio.com/docs/flex/developer/conversations/park-an-interaction. This would give you control to manage your own Conversation channel(s). For non Flex solution, you can utilise the timer for Twilio conversation: https://www.twilio.com/docs/conversations/states-timers.

    I hope it helps.