Don't cache the notification proxy service #25
Merged
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.
When we execute awaitNotification and there is no response we will wait to
receive something from the notification proxy service socket. If we execute it
again while we are waiting the response from the first call we will start
waiting for response on the same socket. If only one response comes in the
socket one of the calls will get it and the other one will continue
waiting. To avoid this we should not cache the notification proxy service
(the socket). This way each call will start new service and wait for response
on different socket.
We had problems on some devices when we start new service for every call
before we started to use the ios-device-lib. That's why we want to disable
the cache only for the notification service proxy.
Tests with 500 postNotification invocations:
There is also a workaround which will not fix the problem but it will make
it harder to reproduce. We can implement timeout in receive_message method
and this way we will wait for response only for 1 second for example. The bug
will appear only if we execute awaitNotification two times in 1 second.