-
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
feat(firestore): V9 modular APIs #7235
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
f22c38e
to
1bf8ade
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7235 +/- ##
=============================================
- Coverage 68.91% 54.10% -14.80%
- Complexity 0 738 +738
=============================================
Files 137 247 +110
Lines 5708 12159 +6451
Branches 1224 1897 +673
=============================================
+ Hits 3933 6578 +2645
- Misses 1680 5235 +3555
- Partials 95 346 +251 |
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 15 days until this gets closed automatically |
1bf8ade
to
04472f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, @exaby73 👍 . I've provided some feedback!
Looks to have some lint errors from local test modifications checked in ? Hopefully a quick fix |
@exaby73 are you running these locally and they are passing?
|
@mikehardy Not all the time. I figured the tests are flaky which is why I'm rerunning it. I'm rerunning it locally now and trying to debug this |
the test was working just the order of returned data wasn't stable vs assertion expectations of stability, so added an orderBy clause
8173b2e
to
fa7424d
Compare
fa7424d
to
ac4a698
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - code coverage checks aside 👍
@russellwheatley I'm tracking the code coverage thing separately so I do not forget but it doesn't block this (and the previous ones) from going in --> #7328 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then - I didn't see anything on a couple scans so (gulp...) here we go!
@exaby73 this is an incredible work, seriously, one of the biggest PRs I've seen in years. Anyone using this package and it's v9 APIs over the years to come will owe you a debt of gratitude
* object with `next` and `error` callbacks. | ||
* | ||
* NOTE: Although an `onCompletion` callback can be provided, it will | ||
* never be called because the snapshot stream is never-ending. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does onCompletion()
not get called when the returned unsubscribe()
is called?
Or maybe it should be called then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting question! Honestly I'm not sure - you'd have to chase in to the native code I think and see what events are passed native<->javascript
Alternatively, if nothing is provided then it does seem reasonable to call onCompletion when unsubscribe happens, as by definition that would mean there will never be more events from that subscription...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm....not promising for Android: https://github.com/search?q=repo%3Afirebase%2Ffirebase-android-sdk%20oncompletion&type=code
Though apparently it is a bigger deal for iOS? https://github.com/search?q=repo%3Afirebase%2Ffirebase-ios-sdk+oncompletion&type=code
Or am I looking in the wrong place entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just looked more closely at the firebase-js-sdk documentation, which we generally treat as our authority here with regard to what behavior contract to meet for APIs, and it's pretty clear (and is the source of that comment I think):
https://firebase.google.com/docs/reference/js/firestore_.md#onsnapshot
NOTE: Although an onCompletion callback can be provided, it will never be called because the snapshot stream is never-ending.
I do not think we can call the onCompletion callback and meet the behavior contract of onSnapshot then, so I don't think this is a productive path to go down with regard to investigation. Sorry I started down it with you, if that meant you spent any significant amount of time on it
Description
Related issues
Release Summary
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter