Conversation
member_added presence completed Presence channel logic
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25 +/- ##
============================================
- Coverage 45.30% 43.42% -1.89%
- Complexity 61 71 +10
============================================
Files 9 9
Lines 373 456 +83
Branches 14 14
============================================
+ Hits 169 198 +29
- Misses 196 250 +54
Partials 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Not sure how to test the presence channels, it fails when I try because of the authorization check |
src/ConnectionRepository.php
Outdated
| // GoneException: The connection with the provided id no longer exists. | ||
| if ($e->getAwsErrorCode() === 'GoneException') { | ||
| // GoneException: The connection with the provided id no longer exists. | ||
| if ($e->getStatusCode() === Response::HTTP_GONE) { |
There was a problem hiding this comment.
Did you test this? AWS doesnt return a standard HTTP gone exception.
There was a problem hiding this comment.
I actually had to change it because I was not getting the 'GoneException' but was getting the HTTP Gone exception instead. Maybe we should keep both cases?
There was a problem hiding this comment.
I've pushed an update that responds to both exceptions.
There was a problem hiding this comment.
So AWS does a real poor job on documenting this. Their Python and Java SDK's speak about a separate GoneException, not a HTTP exception: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/apigatewaymanagementapi.html#ApiGatewayManagementApi.Client.post_to_connection
This sets me to believe the error will just be 400 and the actual error is in the respone body. The SDK will map it to the approriate exception.
Is this really the case? I don't know. The string version doesnt seem to work so perhaps you are right.
Have to tested this behavior with an actual API? If so, I believe you and will be happy to merge.
Sorry for all the questions. But this has been a long standing issue, and really want to get it fixed for good ;)
There was a problem hiding this comment.
Yes, I was working directly with the AWS API Gateway when I made this change. It was the only way I could avoid errors when doing presence removals. I did update the PR to include both cases, in case there is a situation where the other one is necessary.
Finishes #23