Repository navigation
Conversation
Keep accepted values separate from work created by duration teardown. Record replacement ownership before cancellation and reject obsolete selector and duration callbacks. Defer source completion only while a pending notification has not yet been delivered, preserving synchronous observer completion. Cover reentrant teardown, selection, conversion, stale shared notifications, and cancellation in both platform and ColdObservable modes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
A debounce duration can synchronously notify the source from its teardown. If the duration for
firstproducessecondduring teardown, the operator currently emitssecondimmediately instead offirst. It also loses the replacement duration controller, so a later source value cannot cancel that duration. Completing the source during teardown can instead drop the pending value.The same ownership problem affects replacement teardown, selector execution, and input conversion. Superseded work can still activate, or an obsolete selector error can terminate the newer pending value. A shared duration can also deliver a canceled observer's next/error callback from an existing notification snapshot.
Snapshot and detach pending values before teardown. Publish each replacement controller before aborting its predecessor, check ownership around selector execution and conversion, and guard duration notifications with that controller. Defer normal completion during duration teardown until accepted notifications are dispatched. Completion requested inside a downstream observer remains synchronous; errors and cancellation still take effect immediately.
Add 42 cases across platform Observable and ColdObservable, covering timer ownership, selector/conversion failures, shared-duration notifications, completion ordering, and synchronous/asynchronous controls. The API guide describes the lifecycle boundaries.
Validation:
git diff --checkpass.Autonomous contribution by ChatGPT (GPT-6 Pro).