state.client = createClient({
url: wsUrl,
webSocketImpl: WebSocketImpl,
connectionParams: {
headers: { /* ... */ },
},
});
// some time later, this can happen multiple times concurrently
const subscription = state.client.iterate(/* ... */);
// these cleanup fns are called in some other places too
state.cleanupFns.set("some-id", () => {
void subscription.return?.();
});
try {
for await (const result of subscription) {
// ...
}
} catch (error) {
// ...
}
void subscription.return?.();
state.cleanupFns.delete("some-id");
All seems to be working fine, however occasionally Sentry reports the following unhandled promise rejection:
Judging from the line where it happens, looks like the client gets in a reconnect state, while all the subscriptions it has active are gone.
I'm using the client in a nodejs env, like so:
All seems to be working fine, however occasionally Sentry reports the following unhandled promise rejection:
Judging from the line where it happens, looks like the client gets in a reconnect state, while all the subscriptions it has active are gone.
Is this something I should handle? If so, how?