feat(chromium): roll tot, ignore unknown session error (#13932)

After https://chromium-review.googlesource.com/c/chromium/src/+/3606712 browser returns an error to messages addressed to unknown session id (previously such messages would never get a response).

#13637
This commit is contained in:
Yury Semikhatsky 2022-05-04 10:00:02 -07:00 committed by GitHub
parent 0c2371cba9
commit a919414553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -189,6 +189,8 @@ export class CRSession extends EventEmitter {
callback.reject(createProtocolError(callback.error, callback.method, object.error));
else
callback.resolve(object.result);
} else if (object.id && object.error?.code === -32001) {
// Message to a closed session, just ignore it.
} else {
assert(!object.id);
Promise.resolve().then(() => {

View File

@ -31,7 +31,7 @@ export type ProtocolResponse = {
id?: number;
method?: string;
sessionId?: string;
error?: { message: string; data: any; };
error?: { message: string; data: any; code?: number };
params?: any;
result?: any;
pageProxyId?: string;