From d7fb11782031d1ad9dc002a6a15745e014b853f7 Mon Sep 17 00:00:00 2001 From: Manasi Surve Date: Mon, 19 Sep 2022 16:43:24 -0700 Subject: [PATCH] Fix messagingSession infinite reconnect loop on error and also add backwards compatibility with AWS JS SDK V2 for getMessagingSessionEndpoint --- CHANGELOG.md | 5 ++--- src/messagingsession/DefaultMessagingSession.ts | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9798bb9f2..88dfe76042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,9 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- `MessagingSession` infinite reconnect loop to break on timeout. -- `MessagingSession` `getMessagingSessionEndpoint` call is now backwards compatible with aws js sdk v2 and lower. - +- `MessagingSession` reconnect loop did not break on error past reconnect deadline. Infinite reconnect loop was caused due to firstConnectionAttemptTimestamp not being set as startedConnectionAttempt was not invoked. Check https://github.com/aws/amazon-chime-sdk-js/issues/2372 for details. +- `MessagingSession` `getMessagingSessionEndpoint` call is now backwards compatible with AWS JS SDK v2. - Use a default "playback" `latencyHint` when creating the `AudioContext` on Windows. Also adds a `setDefaultLatencyHint` API to `DefaultDeviceController` to allow for overriding. ## [3.7.0] - 2022-07-05 diff --git a/src/messagingsession/DefaultMessagingSession.ts b/src/messagingsession/DefaultMessagingSession.ts index 673124f1f8..8b3315f138 100644 --- a/src/messagingsession/DefaultMessagingSession.ts +++ b/src/messagingsession/DefaultMessagingSession.ts @@ -109,6 +109,8 @@ export default class DefaultMessagingSession implements MessagingSession { private async startConnecting(reconnecting: boolean): Promise { let endpointUrl = this.configuration.endpointUrl; + // Moving this reconnect logic can potentially result into an infinite reconnect loop on errors. + // Check https://github.com/aws/amazon-chime-sdk-js/issues/2372 for details. if (!reconnecting) { this.reconnectController.reset(); }