Skip to content

Websocket Default Transport#1727

Merged
radumojic merged 5 commits intodevelopmentfrom
rm/websocket-transport
Mar 11, 2026
Merged

Websocket Default Transport#1727
radumojic merged 5 commits intodevelopmentfrom
rm/websocket-transport

Conversation

@radumojic
Copy link
Contributor

Issue/Feature

  • Use websocket transport as default on websocket init

Reproduce

Issue exists on version 2. of sdk-dapp.

Root cause

Fix

Additional changes

Contains breaking changes

  • No
  • Yes

Updated CHANGELOG

  • No
  • Yes

Testing

  • User testing
  • Unit tests

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue in sdk-dapp version 2 by ensuring that the websocket connection explicitly uses the 'websocket' transport during initialization. This change standardizes the connection method, preventing potential inconsistencies or failures that might arise from relying on default transport negotiation. The update also includes a version bump and a corresponding changelog entry.

Highlights

  • Default Websocket Transport: Configured the websocket initialization to explicitly use 'websocket' as the default transport, addressing an issue in sdk-dapp version 2.
  • Version Update: Bumped the package version from 5.6.20 to 5.6.21.
  • Changelog Entry: Added a new entry to CHANGELOG.md for version 5.6.21 detailing the websocket transport change.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • CHANGELOG.md
    • Added a new entry for version 5.6.21 with a link to the PR.
    • Included a description: "Use websocket transport as default on websocket init".
  • package.json
    • Updated the package version from 5.6.20 to 5.6.21.
  • src/methods/initApp/websocket/initializeWebsocketConnection.ts
    • Explicitly set transports: ['websocket'] in the io connection options.
  • src/methods/initApp/websocket/tests/initializeWebsocketConnection.test.ts
    • Updated the expected io connection options in the test to include transports: ['websocket'].
Activity
  • No specific activity (comments, reviews, progress) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the websocket initialization to use 'websocket' as the default transport, preventing fallback to long-polling. The implementation is straightforward. I've added a couple of comments: one to correct a link in the CHANGELOG and another to suggest updating the unit tests to reflect the new transport configuration.


## [Unreleased]

## [[5.6.21](https://github.com/multiversx/mx-sdk-dapp/pull/1728)] - 2026-03-11

Choose a reason for hiding this comment

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

medium

The pull request link for version [5.6.21] appears to be incorrect. It points to pull request #1728, but the change described below is from pull request #1727. To maintain consistency and correct traceability, the version link should also point to #1727.

Suggested change
## [[5.6.21](https://github.com/multiversx/mx-sdk-dapp/pull/1728)] - 2026-03-11
## [[5.6.21](https://github.com/multiversx/mx-sdk-dapp/pull/1727)] - 2026-03-11

timeout: TIMEOUT,
query: { address }
query: { address },
transports: ['websocket']

Choose a reason for hiding this comment

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

medium

While this change correctly forces the websocket transport, the corresponding unit test in src/methods/initApp/websocket/tests/initializeWebsocketConnection.test.ts has not been updated to assert this new option. Please update the test to ensure it checks for transports: ['websocket'] in the io call options to prevent future regressions.

For example, the test could be updated as follows:

// in src/methods/initApp/websocket/tests/initializeWebsocketConnection.test.ts
expect(io).toHaveBeenCalledWith(websocketUrl, {
  forceNew: true,
  reconnection: true,
  reconnectionAttempts: 3,
  reconnectionDelay: 500,
  timeout: 3000,
  query: { address: account.address },
  transports: ['websocket']
});

@radumojic radumojic merged commit 6312bcf into development Mar 11, 2026
2 checks passed
@radumojic radumojic deleted the rm/websocket-transport branch March 11, 2026 12:53
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