element-x-android icon indicating copy to clipboard operation
element-x-android copied to clipboard

UnifiedPush not working with Conversations

Open blaueente opened this issue 1 year ago • 4 comments

Steps to reproduce

  1. Select "Conversations" as UnifiedPush provider
  2. Run notifications Troubleshoot tests

Outcome

What did you expect?

Working notifications (they work with other demo programs)

What happened instead?

Error
"Fail to check the gateway https://up.conversations.im/_matrix/push/v1/notify: HTTP 404 Not Found"

Apparently the URL for using conversations as a push gateway is wrong. Maybe it's the "_matrix"? or is "v1" a too old version? Anyway, testing with https://f-droid.org/packages/org.unifiedpush.example/ works.

Screenshot_20241001-130537

Your phone model

Pixe

Operating system version

Android 14 AP2A.240905.003.F1

Application version and app store

Element X Version 0.6.3 (from playstore)

Homeserver

matrix.org

Will you send logs?

Yes

Are you willing to provide a PR?

No

blaueente avatar Oct 01 '24 11:10 blaueente

This is because ntfy includes a matrix gateway (https://github.com/binwiederhier/ntfy/blob/630f2957deb670dcacfe0a338091d7561f176b9c/server/server_matrix.go#L16) that is, it receives calls to /_matrix/push/v1/notify and sends them out via UnifiedPush.

conversations (https://codeberg.org/iNPUTmice/up) does not contain a matrix push gateway, and that is needed for EXA. So it won't work. Either conversations' up needs to include a Matrix gateway, or the Matrix homeserver needs to be taught to directly speak to a UnifiedPush server.

The Matrix gateway is what is called the "push gateway" in the diagram at https://spec.matrix.org/latest/push-gateway-api/#overview

spaetz avatar Oct 01 '24 11:10 spaetz

conversations (https://codeberg.org/iNPUTmice/up) does not contain a matrix push gateway, and that is needed for EXA. So it won't work. Either conversations' up needs to include a Matrix gateway, or the Matrix homeserver needs to be taught to directly speak to a UnifiedPush server.

What is EXA? I see the same issue with NextPush, which works fine as a UnifiedPush provider with normal Element on android, so I'm confused why NextPush would need matrix-specific changes for ElementX to work?

amalon avatar Oct 03 '24 22:10 amalon

Looking at the code, it should fall back to use the standard matrix.org gateway if the UnifiedPush server does not provide one. Not sure what is happening there, I am not a developer myself. P.S. EXA is short for Element-x-android

spaetz avatar Oct 04 '24 05:10 spaetz

At some point this was working with EXA and NextPush but seem to have stopped.

ccgauvin94 avatar Oct 07 '24 02:10 ccgauvin94

I'm having this problem too. It started after I updated Element X to the most recent version.

herbsmn avatar Oct 15 '24 19:10 herbsmn

Looking at the code, it should fall back to use the standard matrix.org gateway if the UnifiedPush server does not provide one. Not sure what is happening there, I am not a developer myself.

https://github.com/element-hq/element-x-android/issues/3185 seems to request what you describe.

devurandom avatar Oct 31 '24 18:10 devurandom

The cause of this issue is that EAX now expect a self-hosted matrix push gateway and never fallback to a default one: https://github.com/element-hq/element-x-android/pull/3388 Reverting this should fix this issue

p1gp1g avatar Nov 01 '24 07:11 p1gp1g

I have a similar issue with the gCompat UP-Distributor (https://unifiedpush.org/users/distributors/fcm/): When I run Settings > Notifications > Troubleshoot, I get "https://fcm.distributor.unifiedpush.org/_matrix/push/v1/notify is not a Matrix gateway".

See-also: https://codeberg.org/UnifiedPush/fcm-distributor/issues/1

devurandom avatar Nov 04 '24 12:11 devurandom

Fixed in #4101

bmarty avatar Jan 02 '25 15:01 bmarty