react-native-firebase
react-native-firebase copied to clipboard
feat(database): add support for get() method
Description
Supercedes #7149 - I don't have write access to that tree and it needs some lint fixes to merge, but otherwise is ✅ - all credit to @nahuelb
Related issues
Fixes #4411
Release Summary
squash with PR title as commit
Checklist
- I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] Yes
- My change supports the following platforms;
- [x]
Android
- [x]
iOS
- [x]
- My change includes tests;
- [x]
e2e
tests added or updated inpackages/\*\*/e2e
- [ ]
jest
tests added or updated inpackages/\*\*/__tests__
- [x]
- [x] I have updated TypeScript types that are affected by my change.
- This is a breaking change;
- [ ] Yes
- [x] No
Test Plan
Comes complete with e2e tests! 🤟
Think react-native-firebase
is great? Please consider supporting the project with any of the below:
- 👉 Star this repo on GitHub ⭐️
- 👉 Follow
React Native Firebase
andInvertase
on Twitter
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-native-firebase | ❌ Failed (Inspect) | Jun 5, 2023 5:41pm |
1 Ignored Deployment
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-native-firebase-next | ⬜️ Ignored (Inspect) | Jun 5, 2023 5:41pm |
The android CI failure appears to be a real failure related to the PR
https://github.com/invertase/react-native-firebase/actions/runs/5180171278/jobs/9333995832?pr=7165#step:19:1331
18:13:36.358 detox[43053] WARN: at e2e/init.js:41:15
⚠️ A test failed:
18:13:36.358 detox[43053] WARN: at e2e/init.js:42:15
️ -> errors if permission denied
18:13:36.358 detox[43053] WARN: at e2e/init.js:49:13
️ -> Retrying in 5 seconds ... (1)
18:13:41.573 detox[43053] WARN: at e2e/init.js:46:15
🔴 Retry #1 failed...
18:13:41.573 detox[43053] WARN: at e2e/init.js:49:13
️ -> Retrying in 10 seconds ... (2)
18:13:51.784 detox[43053] WARN: at e2e/init.js:46:15
🔴 Retry #2 failed...
18:13:51.785 detox[43053] WARN: at e2e/init.js:49:13
️ -> Retrying in 15 seconds ... (3)
18:14:07.173 detox[43053] WARN: at e2e/init.js:46:15
🔴 Retry #3 failed...
18:14:07.174 detox[43053] WARN: at e2e/init.js:49:13
️ -> Retrying in 20 seconds ... (4)
1) errors if permission denied
The android CI failure appears to be a real failure related to the PR
https://github.com/invertase/react-native-firebase/actions/runs/5180171278/jobs/9333995832?pr=7165#step:19:1331
18:13:36.358 detox[43053] WARN: at e2e/init.js:41:15 ⚠️ A test failed: 18:13:36.358 detox[43053] WARN: at e2e/init.js:42:15 ️ -> errors if permission denied 18:13:36.358 detox[43053] WARN: at e2e/init.js:49:13 ️ -> Retrying in 5 seconds ... (1) 18:13:41.573 detox[43053] WARN: at e2e/init.js:46:15 🔴 Retry #1 failed... 18:13:41.573 detox[43053] WARN: at e2e/init.js:49:13 ️ -> Retrying in 10 seconds ... (2) 18:13:51.784 detox[43053] WARN: at e2e/init.js:46:15 🔴 Retry #2 failed... 18:13:51.785 detox[43053] WARN: at e2e/init.js:49:13 ️ -> Retrying in 15 seconds ... (3) 18:14:07.173 detox[43053] WARN: at e2e/init.js:46:15 🔴 Retry #3 failed... 18:14:07.174 detox[43053] WARN: at e2e/init.js:49:13 ️ -> Retrying in 20 seconds ... (4) 1) errors if permission denied
I had no issues when running the tests locally 🤔 I can check it tomorrow @mikehardy
@mikehardy I did some digging today, and I am a bit stuck. 😞
It seems I only ran the e2e tests on iOS when I submitted the PR, my bad. I am having some trouble making the e2e android environment work, I will try again when I have some free time.
But I was able to get the same error in my project, when doing a bad .get
request I always got unknown
error code.
I updated this part of the code to be able to return the proper error code with something like this:
Exception e = task.getException();
DatabaseError error = DatabaseError.fromException(e);
rejectPromiseDatabaseException(
promise,
new UniversalDatabaseException(
error.getCode(), error.getMessage(), error.toException()));
But this way I always get the error code -11 UserCodeException
instead of -3 PermissionDenied
.
Do you know another way to get the proper firebase error code from the task exception? I don't have much experience working with Android code 🙏
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
Still hoping to help shepherd this one to merge but the summer has been busy
Codecov Report
Merging #7165 (f9be916) into main (95d014c) will increase coverage by
13.37%
. Report is 194 commits behind head on main. The diff coverage is57.15%
.
Additional details and impacted files
@@ Coverage Diff @@
## main #7165 +/- ##
=============================================
+ Coverage 53.93% 67.29% +13.37%
=============================================
Files 230 129 -101
Lines 11509 5692 -5817
Branches 1851 1343 -508
=============================================
- Hits 6206 3830 -2376
+ Misses 4959 1751 -3208
+ Partials 344 111 -233
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
Note that from a modular / firebase-js-sdk v9 API perspective I think this may be superceded by the v9 conversion PR as get()
is defined there: https://github.com/invertase/react-native-firebase/pull/7136/files?diff=unified&w=1#diff-f1acd77729eabe49ebe14ed78e0fe2a58fdf4f2b3e0266e52fea0b7d81e95a4cR46
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
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
Just needs the investigation then the likely close as I do believe it was superceded
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
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