Netflix / falcor

A JavaScript library for efficient data fetching
http://netflix.github.io/falcor
Apache License 2.0
10.48k stars 446 forks source link

.batch resets maxRetries #915

Closed quantumew closed 6 years ago

quantumew commented 6 years ago

I would like to build a batching Falcor model with a non-default maxRetries. I do the following

const model = new falcor.Model({ maxRetries: 7, ... }).batch(..)

Unfortunately this resets my maxRetries back to the default 3 due to the call to this._clone, which then instantiates the model passing in this, maxRetries is mapped to this._maxRetries and thus gets reverted to the default.

Looks like the fix would be mapping options._maxRetries as well in the constructor but perhaps this is intentional.

Is this expected behavior? Seems wrong to me but perhaps I am overlooking something.

asyncanup commented 6 years ago

yeah that looks like a bug. will look into it and see what's going on

quantumew commented 6 years ago

v1.1.0 fixes this. Thanks!

quantumew commented 6 years ago

@asyncanup Just updated to v2.0.1 and it is great, except this issue has returned. Guessing the fix never got merged down. Didn't confirm that, just applied the same fix. See #932

quantumew commented 6 years ago

@asyncanup Thanks for the release!!

asyncanup commented 6 years ago

👍