fix: implement uploadBytes for storage modular sdk
Description
This PR implements the uploadBytes storage function for the modular SDK, one of several unimplemented methods mentioned in https://github.com/invertase/react-native-firebase/issues/7483.
Related issues
https://github.com/invertase/react-native-firebase/issues/7483
Release Summary
Adds missing storage.uploadBytes implementation
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]
Other(macOS, web)
- [x]
- My change includes tests;
- [ ]
e2etests added or updated inpackages/\*\*/e2e - [ ]
jesttests added or updated inpackages/\*\*/__tests__
- [ ]
- [ ] I have updated TypeScript types that are affected by my change. (N/A)
- This is a breaking change;
- [ ] Yes
- [x] No
Test Plan
No new tests, but all existing storage tests still pass. I would have mirrored any tests for uploadBytesResumable, but I didn't see any for that either.
Think react-native-firebase is great? Please consider supporting the project with any of the below:
- 👉 Star this repo on GitHub ⭐️
- 👉 Follow
React Native FirebaseandInvertaseon Twitter
🔥 My first PR here, LMK what you'd like to see different and I'm happy to make changes.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-native-firebase | Preview | Comment | Sep 13, 2025 6:13pm |
Can you write a test for this please?
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
It is nearly impossible to write automated tests for these storage upload/download methods because they run against an in-memory emulator on same host as the client, so there is insufficient delay (even with very large files) for a test to work.
I believe the only valid tests would work against cloud storage vs the emulator - which is possible now.
This is the entry point for our local tests:
https://github.com/invertase/react-native-firebase/blob/main/tests/local-tests/index.js
And if you run yarn tests:android:manual or yarn tests:ios:manual then use the little top menu of manual tests in the app once it starts, you can exercise something difficult to automate. If you do not put an emulator call in there it will go against the cloud storage, so in that way you could easily do a little test React Component that uploaded a file (then downloaded it and compared it I suppose) to make sure it was working.
None of the CI errors are related to this PR - if you rebase to current main in this repo there are a bunch of CI fixes that should see things go green
@johnsimeroth is attempting to deploy a commit to the Invertase Team on Vercel.
A member of the Team first needs to authorize it.
@mikehardy
The code seems reasonable - I assume this is working for you @johnsimeroth ?
Apologies for the delay! Looks like I need to sort out my github notification settings, I wasn't getting any of the responses here and I honestly forgot about this PR.
Yes, the code is the same that I added to my app, and it's been working as expected without issue.
It is nearly impossible to write automated tests for these storage upload/download methods because they run against an in-memory emulator on same host as the client, so there is insufficient delay (even with very large files) for a test to work.
I believe the only valid tests would work against cloud storage vs the emulator - which is possible now.
This is the entry point for our local tests:
https://github.com/invertase/react-native-firebase/blob/main/tests/local-tests/index.js
And if you run yarn tests:android:manual or yarn tests:ios:manual then use the little top menu of manual tests in the app once it starts, you can exercise something difficult to automate. If you do not put an emulator call in there it will go against the cloud storage, so in that way you could easily do a little test React Component that uploaded a file (then downloaded it and compared it I suppose) to make sure it was working.
That seems sensible - If you'd like to see that setup as part of this PR I can find some time next week to take a crack at it.
None of the CI errors are related to this PR - if you rebase to current main in this repo there are a bunch of CI fixes that should see things go green
In the interim, I've rebased as requested.