Fix AsyncRx GroupByUntil double OnCompletedAsync bug by idg10 · Pull Request #2201 · dotnet/reactive
Fixes #2200
When the upstream source for a GroupByUntil completes, the GroupByUntil completes all current groups. However, it didn't remove those groups from the list of current groups as it did so, which meant that when those groups unsubscribed from their duration-defining observables, those duration-defining observables would in turn complete, which would then cause the GroupByUntil to try to complete these groups a second time (because the main OnCompletedAsync handling wasn't removing the groups from its list of current groups as it removed them).
This now removes groups from the list of current groups before calling OnCompletedAsync. (It already did this in the case where groups were removed because they expired. This change means it also does it in the case where they are being removed due to the whole operator shutting down.)