ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.32k stars 4.17k forks source link

fixes stack overflow possibility with merge operators #2616

Open geoffmacd opened 1 month ago

geoffmacd commented 1 month ago

Fixes https://github.com/ReactiveX/RxSwift/issues/2615 See issue for details

when completing Merge operator iterations (concat(), concatMap() and merge(maxConcurrent:), fixes subscribing immediately to the next in the queue, which can produce values immediately which can re-enter and cause stack overflows. ultimately uses CurrentThreadScheduler and the isScheduleRequired prop to know if it needs to schedule or not. This is similar to Producer.

All tests pass

danielt1263 commented 1 month ago

This looks like a good candidate for a dot release @freak4pc. What do you think?