Skip to content

Release consumed Just values from nested subscriptions - #65

Merged
twittemb merged 1 commit into
mainfrom
codex/fix-flatmaplatest-retention
Oct 3, 2026
Merged

twittemb merged 1 commit into
mainfrom
codex/fix-flatmaplatest-retention

Conversation

@twittemb

@twittemb twittemb commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Removing a feature from the device's array could leave it retained by the consumed AsyncJustSequence iterator inside an active nested flatMapLatest subscription. The iterator now clears its stored value when consumed or cancelled, while iterator copies continue sharing one consumption state.

Adds the issue's nested subscription regression: the removed feature deallocates while its inner subject continues delivering values. Documents that array removal does not cancel a subscription and that the consuming task still needs an owner.

Validation: reproduced the regression before the fix; all 173 tests pass on Swift 6.4/macOS. Existing unused throwing-task warnings remain in unrelated tests.

Fixes #35.

@twittemb
twittemb merged commit 01936be into main Oct 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Memory Leak issue with flatMapLatest having inner asyncSequence

1 participant