Skip to content

Commit

Permalink
docs(firestore): note edge case for iterator.Done (#2658)
Browse files Browse the repository at this point in the history
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

Co-authored-by: Tyler Bui-Palsulich <26876514+tbpg@users.noreply.github.com>
  • Loading branch information
tritone and tbpg committed Jul 31, 2020
1 parent 12af083 commit c11f46d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion firestore/query.go
Expand Up @@ -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
Expand Down

0 comments on commit c11f46d

Please sign in to comment.