Repository navigation
Conversation
0e8a3c1 to
a804683
Compare
|
Thanks for this — the core fix is right, and mapping the optional through so the underlying One request before I merge: could you drop It rewrites the three race tests in Its version is also the stronger one: it sets Everything else in the PR is good to go. |
a804683 to
452b800
Compare
452b800 to
1db231a
Compare
|
@freak4pc Got it — looks like this was already being handled in the other PR. As requested, I dropped the test commit and rebased on main. Thanks for the review! |
|
The tests had been failing because of this, but the latest commit with the test changes passed: |
Closes #2730
Summary
subscribe(with:)always passed a weak error-forwarding closure to its underlying subscription, even when the caller omittedonErrororonFailure. That closure prevented unhandled terminal errors from reachingHooks.defaultErrorHandler.This change forwards an error closure only when the caller provides one. Without an explicit callback, the existing subscription implementation receives
niland invokesHooks.defaultErrorHandler.The behavior is aligned across
Observable,Single,Maybe, andCompletable.Root cause and impact
The object-based overload previously converted an optional error callback into a non-optional closure. When the callback was absent, the closure simply returned, but its presence still made the underlying subscription consider the error handled.
Explicit
onErrorandonFailurecallbacks retain their existing behavior, including their weak object capture. The only observable change is that an error without an explicit callback is now handled through the configured default hook, as with the corresponding non-object subscription overload.The test that customizes global hook state now restores that state after it finishes.
Validation
Hooks.defaultErrorHandler.ObservableSubscriptionTest,SingleTest,MaybeTest, andCompletableTestwith the macOSAllTests-macOSscheme.git diff --check.