You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While theSubscription is not cancelled, Subscription.request(long n) MUST signal onError with a java.lang.IllegalArgumentException if the argument is <= 0. The cause message MUST include a reference to this rule and/or quote the full rule.
Current implementation of RxJava v2 seems to violate this rule in two places:
Signal with IllegalArgumentException is delivered to the RxJavaPlugins.onError() and not the Subscriber.onError().
Cause message does not include reference to the rule nor quotes it.
Test:
@TestpublicvoidillegalRequestShouldReferenceRuleOrQuoteIt() {
TestSubscriber<Integer> ts = TestSubscriber.create(0);
Flowable.just(1).subscribe(ts);
ts.request(-1);
Stringcause = ts.errors().get(0).getMessage();
assertTrue(cause.contains("3.9") || cause.contains("While the Subscription is not cancelled, Subscription.request(long n) MUST signal onError with a java.lang.IllegalArgumentException if the argument is <= 0. The cause message MUST include a reference to this rule and/or quote the full rule. The intent of this rule is to prevent faulty implementations to proceed operation without any exceptions being raised. Requesting a negative or 0 number of elements, since requests are additive, most likely to be the result of an erroneous calculation on the behalf of the Subscriber."));
}
I can open two separate PRs to fix these violations if issue will be approved.
The text was updated successfully, but these errors were encountered:
Aha, I see, so when we use RxJava v2 specific Subscriber types — 3.9 is relaxed, but if Reactive Streams Subscriber subscribes — these rules are not violated.
Rule 3.9 of Reactive Streams:
Current implementation of RxJava v2 seems to violate this rule in two places:
IllegalArgumentException
is delivered to theRxJavaPlugins.onError()
and not theSubscriber.onError()
.Tests:
Test:
I can open two separate PRs to fix these violations if issue will be approved.
The text was updated successfully, but these errors were encountered: