Skip to content
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

Handle exceptions during messaging session Websocket reconnection #2928

Open
GalenBry opened this issue Jul 30, 2024 · 1 comment
Open

Handle exceptions during messaging session Websocket reconnection #2928

GalenBry opened this issue Jul 30, 2024 · 1 comment

Comments

@GalenBry
Copy link

What are you trying to do?

I am looking for a way to catch exceptions during messaging client Websocket retry/reconnect. Our application is reporting thousands of errors like this "Event CloseEvent (type=close) captured as promise rejection". We don't have access to a full stack trace unfortunately, but it appears to be coming from DefaultMessagingSession during a users session (specifically, after some time). Looking into the source for DefaultMessagingSession, it looks like you can catch an error when initially calling session.start(), but how would I catch an error if the DefaultMessagingSession detects the Websocket has closed and decides to reconnect? The Promise for that operation is not exposed to my knowledge. This causes a lot of noise, and also reveals that there is no way to handle errors during Websocket reconnect.

How can the documentation be improved to help your use case?

Include a way to handle errors during Websocket reconnection.

What documentation have you looked at so far?

Amazon Chime SDK Developer Guide
Amazon Chime SDK API Reference
Github Issues
StackOverflow

@ltrung
Copy link
Contributor

ltrung commented Aug 30, 2024

@GalenBry Thanks for submitting issue. Have you tried to use the messaging session observer event messagingSessionDidStartConnecting to catch if it is reconnect https://github.com/aws/amazon-chime-sdk-js/blob/main/src/messagingsessionobserver/MessagingSessionObserver.ts#L8

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

No branches or pull requests

2 participants