Skip to content
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

fix(createEpicMiddleware): Don't share a scheduler queue with anyone else's RxJS code #625

Merged
merged 1 commit into from Mar 26, 2019

Conversation

@jayphelps
Copy link
Member

jayphelps commented Mar 21, 2019

fixes #624

Since we use the same queueScheduler that other people's app code might also use, we would get different behavior if the rootEpic is passed to epicMiddlweare.run(rootEpic) inside an already running queueScheduler task. Before this PR we incorrectly relief on the fact that almost always this wouldn't happen, but it can. If it does, redux-observable won't subscribe to the rootEpic soon enough--it'll be deferred until the current queue task returns, potentially missing actions.

RxJS doesn't currently publicly export QueueScheduler constructor nor QueueAction, so we reach in using arguably private APIs.

@benlesh this is doing naughty things, reaching into (currently) private APIs. If you have a moment to give this a quick once over, lmk if you have alternative suggestions. If no time, no worries.

…else's RxJS code, fixes #624
{ type: 'ACTION_4' }
]);

done();

This comment has been minimized.

Copy link
@jayphelps

jayphelps Mar 21, 2019

Author Member

This isn't really "async" in the sense of needing this done() but I prefer to have it regardless in case of later refactors later that do in fact introduce async that might cause the test to pass without actually making any assertions.

@BlackHole1

This comment has been minimized.

Copy link

BlackHole1 commented on src/createEpicMiddleware.js in d179d19 Mar 21, 2019

Add a line of comments: https://github.com/redux-observable/redux-observable/issues/624

@jayphelps jayphelps merged commit e5bae19 into master Mar 26, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@jayphelps

This comment has been minimized.

Copy link
Member Author

jayphelps commented Mar 26, 2019

Landed in v1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.