File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
packages/remote-config/src/client Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -152,8 +152,15 @@ export class RealtimeHandler {
152
152
}
153
153
this . isClosingConnection = true ;
154
154
155
- if ( this . reader ) {
156
- await this . reader . cancel ( ) ;
155
+ try {
156
+ if ( this . reader ) {
157
+ await this . reader . cancel ( ) ;
158
+ }
159
+ } catch ( e ) {
160
+ // The network connection was lost, so cancel() failed.
161
+ // This is expected in a disconnected state, so we can safely ignore the error.
162
+ this . logger . debug ( 'Failed to cancel the reader, connection is gone.' ) ;
163
+ } finally {
157
164
this . reader = undefined ;
158
165
}
159
166
@@ -444,7 +451,7 @@ export class RealtimeHandler {
444
451
* invalid messages or when real-time updates are disabled.
445
452
*/
446
453
private async handleNotifications (
447
- reader : ReadableStreamDefaultReader
454
+ reader : ReadableStreamDefaultReader < Uint8Array >
448
455
) : Promise < void > {
449
456
if ( reader == null ) {
450
457
return ;
You can’t perform that action at this time.
0 commit comments