You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, first of all, thanks for this magnificent library.
We have found an issue during the 'authorization_renewal_period'.
Summary
When the authorisation expires and, then, the authorisation is not valid, an on_unsuscribe event should be sent but our hook handler (our server) is not able to receive the request.
What we saw in the code
When the event of unsuscribing is happening and tries to send an http_post to the hook, there is an exception which is not handled: asyncio.CancelledError
What we did to fix it
We added a catch exception code block:
except asyncio.CancelledError:
log.exception('Task was cancelled')
What was the behaviour after the fix
In the first try to run the function, it throws an exception and the try-catch block avoids finishing the execution
As it has a retry functionality, in the second try, the http post is sent to the hook and the client correctly receives the message indicating the unsubscription.
Hello, first of all, thanks for this magnificent library.
We have found an issue during the 'authorization_renewal_period'.
Summary
When the authorisation expires and, then, the authorisation is not valid, an
on_unsuscribe
event should be sent but our hook handler (our server) is not able to receive the request.What we saw in the code
When the event of unsuscribing is happening and tries to send an http_post to the hook, there is an exception which is not handled:
asyncio.CancelledError
What we did to fix it
We added a catch exception code block:
What was the behaviour after the fix
In the first try to run the function, it throws an exception and the try-catch block avoids finishing the execution
As it has a retry functionality, in the second try, the http post is sent to the hook and the client correctly receives the message indicating the unsubscription.
Where we saw it
Line
socketshark/socketshark/utils.py
Line 95 in 063132b
Comes from:
socketshark/socketshark/subscription.py
Line 390 in 063132b
How to replicate the issue:
authorizer
andauthorization_renewal_period
E.g.
Wait until your subscription expires.
Then, when the authorization expires.
The
authorization_renewal_period
process should catch this expiration and start its process.Socketshark tries to send:
but as I mentioned before,
myhost
never receives the request due to theasyncio.CancelledError
not handled.The text was updated successfully, but these errors were encountered: