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

Fix messagingSession infinite reconnect loop on error and also add backwards compatibility with AWS JS SDK V2 for getMessagingSessionEndpoint #2444

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

manasisurve
Copy link
Contributor

Issue #:
#2372

Description of changes:

  1. Fix to break infinite reconnect loop in messagingSession on timeout. Reported here Chime chat(messaging) messagingSessionDidStop did not fire on disconnect #2372
  2. Add backwards compatibility with aws-js-sdk 2.x for getMessagingSessionEndpoint call

Testing:

  • Tested reconnect loop fix by expiring credentials to validate reconnect loop on messagingSession breaks after the timeout

  • Tested compatibility with aws sdk v2 by changing the chime client instantiation in the messagingSession demo

  • Set aws credentials with in correct aws session token

  • Run the messagingSession demo here: https://github.com/aws/amazon-chime-sdk-js/tree/main/demos/browser. npm run start --app=messagingSession

  • connect with an app instance user

  • Reconnect loop is triggered but breaks after timeout

Can these tested using a demo application? Please provide reproducible step-by-step instructions.
To Test aws js sdk v2 compatibility run the messagingSession demo with below changes
Make the following changes in amazon-chime-sdk-js/demos/browser/app/messagingSession/messagingSession.ts

import { ChimeSDKMessagingClient } from '@aws-sdk/client-chime-sdk-messaging'
to
import * as Chime from 'aws-sdk/clients/chime';

and change

 const chime = new ChimeSDKMessagingClient({ region: 'us-east-1', credentials: response });
to
const chime = new Chime({ region: 'us-east-1', credentials: response });

To Test aws js sdk v3 with v2 style run the messagingSession demo with below changes
Make the following changes in amazon-chime-sdk-js/demos/browser/app/messagingSession/messagingSession.ts

import { ChimeSDKMessagingClient } from '@aws-sdk/client-chime-sdk-messaging'
to
import { ChimeSDKMessaging } from '@aws-sdk/client-chime-sdk-messaging';

and

 const chime = new ChimeSDKMessagingClient({ region: 'us-east-1', credentials: response });
to
const chime = new ChimeSDKMessaging({ region: 'us-east-1', credentials: response });

and then run
Checklist:

  1. Have you successfully run npm run build:release locally?
    yes

  2. Do you add, modify, or delete public API definitions? If yes, has that been reviewed and approved?
    no

  3. Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?
    no
    By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
    yes

…ckwards compatibility with AWS JS SDK V2 for getMessagingSessionEndpoint
@manasisurve manasisurve requested a review from a team as a code owner September 20, 2022 17:24
@manasisurve manasisurve merged commit 69cc694 into main Sep 20, 2022
@manasisurve manasisurve deleted the surve-bug-fix branch September 20, 2022 19:11
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.

2 participants