-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
bug(storage): issue uploadFile when using meta information #488
Comments
Good find. Feel free to open to a PR if you get a chance, otherwise I will try to get a fix out this weekend. |
Cool! I'm trying to figure out how this code works. It seems we're doing
So I don't understand the reasoning why we want to Is it because we want to be able to dispatch |
if I do It also seems that uploadRes returns downloadURL. :S
|
Yeah, glad you are finding the same thing. As mentioned in #487, that seems to be happening out of order and will need to be fixed. |
Thanks for all the work on this library - just started using it a couple weeks ago and it's amazing. I ran into the same problem described in #480 when trying to upload files, dug around a bit and ended up installing from the v3.0.0-alpha branch to get the latest code adding "ReferenceError: regeneratorRuntime is not defined" Seems like this can be fixed by installing babel/polyfill: babel/babel#5085 I installed that, and also updated the syntax of the arguments passed to
With these changes, the file upload works and successfully stores metadata to Firestore (including the download URL). Commit is here: Let me know if it is worth opening a PR, or if someone else is already addressing this. Thanks again! |
@jpierce42 Definitely worth making a PR, thanks for reaching out! We may want to make it against the Surprised to see the regeneratorRuntime issue popup since that should be handled by preset-env as mentioned in the issue you posted, which version of node are you using? Either way, we should address that as well. |
I was on node v8.11.4. I tried upgrading to 10.10.0 and saw the same error. I will dig a little deeper into the babel issue and see if I can find a better solution. In the mean time, opened a PR against |
Looks like the regeneratorRuntime error is also fixed if I add
Previously it was only referenced under the test environment. Is this preferable to manually installing and referencing babel/polyfill? Admittedly not a Babel expert. :) Let me know if so and I can update the PR. |
* fix(storage): uploadFile gets downloadURL before writing metadata - #487, #488 * fix(storage): add unit tests for `fileMetadataFactory` (config level) and `metadataFactory` (option for uploadFile) to confirm downloadURL is available before writing metadata - #487, #488 * fix(storage): fix downloadURL error in file upload metadata - @jpierce42 * fix(auth): `LOGOUT` action dispatch only include preserve parameter if provided in settings (not when undefined)
This was released in v2.2.0-alpha.2 with the PR from @jpierce42 and associated unit tests. @jpierce42 I found out that the transform-runtime was needed since I accidentally used |
* fix(storage): uploadFile gets downloadURL before writing metadata - #487, #488 * fix(storage): add unit tests for `fileMetadataFactory` (config level) and `metadataFactory` (option for uploadFile) to confirm downloadURL is available before writing metadata - #487, #488 * fix(storage): fix downloadURL error in file upload metadata - @jpierce42 * fix(auth): `LOGOUT` action dispatch only include preserve parameter if provided in settings (not when undefined) * fix(profile): profile update on login works with email login (used to require `createUser`) - #475 * feat(HOCs): optimize firestoreConnect unset / set listeners - @demoran23 * fix(HOCs): firestoreConnect no longer requires store.firebase (only attaches to props if available) * fix(auth): move detaching of profile listeners before `signOut` within `logout` method to fix `permission_denied` errors - #494 * fix(enhancer): support config already existing on store - [132 of redux-firestore](prescottprue/redux-firestore#132)
It seems we are making an assumption here that FireStore add and Database push resulting in the same returned value. But it seems Firestore returns a snapshot where's database push only returns an error if something went wrong.
react-redux-firebase/src/utils/storage.js
Line 140 in 51ce8db
I assume this also relates to the issues seen in #487.
The text was updated successfully, but these errors were encountered: