refactor(WebSocketShard): throttling error handling (#9701)

* refactor(WebSocketShard): handle unknown identify errors

* chore: use better abort check

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
DD
2023-07-12 20:19:11 +03:00
committed by GitHub
parent 7fb91c57f7
commit ceab07bec8
3 changed files with 27 additions and 15 deletions

View File

@@ -25,7 +25,9 @@ export interface IContextFetchingStrategy {
retrieveSessionInfo(shardId: number): Awaitable<SessionInfo | null>;
updateSessionInfo(shardId: number, sessionInfo: SessionInfo | null): Awaitable<void>;
/**
* Resolves once the given shard should be allowed to identify, or rejects if the operation was aborted
* Resolves once the given shard should be allowed to identify
* This should correctly handle the signal and reject with an abort error if the operation is aborted.
* Other errors will cause the shard to reconnect.
*/
waitForIdentify(shardId: number, signal: AbortSignal): Promise<void>;
}