Trying to figure out the best way to troubleshoot this issue.
I have a store called accessLogs. You can see my setup below.
I sync the store with a filter. The initial documents from that sync show the correct records properly filtered, however, records that come in after the initial load will be outside the scope of the query. To repeat in a different way. The store is filled with records where doc.projectId === params.projectId, but after that first load, future records do not respect this filter.
// first I clear the store and then I sync the records I want.
params$
.pipe(
untilDestroyed(this),
tap(() => this.accessLogStore.reset()),
switchMap((params) =>
this.accessLogsService.syncCollection(
(ref) => {
let query:
| firebase.firestore.CollectionReference
| firebase.firestore.Query = ref
.orderBy('scannedAt', 'desc')
.limit(100)
.where('projectId', '==', params.projectId);
return query;
},
{
reset: true,
}
)
)
)
.subscribe();
this.accessLogQuery
.selectAll()
.pipe(untilDestroyed(this))
.subscribe((logs) => {
this.lastUpdate = logs[0]
? logs[0].createdAt.seconds * 1000
: Date.now();
this.dataSource = logs;
});
Trying to figure out the best way to troubleshoot this issue.
I have a store called accessLogs. You can see my setup below.
I sync the store with a filter. The initial documents from that sync show the correct records properly filtered, however, records that come in after the initial load will be outside the scope of the query. To repeat in a different way. The store is filled with records where
doc.projectId === params.projectId
, but after that first load, future records do not respect this filter.