Bug
What is the current behavior?
Browser tab hangs and crashes with this connect function, where propertyId is a number.
firebaseConnect(({ propertyId }) => [`/analyses/${propertyId}`])
Steps
{ analyses: { 123: {}, 456: {} }analyses/123, as a function that returns an array with a single string containing a number segment.What is the expected behavior?
The data should be fetched.
Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?
Latest Chrome
Mac OS Sierra
react ^15.5.4
redux ^3.6.0
react-redux ^5.0.6
firebase ^4.2.0
react-redux-firebase 2.0.0-beta.8`
After shooting in the dark for a while, I find this works if a string is returned rather than array of strings:
firebaseConnect(({ propertyId }) => `/analyses/${propertyId}`)
@levithomason Will try to replicate, thanks for reporting. Is that not the same issue mentioned in #228 ?
No sir, that issue was that a path ending in a number caused the fetched data to be an array of that size. I fixed the issue related to _.set with number path segments in #248.
In this case, if I return an array of strings in firebaseConnect it crashes, but it works if I return a string only.
This might be related to lodash magic, but the crux is whether or not an array is returned in the firebaseConnect callback.
@levithomason I see now, I didn't read the example closely enough the first time around.
This does seem unexpected, firebaseConnect usually expects an array of queries. What about if you do an array of objects instead of strings?
I will try to get some more detailed info here and perhaps a small repro. I'm getting another crash when changing the propertyId prop after the first load. This is code smell that something else could be involved. Will let you know as soon as I find out.
After refactoring, I'm unable to reproduce this. I'm not sure what the issue was exactly. One possibility could be related to connecting to paths that include undefined in the pathname. I was using auth.uid in some cases before it was initialized.
Closing for housekeeping.
@levithomason Thanks for the update. Great to know.