-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(afs): stateChanges and auditLog correctly emit metadata changes #2684
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Not sure where this belongs but filtering out empty arrays from |
Not emitting when collection is empty leads to lots of problem in our project too. |
Let me look at the special empty collection case here, I was just trying to make the APIs work consistently since it filters empty arrays if you specify any arguments. Perhaps now that I'm actually solving the blank array on metadata bug, the filtering of empty arrays is no longer needed. Thanks for giving me a heads up @luke-rogers @Benny739, I'll take a look on Monday. |
@luke-rogers @Benny739 just cut 6.1.3 should hit NPM shortly, thanks for the heads up. I considered this a bug even if you provided a filter 21442f0 |
@jamesdaniels in 6.1.2-4 stateChanges(['modified']) is returning an empty array followed by the entire collection of documents - exactly what I want to avoid. I only want to know about and be charged for reads to updated documents, not the entire collection. In 6.1.1 it returns just modified documents as expected, for which I'd hope we're not being charged for an entire collection read and subsequent client side filtering? Just checking, not familiar with the code. To summarize, returning an initial empty array is fine, just not the entire collection there after when listening for specific change types. I'll pin to 6.1.1 until this is resolved. ps. thanks for all your hard work! |
This firing is likely the metadata changing from As far as I'm aware, you should be only charged for actual updates. Not metadata. In the next minor I will consider an API addition that instead mark these updates as a new 'metadata-modified' event type or something similar. In the meantime I had to stop the bleeding on the aforementioned API failure. |
stateChanges
andauditLog
will show metadata updates correctly now, rather than just[]
snapshotChanges
uses same codepath asstateChanges
andauditLog
stateChanges
, even when no options provided