Fix in-flight being unable to track event requests made by cloned clients #1881
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.
Goal
The in-flight package was unable to track event requests made by cloned clients because the
_notify
monkey patch was not copied over to the clones. This is actually a good thing because the monkey patch holds onto a reference to the original client, so it would have been broken even if the clone got the patchI've added support for "on clone callbacks" in clone-client, which other packages can register to be notified when a client is cloned. The in-flight package can then register a callback to patch any new clones
This was only a problem for events as the session request tracking is done via the session delegate and this is copied straight onto the clone, so is shared by both clients