From c966290a9a08eb620a1eefeb4693217d31c2d773 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Mon, 1 Feb 2021 10:39:24 -0800 Subject: [PATCH 1/2] fix(firestore): address a missing branch in watch.stop() error remapping --- firestore/watch.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/firestore/watch.go b/firestore/watch.go index 671ce9e522a..911caa29c9d 100644 --- a/firestore/watch.go +++ b/firestore/watch.go @@ -446,9 +446,12 @@ func (s *watchStream) stop() { return } if err != nil { + // if an error occurs while closing the stream s.err = err + } else { + // if we close successfully, + s.err = io.EOF // normal shutdown } - s.err = io.EOF // normal shutdown } func (s *watchStream) close() error { From 4057399dbddb16ab9ed618ff317248e132ac8a26 Mon Sep 17 00:00:00 2001 From: Christopher Wilcox Date: Mon, 1 Feb 2021 11:31:53 -0800 Subject: [PATCH 2/2] fix(firestore): prefer not using else --- firestore/watch.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firestore/watch.go b/firestore/watch.go index 911caa29c9d..e4ac7fb3ded 100644 --- a/firestore/watch.go +++ b/firestore/watch.go @@ -448,10 +448,10 @@ func (s *watchStream) stop() { if err != nil { // if an error occurs while closing the stream s.err = err - } else { - // if we close successfully, - s.err = io.EOF // normal shutdown + return } + // if we close successfully, + s.err = io.EOF // normal shutdown } func (s *watchStream) close() error {