Closed WestFlow127 closed 3 years ago
Please can you debug your observable using the debug
operator to check whether your sequence gets disposed due to an error or not?
The other possible reasons are:
Here is the debug output:
2020-09-10 11:37:03.101: MagmaFirestoreProvider.swift:165 (fetchGlobalFeed(limit:startAfter:listens:)) -> subscribed 2020-09-10 11:37:03.324: MagmaFirestoreProvider.swift:165 (fetchGlobalFeed(limit:startAfter:listens:)) -> Event next([Entity.Fragment(ref: <FIRDocumentReference: 0x60000109ef40>, publisher: Optional(UserEntity.Fragment(ref: <FIRDocumentReference: 0x60000109ee80>, username: "Art_Collective", name: nil ......... privacy: Optional(magma.MagmaMagPrivacy.Public))]) 2020-09-10 11:37:03.458: MagmaFirestoreProvider.swift:165 (fetchGlobalFeed(limit:startAfter:listens:)) -> Event completed 2020-09-10 11:37:03.458: MagmaFirestoreProvider.swift:165 (fetchGlobalFeed(limit:startAfter:listens:)) -> isDisposed
When a new item is posted to the feed with a privacy of "Sub", the item does not appear and there is zero debug output. I have to refresh the collection view to get the above output and the new item in the feed. I assume that's because the observable is being disposed?
Creating a composite index for the query worked! Thank you for the suggestion.
I have a query that provides 'feed' data to a collection view using RxSwift and RxFirebase. This feed data now has a 'Privacy' field (possible values: "Public", "Sub", and "Private") and I need to filter out the 'Private' entities. However when I add a 'Where' clause to do this, the listener no longer adds newly posted entities from this collection. I do not know why this is happening, any help would be appreciated.
Here is the current query code:
And changing the query to:
var query = db.collection( k.mCollection ) .limit( to: limit ) .WhereField( "Privacy", in: ["Public", "Sub"] ) // this causes issue with listener .order( by: "PublishedAt", descending: true )
Maybe an explanation of how listeners work and any suggestions would be appreciated. Thanks.
RxFirebase version: 0.3.8