-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presence channel handler #25
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this? AWS doesnt return a standard HTTP gone exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed an update that responds to both exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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