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

Fixed websocket connection and falback mechanism #1378

Merged
merged 8 commits into from
Mar 11, 2025

Conversation

razvantomegea
Copy link
Contributor

@razvantomegea razvantomegea commented Mar 10, 2025

Issue

Websocket not reconnecting after logout and the fallback mechanism (polling interval) is not triggered.

Reproduce

  1. Login with one address;
  2. Logout
  3. Login back with another address.

Actual Result: "Websocket reconnecting..." message appears (it should not when logged out)
Expected Result: "Websocket connected" message appears (after logged in again)

Root cause

  • The old address is checked within the functions (hooks closure);
  • There is not check for previous websocket status to see the change differences in the fallback mechanism;
  • Websocket connection status is not reactive to trigger fallback mechanism on webscoket connection failure.

Fix

  • Fetch the address directly from store in the functions (setTimeout and setInterval);
  • Make the WebsocketConnection reactive.

Additional changes

  • Added useWebsocketPollingFallback to reuse the polling interval fallback mechanism

Contains breaking changes

  • No
  • Yes

Updated CHANGELOG

  • No
  • Yes

Testing

  • User testing
  • Unit tests

@razvantomegea razvantomegea merged commit e2515c1 into development Mar 11, 2025
1 check passed
@razvantomegea razvantomegea deleted the rt/fix/ws-connect-and-fallback branch March 11, 2025 08:23
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