Skip to content
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

Unified push endpoint: do not fallback to default endpoint in case of failure and add troubleshoot test. #3388

Merged
merged 8 commits into from
Sep 4, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Sep 4, 2024

Content

When the UnifiedPush endpoint is not detected as a valid Matrix gateway, the application was using a default endpoint.

Now, the endpoint is still checked, but is used even if it is not valid. This allow to use the provided endpoint even if an unexpected error occurs (network error, SSL certificat error, etc.)

A test is added to the troubleshoot test suite to check again the endpoint and alert the user in case of issue. For instance here, the test is failing:

image

The second commit is adding more unit test on the other troubleshoot tests.

Motivation and context

Make UnifiedPush solution work in more cases and environments.

Screenshots / GIFs

Tests

  • Configure notification to use UnifiedPush
  • Run troubleshoot test suite and see the new test.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner September 4, 2024 09:03
@bmarty bmarty requested review from jmartinesp and removed request for a team September 4, 2024 09:03
@bmarty bmarty added the PR-Misc For other changes label Sep 4, 2024
Copy link
Contributor

github-actions bot commented Sep 4, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/qd7NKn

Copy link

sonarcloud bot commented Sep 4, 2024

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.63%. Comparing base (ae3fd89) to head (90af83b).
Report is 17 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3388      +/-   ##
===========================================
+ Coverage    82.59%   82.63%   +0.04%     
===========================================
  Files         1693     1696       +3     
  Lines        39646    39690      +44     
  Branches      4822     4825       +3     
===========================================
+ Hits         32745    32798      +53     
+ Misses        5216     5207       -9     
  Partials      1685     1685              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 4, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 4, 2024
@bmarty bmarty merged commit 7254216 into develop Sep 4, 2024
29 checks passed
@bmarty bmarty deleted the feature/bma/pushEndpoint branch September 4, 2024 16:19
@p1gp1g
Copy link

p1gp1g commented Nov 1, 2024

Hi,
I was reading the code to understand why and I found the gateway resolver always return the custom gateway.

I was a bit surprised because only some provider have one. The matrix gateway and the discovery request is not part of the UnifiedPush specs, but we did it to help self-hosting the matrix gateway. Hopefully, the matrix gateway will not be required some time, when matrix will support web push pushkind (MSC4174)

For instance, Conversation.im is a known distributor that doesn't have any matrix gateway, and it seems someone opened an issue for that: #3571

In a second step, it may makes sense to move to matrix.org's gateway as a fallback (see #3185), and use sygnal's web push pusher. The new UnifiedPush's library generate web push keys and decrypt the push messages. That way it will make the transition to MSC4174 moving from kind=http to kind=webpush.

BTW, do you know how to advocate for MSCs ? MSC4173 would be very useful too.

PS: The new lib will also fix the error raised when EAX tries to start a foreground service from the background when it doesn't have the right to (#3031 (comment)) once supported by distributors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Misc For other changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants