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

Courier Websocket Error when web app is left open for long time #512

Closed
Brian-Azizi opened this issue Nov 15, 2023 · 2 comments
Closed

Courier Websocket Error when web app is left open for long time #512

Brian-Azizi opened this issue Nov 15, 2023 · 2 comments
Assignees

Comments

@Brian-Azizi
Copy link

We use the CourierProvider component, along with the Toast and Inbox. We have noticed that our users are getting a lot of "Courier Websocket errors" as console errors. It seems to happen when they leave the browser tab open for a long time and possibly if they're connectivity is patchy.

My guess as to what is happening is that the websocket loses connection when the user's device goes to sleep, but is then not able to reestablish that websocket connection when it opens back up.

As far as I can tell, this impacts the Toast component. Once the error has been observed, new notifications don't trigger a toast pop-up until the browser page has been refreshed. The Inbox seems to work just fine.

Here is an example of such a message (I've edited it to redact the client key)

Courier websocket error {
  target: {
    _listeners: { error: [], message: [], open: [], close: [] },
    _retryCount: 1,
    _shouldReconnect: true,
    _connectLock: true,
    _binaryType: 'blob',
    _closeCalled: false,
    _messageQueue: [
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
      '{"action":"subscribe","data":{"channel":"a395aa8a-446f-4bf5-b3fc-d65b02765887","clientSourceId":"0e3a1247-b2a3-4cee-bc88-e4115959a061","clientKey":"<REDACTED>","event":"*","version":5}}',
    ],
    _protocols: [],
    _options: {},
    _ws: {},
    _connectTimeout: 81,
  },
  type: 'error',
  message: 'TIMEOUT',
  error: {},
}

Has anyone seen this before and/or can help with this? Thanks!

@rileylnapier
Copy link
Collaborator

hi, we do have automatic keep alive actions but let me test when i kill my connection. what version are you on?

@rileylnapier rileylnapier self-assigned this May 16, 2024
@rileylnapier
Copy link
Collaborator

should be resolved with 6.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants