mysterious extra docs returned on initial query

40 views
Skip to first unread message

Jerry Sumpton

unread,
Apr 13, 2020, 6:32:43 PM4/13/20
to Firebase Google Group
I have a new situation where I am getting extra docs returned from Firestore. In my code, this is repeatable and consistent.

Angular 9.0.6
@angular/fire 5.4.2

The listing:

    list(startAfter, pageSize) {
        return this.angularFirestore.collection('theEntityName', ref => ref
            .orderBy('created', 'desc')
            .startAfter(startAfter)
            .limit(pageSize))
            .valueChanges();
    }

For my first call, startAfter = empty string, which seems to consistently start with the first record. Same if I use Timestamp.

Just before this call, another module has made several calls for individual docs

    get(id) {
        return this.angularFirestore.collection('theEntityName').doc(id).valueChanges();
    }

These "gets" are in the first mat-tab (0), and the collection list is in another tab (2).

The first tab works as expected. If I list two cards, which calls two docs, they list fine. This first tab (0) is listing doc ids from Redis and iterating cards that are populating with "get" calls individually.

The first call to the collection list in tab (2) will immediately receive the cards from the first tab, followed by the number in the limit of the listing call. Subsequent paging requests return the expected docs.

So, request 5 docs on tab 0, for example, switch to tab (2) and limit 2, I receive the first two docs from tab (0) followed by the first two docs from the list call. Leave tab (0) at 5 and limit 4 on tab (2) I get the first 4 docs from tab (0) followed by the first 4 from the list call.

I hope this isn't two confusing to understand.

Should Firestore support this where some many individual listings have separate live connections to Firestore, and then support a listing?

Would this be an AngularFire bug?

Is there anything wrong with calling .startAfter('')

Kato Richardson

unread,
Apr 13, 2020, 8:13:13 PM4/13/20
to Firebase Google Group
Hi Jerry,

Could you submit an issue with a complete and minimal repro on the issue tracker for AngularFire? My first guess would be an issue there.

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/2723eca5-af89-476e-8a3b-2e38e88c5fc0%40googlegroups.com.


--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages