From 78d9ed84c2add8ddbbc4916a35fd11ad650dc0a6 Mon Sep 17 00:00:00 2001 From: Chris Cotter Date: Wed, 29 Jul 2020 01:39:53 -0400 Subject: [PATCH] docs(firestore): note edge case for iterator.Done It's been reported that QuerySnapshotIterator may return iterator.Done before Stop, possibly due to EOF caused by networking issues. Add a caveat about this to the docs. Updates #2601 --- firestore/query.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firestore/query.go b/firestore/query.go index 03b32b7f921..abd30d5713e 100644 --- a/firestore/query.go +++ b/firestore/query.go @@ -773,7 +773,8 @@ type QuerySnapshotIterator struct { // Next blocks until the query's results change, then returns a QuerySnapshot for // the current results. // -// Next never returns iterator.Done unless it is called after Stop. +// Next is not expected to return iterator.Done unless it is called after Stop. +// Rarely, networking issues may also cause iterator.Done to be returned. func (it *QuerySnapshotIterator) Next() (*QuerySnapshot, error) { if it.err != nil { return nil, it.err