Skip to content

Multiple valueChange subscriptions for same collection leads to one subscription firing changes for another #2740

Open
@HadiAyoub

Description

@HadiAyoub

Version info

Angular: 10.0.9

Firebase: ^7.13.1

AngularFire: ^6.02

Other (e.g. Ionic/Cordova, Node, browser, operating system):

How to reproduce these conditions

Create multiple valueChange subscriptions to the same collection (with a different query)

this.db.collection('/people/' + this.selectedPeopleId + '/messages', ref => ref.orderBy("createdDate").limitToLast(100)).valueChanges({idField: 'documentId'}).subscribe(messageUpdates => 

AND

this.db.collection('/people/' + this.selectedPeopleId + '/messages', ref => ref.where("type", ">", 0).limitToLast(100)).valueChanges({idField: 'documentId'}).subscribe(messageUpdates => 

In my case, I am unsubscribing from the second listener and recreating it with a different limitToLast value (though I'm unsure if that's necessary to reproduce)

Debug output

none

Expected behavior

Each valueChange listener should only fire results for itself

Actual behavior

the first listener is returning valueChanges that match the query for the second listener.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions