Skip to content

Conversation

@p1gp1g
Copy link
Contributor

@p1gp1g p1gp1g commented Nov 15, 2025

Content

This PR adds a few HTTP codes that imply the push server doesn't have any matrix gateway: it returns NoMatrixGateway instead of Error.

Fixes: #5723

Motivation and context

Autopush (Sunup push server) returns a 406 to the matrix gateway discovery request (GET to /_matrix/push/v1/notify), which is currently considered as a network error and therefore fallback to the stored push gateway if it exists or to the custom gateway *.

* It should fallback to the default gateway - but I'm opening another PR for this, in case there is a need I am not aware of

Tests

  • Install Sunup
  • Enable UnifiedPush and selection Sunup
  • Go to notification troubleshooting list
  • Observe the nonexistent gateway being used

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • 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
  • You've made a self review of your PR

Fix Push notifications with Mozilla's autopush that returns 406
@p1gp1g p1gp1g requested a review from a team as a code owner November 15, 2025 15:40
@p1gp1g p1gp1g requested review from jmartinesp and removed request for a team November 15, 2025 15:40
@github-actions
Copy link
Contributor

Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:

  • Your branch should be based on origin/develop, at least when it was created.
  • The title of the PR will be used for release notes, so it needs to describe the change visible to the user.
  • The test pass locally running ./gradlew test.
  • The code quality check suite pass locally running ./gradlew runQualityChecks.
  • If you modified anything related to the UI, including previews, you'll have to run the Record screenshots GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, it will prevent the CI from running temporarily, until you upload a new commit after that one. To do so, just pull the latest changes and push an empty commit.

@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Nov 15, 2025
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.

Thanks, this fixed my issues with using Sunup! @bmarty since you're the most knowledgeable around unified push, would you like to take a look too?

Copy link
Member

Choose a reason for hiding this comment

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

Super nitpick: since this isn't a constant, it should start with lower case. We can change this later though.

@jmartinesp
Copy link
Member

jmartinesp commented Nov 17, 2025

It seems like there are some unit tests to fix: https://github.com/element-hq/element-x-android/actions/runs/19391981774/job/55563077771?pr=5741

@p1gp1g
Copy link
Contributor Author

p1gp1g commented Nov 17, 2025

Oh yeah, I forgot to patch it

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.71%. Comparing base (e22c976) to head (241fcb0).
⚠️ Report is 183 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5741      +/-   ##
===========================================
- Coverage    79.71%   79.71%   -0.01%     
===========================================
  Files         2422     2422              
  Lines        65059    65066       +7     
  Branches      8303     8304       +1     
===========================================
+ Hits         51861    51865       +4     
- Misses       10225    10229       +4     
+ Partials      2973     2972       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@bmarty bmarty 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!

@jmartinesp jmartinesp enabled auto-merge (squash) November 17, 2025 12:34
@jmartinesp jmartinesp disabled auto-merge November 17, 2025 12:34
@jmartinesp jmartinesp merged commit c4dd960 into element-hq:develop Nov 17, 2025
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unified Push test fails with 406

3 participants