-
-
Notifications
You must be signed in to change notification settings - Fork 926
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
added test for the ending of dependent streams #2030
Conversation
With some manual edits, so caveat emptor!
Also barfing out the response from the server when JSON parsing errors happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove package-lock.json
from this PR please, it's not necessary for the PR and adds noise.
stream/tests/test-stream.js
Outdated
@@ -273,6 +273,19 @@ o.spec("stream", function() { | |||
|
|||
stream.end(true) | |||
|
|||
o(spy.callCount).equals(1) | |||
}) | |||
o("end stream ends depndant streams", function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dependent
@eladzlot I'm not necessarily against this, but it clearly is a breaking change. The docs also say:
Nowhere does it say that the children will also be ended. Now this may be an oversight in the design—IIRC @lhorie mostly mirrored how flyd works—but he may also have had a reason in mind to do it the way it is... AFAICT A fix would be simple: replace those three lines with |
@pygy There are times you might not want to end the children (e.g. merging into other streams), but they're few and far between, and in pretty much all of them in my experience, you're better served just updating them manually. |
We could make this a non-breaking change (technically, a less breaking change :-)) by keeping the current behaviour for
|
Personally I'd be in favour of maintaining compatibility with flyd wherever possible so it could be used as a drop-in replacement. I don't know if the behaviour of |
It's not even defined anywhere in that spec, so there's nothing to address here. |
@spacejack As @isiahmeadows says, flyd's FL interop is just I'm personally in favor of this, I think ending a parent should end all children. |
Since streams have their own NPM package, we could make a breaking |
@StephanHoyer PR's outdated, but the behavior didn't change. |
Closing in favor of #2315. |
Description
Added a failing test for stream, where dependent streams fail to end.
Motivation and Context
The documentation states that the end stream is:
Turns out that currently it only unregisters these streams but does not end them.
The equivalent behavior in flyd works fine (as @spacejack kindly showed)
How Has This Been Tested?
This pull request adds a test that shows this.
Types of changes
Checklist:
docs/change-log.md