knocklabs / javascript

Official JavaScript packages for interacting with Knock
https://knock.app/
MIT License
11 stars 2 forks source link

Knock stops receiving notifications if JWT changes #23

Closed Diggsey closed 5 months ago

Diggsey commented 1 year ago

When using authentication, if the JWT provided to <KnockFeedProvider> changes, then notifications stop being received in the inner <NotificationFeedPopover>.

This occurs only in chrome, and seems to be related to the WebSocket connection being closed.

Diggsey commented 1 year ago

This is the warning in the chrome console:

WebSocket connection to 'wss://api.knock.app/ws/v1/websocket?user_token=<redacted>&api_key=<redacted>&vsn=2.0.0' failed: WebSocket is closed before the connection is established.
cjbell commented 1 year ago

Hey @Diggsey – we're triaging this internally and investigating. Should have more updates here for you next week!

connorlindsey commented 5 months ago

Hi @Diggsey, we just released a new version of our JS client and React components which resolves this issue. Please upgrade to the latest versions (https://www.npmjs.com/package/@knocklabs/react/v/0.1.8) and let us know if you see any other issues. Thanks!