Keeping Chatbot Active?

6 Comments

  • Joey
    Comment actions Permalink

    Hi Alex-

    Sending the ping should be enough. As far as what circumstance may cause an unexpected end, remember it could be occurring on the user's end as well. In the event of a disconnect we recommend you reconnect to the same authenticated WebSocket URL immediately. This way the session can be resumed without needing to set up again.

    0
  • Alex
    Comment actions Permalink

    I don't mean keeping a specific chat session active. I mean keeping the agent from going to an "Invisible" state, without a EOS signal.

    The backend is sending pings (and receiving pongs), but the bot is invisible, so the chat option doesn't appear on the website.

    I want to know what could cause an agent to become "invisible".

    0
  • Jay
    Comment actions Permalink

    Hi Alex, 

    Note that the Chat Conversations API lets your application act as a Zendesk Chat agent. Using the same identity, you could login into the dashboard (web portal) and agent status could be updated to "Invisible". Can you check if there any activities in dashboard (web portal) recently that might be the cause?


    > Should I just send a updateAgentStatus('ONLINE') request periodically (taking the place of the ping in the example) to be safe?

    I would agree that it is a good defensive mechanism to keep the agent online

    Regards,
    Jay

    0
  • Alex
    Comment actions Permalink

    Hi Jay,

    I think what happened is that my computer got restarted for Windows update (I'm testing locally), and the agent went invisible.

    Still not sure why the agent goes invisible in the first place though. Do agents go invisible after a certain amount of time with no activity?

    Don't know what activity to look for. All I saw was that agent went invisible sometime after 11 pm.

    0
  • Jay
    Comment actions Permalink

    Hi Alex, 

    There could be multiple reasons that the bot goes invisible unexpectedly.


    As I mentioned above, if you or someone ever login into the dashboard (web portal) using bot's identity. They will share the same status. In dashboard, the agent status could be mutated by
     - manually update in agent status switcher 
    - idle timeout preferences
    - operation hours settings
    - automatic idle settings in assigned routing

    Please double check to ensure your bot is not affected by any settings above. 


    Another possible reason could be related to the websocket disconnection.

    If the bot get disconnected (with `EOS` signal ) and `startAgentSession` again. That would defaults bot status to invisible. To troubleshoot, it is advisable to log all `EOS` signal received  and calls to `startAgentSession`.

    If that is the case, the fix would be always `updateAgentStatus` online whenever the bot calls startAgentSession and connects to a new websocket url.

    Regards,
    Jay

    0
  • Alex
    Comment actions Permalink

    The invisible status change happens after I'm away from the computer (leaving it on overnight), so I don't manually update the status. The web session does expire from inactivity however.

    Idle timeout is off, as is operation hours and automatic idle.

    For EOS signals, my bot updates agent status when the websocket connection opens.

    I have noticed recently that handleClose() is being called (the websocket closed without sending EOS) overnight. I'm able to reconnect to the websocket, but any requests sent get no responses.

    For now, I'm just changing ping to updateAgentStatus() and having handleClose() create a new agent session instead.

    0

Please sign in to leave a comment.

Powered by Zendesk