Question
My customers can still chat with us after all agents have gone offline. Why is this happening?
Answer
In Zendesk Chat, agents do not have the ability to end the chat on behalf of the visitor once the chat has started. The connection is still open until the visitor ends the chat, or the chat session ends. For more information, see the article: When do chats time out?
An agent can end the chat in the user interface but the visitor could still have the chat dialogue open and begin a chat conversation. The new reply might go answered which could cause confusion because there are no agents to take the chat.
Adding custom script
It is possible to write a custom script that ends a chat as soon as an account goes offline.
<!--Callback to end chat when account goes offline -->
<script type="text/javascript"> zE('webWidget:on', 'chat:status', function (status) { if (status === 'offline') { zE('webWidget', 'chat:end') } else { console.log('This chat session is now', status); } }); </script>
For more information, consult the Chat API documentation.