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

Bug/msg session reconnect #2193

Merged
merged 4 commits into from
May 3, 2022
Merged

Bug/msg session reconnect #2193

merged 4 commits into from
May 3, 2022

Conversation

dpwspoon
Copy link
Contributor

Issue #:

Description of changes:

Fix issue with recent change to getMessagingSessionEndpoint resolve on connect where it would not reconnect if getMessagingSessionEndpoint failed.

Testing:

Can these tested using a demo application? Please provide reproducible step-by-step instructions.

Start the messaging demo app in browser. Create app instance user. Connect. Disconnect wifi, reconnect, and see websocket get establish

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?
    yes

  3. Do you change the wire protocol, e.g. the request method? If yes, has that been reviewed and approved?
    yes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dpwspoon dpwspoon requested a review from a team as a code owner April 29, 2022 00:21
.promise();
endpointUrl = endpoint.Endpoint.Url;
} catch (e) {
const closeEvent = new CloseEvent('close', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you print the error here before creating the CloseEvent?

this.logger.error(${error});

Copy link
Contributor Author

@dpwspoon dpwspoon May 2, 2022

Choose a reason for hiding this comment

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

This is already logged when handled in the closeEventHandler

this.logger.info(`WebSocket close: ${event.code} ${event.reason}`);

so don't think duplicate logging is needed here:

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but the reason is logged, not sure if error can be something different hence suggested.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, good solution I think.

@dpwspoon dpwspoon merged commit ec6c67a into release-2.x May 3, 2022
@dpwspoon dpwspoon deleted the bug/msg-session-reconnect branch May 3, 2022 15:17
devalevenkatesh added a commit that referenced this pull request May 3, 2022
* Messaging Session reconnects on failures to fetch messaging session endpoint

Co-authored-by: David Witherspoon <[email protected]>
Co-authored-by: Venkatesh Devale <[email protected]>
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