-
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(database,typescript): transaction update types #6782
fix(database,typescript): transaction update types #6782
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Codecov Report
@@ Coverage Diff @@
## main #6782 +/- ##
=============================================
- Coverage 72.22% 53.59% -18.62%
- Complexity 0 690 +690
=============================================
Files 119 218 +99
Lines 4855 10895 +6040
Branches 1083 1746 +663
=============================================
+ Hits 3506 5838 +2332
- Misses 1266 4739 +3473
- Partials 83 318 +235 |
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 |
This still needs a review! I'm behind, apologies |
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.
Sorry for the delay on this, it looks correct, thank you!
Description
There was an error in the type definition of transactions of the realtime database. When using transactions with non-object values like number or boolean, tsc threw an error
(TS2345: Argument of type '(data: object) => number' is not assignable to parameter of type '(currentData: object) => object'. Type 'number' is not assignable to type 'object'.)
. When comparing the type definition of react-native-firebase with the one of the official firebase documentation here: https://firebase.google.com/docs/reference/js/v8/firebase.database.Reference#transaction you can see the difference. I changed the type definitions accordingly.Related issues
Release Summary
fixed typedefinition for realtime database transactions
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
You can test the new type definition by creating a realtime database transaction with a non object type (like the example in the comment).
With the old definition, this will throw an error. With the new definition, this will work.
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter