-
Notifications
You must be signed in to change notification settings - Fork 164
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
Fix push notifications for UnifiedPush distributors without provided matrix gateway #4040
base: develop
Are you sure you want to change the base?
Conversation
Fixes element-hq#3571 Co-authored-by: sim <[email protected]>
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
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.
Thanks for the change. I do not really like to provide the previous value as a parameter for UnifiedPushGatewayResolver.getGateway()
but I do not see any better solution. Returning String?
could be an alternative, but it may not fit all the needs.
UnifiedPushConfig.DEFAULT_PUSH_GATEWAY_HTTP_URL | ||
} | ||
} catch (exception: HttpException) { | ||
if (exception.code() == 404) { |
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.
Could use HttpURLConnection.HTTP_NOT_FOUND
.
I love that functionality, thanks for that. That having said, I agree with bmarty that passing in previousGateway feels really ugly. Returning None/Null/Empty string in the case where we want to use the previous gateway feels much better as in "don't change current value". That having said, I won't be able to provide patches so whatever is picked, I love it ❤️ |
Yeah agreed, passing |
OK, let's be pragmatic and merge those changes. There are 2 failing tests, can you handle that please? Else let me know, I can take the point
|
I probably can look at those again earliest next weekend. I had a quick look before but didn't see immediately what the appropriate fix for these two would be. So if you can fix them earlier that would be great, thanks! |
Fixes #3571
Content
We need to account for UnifiedPush distributors not providing a Matrix gateway, to properly use our fallback gateway.
To quote p1gp1g, we need to:
Motivation and context
Fixes #3571
Tests
Tested devices
NOTE: I only tested on SchildiChat Next
Checklist