Do you want to request a feature or report a bug?
Feels like a bug but perhaps considered a feature going forward, since the breaking change is in Firebase, not RRF.
What is the current behavior?
Uploading a file and retrieving its downloadURL used to be done like this:
this.props.firebase.uploadFile(FILES_PATH, file)
.then((ret) => {
const { downloadURLs } = ret.uploadTaskSnapshot.metadata;
});
However, downloadURLs is no longer a property of uploadTaskSnapshot.metadata, as of Firebase version 5.x, and so in the example, downloadURLs is undefined.
What is the expected behavior?
It would be great if this property still returned. If not, perhaps a recipe for how to handle would be helpful.
Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?
Worked using: Firebase 4.13.1
Doesn't work using: Firebase 5.x
My react-redux-firebase version in both cases: 2.1.4
FWIW, this is how I am dealing with this now.
this.props.firebase.uploadFile(FILES_PATH, file)
.then(ret => ret.uploadTaskSnapshot.ref.getDownloadURL())
.then(url => console.log(url));
Believe this is a duplicate/related issue of #480, so I'm closing to keep info all in that ticket. Going to mention the working around noted by @harvitronix.
The fix, which is in this PR, does not include the download URL within the response if it doesn't exist. It seems to make more sense to do what @harvitronix has mentioned so that the resulting metadata is the same regardless of Firebase SDK version (instead of v5 not including download url).
It may need a config option in the future since all folks may not want it to happen by default, but I think it is good to keep the meta results the same. Thanks for posting!
Most helpful comment
FWIW, this is how I am dealing with this now.