Skip to content

Implements suspendWebSocketConnection and resumeWebSocketConnection #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

mliao95
Copy link
Contributor

@mliao95 mliao95 commented Feb 27, 2025

Issue Number:

Description:

What are the changes? Why are we making them?

This PR implements and exposes two new functions, suspendWebSocketConnection and resumeWebSocketConnection. Suspending websocket connections will disconnect the websocket and prevent any further attempts to re-establish a websocket connection. The suspension can only be lifted by calling resumeWebSocketConnection which will immediately re-attempt to re-establish a connection to the active chat session.

These APIs will give customers increased flexibility in managing the websocket connection from their UI.


Functional backward compatibility:

Does this change introduce backwards incompatible changes? [YES/NO]

NO

Does this change introduce any new dependency? [YES/NO]

NO


Testing:

Is the code unit tested?

Unit testing will come as fast-follow

Have you tested the changes with a sample UI (e.g. Android Mobile Chat Example)?

Yes

Here are a list of manual test cases to run through:

  • Initiating chat and connecting with an agent
  • Retrieving transcript
  • Disconnecting from chat
  • Sending a message to the agent
    • See typing bubbles on agent side
    • See read/delivered receipt on client side
    • Receiving a message from the agent
    • See typing bubbles on client side
    • See read/delivered receipt on agent side
    • Sending an attachment to the agent (try .txt, .pdf, .jpg)
    • Preview the attachment on click
    • Receiving an attachment from the agent
    • Preview the attachment on click
  • Close the application (Without ending chat) → open app again → Start chat → Should Retrieve transcript from a previous chat session

@mliao95 mliao95 marked this pull request as ready for review February 27, 2025 02:18
return
}
if (isChatSuspended) {
Log.d("WebSocket", "Re-connection aborted due suspended chat session.")

Choose a reason for hiding this comment

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

nit: missing 'to' in 'due to'. Same comment for ongoing reconnection case below. This can be fixed with PR for unit tests

@mliao95 mliao95 merged commit ea798ae into main Feb 27, 2025
4 checks passed
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.

3 participants