Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
fix: ensure synchronous command execution is lazy #1274
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
Synchronous commands execute their workload immediately upon a call to
What is the new behavior (if this is a feature change)?
Synchronous commands now require a subscription in order for their workload to execute.
The documentation clearly states that subscription is required before commands execute, and that is indeed how asynchronous commands work. So this change brings the code into line with the documentation.
Does this PR introduce a breaking change?
Technically, I suppose I'd have to say yes. However, the circumstances under which this would break someone are:
So anyone who does break isn't using the framework correctly and would be bitten if, for example, they tried the same thing with an asynchronous command. Also, if they're subscribed to
Please check if the PR fulfills these requirements
It's quite inconsistent alright, but to be fair, I always thought it was a design decision. Since the code in the command isn't asynchronous, there's not much reason to "subscribe" onto it. But that's an assumption on my part!
The reason I'm telling is because we currently do have (some) code that functions without the Subscribe part because we thought it was by design. And hastily upgrading RxUI would render those functions un-executed, maybe even without noticing. Since unit-testing platform-code is still a hassle it might very well go undetected. (Since the caller is often the View in the platform-code.)
I'm not saying this is a bad change, I'm all for consistency, but we need to make sure to inform users well of this.