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 {
152152 }
153153 this . isClosingConnection = true ;
154154
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 {
157164 this . reader = undefined ;
158165 }
159166
@@ -444,7 +451,7 @@ export class RealtimeHandler {
444451 * invalid messages or when real-time updates are disabled.
445452 */
446453 private async handleNotifications (
447- reader : ReadableStreamDefaultReader
454+ reader : ReadableStreamDefaultReader < Uint8Array >
448455 ) : Promise < void > {
449456 if ( reader == null ) {
450457 return ;
You can’t perform that action at this time.
0 commit comments