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

no call notification when using own ntfy server #8761

Open
warioishere opened this issue Feb 15, 2024 · 40 comments
Open

no call notification when using own ntfy server #8761

warioishere opened this issue Feb 15, 2024 · 40 comments
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@warioishere
Copy link

Steps to reproduce

Hello,

I am encountering an issue with call notifications not working when using a custom ntfy server. When selecting Google Push for notifications, both call notifications and the ringtone work as expected. However, switching to a custom ntfy server, the call notifications fail to come through, although message notifications continue to work without issue.

This problem persists across the following setup:

  • Matrix-synapse version: v1.101.0 (Latest)
  • Element version on smartphone: 1.6.10

Additionally, if relevant, a custom coturn server has been set up for handling phone and video calls.
Same problem on different phone. Had a p7 Pro with calyx + micro-G before, now having a P8Pro with GrapheneOS, same Problem again.

Could there be a compatibility issue with the custom ntfy server, or is there a specific configuration I might be missing to enable call notifications through it? Any guidance or suggestions on troubleshooting this issue would be greatly appreciated.

Thank you for your assistance.

Outcome

What did you expect?

Calling notification works on external ntfy server

What happened instead?

No ringing at all

Your phone model

Pixel 8 Pro

Operating system version

Android 14 GrapheneOS latest

Application version and app store

No response

Homeserver

f-Droid 1.6.10

Will you send logs?

Yes

Are you willing to provide a PR?

Yes

@warioishere warioishere added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Feb 15, 2024
@warioishere
Copy link
Author

Additional info. I've been talking to ntfy devs and we checked the server deployment of mine, they say my server setup is correct. They said I should reach out to the devs of element on android. Also, it doesnt work with the public ntfy.sh server.
Calls do not get a notfication, message notfications work fine.

Greetings

@p1gp1g
Copy link
Contributor

p1gp1g commented May 13, 2024

@warioishere
Copy link
Author

It may be related to this: https://matrix-org.github.io/synapse/latest/usage/configuration/config_documentation.html#ip_range_whitelist

thanks, just tried this. Added my own push server to the whitelisted IP adresses.

Still not luck. Element on Desktop Linux works, it rings. Phone doesnt want to ring when using own push server.

Sad no one of the devs answers me on this.

@p1gp1g
Copy link
Contributor

p1gp1g commented May 14, 2024

#7069 (comment) follow those steps

@warioishere
Copy link
Author

warioishere commented May 14, 2024

Again, I am not having problems receiving notifications at all. Messages notifications do arrive. Also the Push Test on element is sucessful. They only thing i missed was the IP whitelisting, but still, the notifications worked because of some firewall settings I have.

The only thing that doesnt work, are call notifications. I dont get notification if someone calls me. Nothing happens, only if I open the app, the call rings. If the app is closed. No ringing, allthough Element passes the Push test, and message notifications do arrive.

I checked those steps you linked to me, but no sucess.

@p1gp1g
Copy link
Contributor

p1gp1g commented May 14, 2024

  1. Have you disabled battery optimization for Element ?
  2. Have you disabled any kind of notification in Android settings ?
  3. Can you get some logs using ADB:
    1. Set Element in the background
    2. Send a message to this client
    3. Start a call

@warioishere
Copy link
Author

  1. Have you disabled battery optimization for Element ?

    1. Have you disabled any kind of notification in Android settings ?

    2. Can you get some logs using ADB:

      1. Set Element in the background
      2. Send a message to this client
      3. Start a call
  1. Bat Optimization is off for ntfy
  2. No, didnt disable any kind of notification on Android
  3. If your would tell me what to do, I can provide logs, I have ADB installed, but need some short instructions if you have time :)

@p1gp1g
Copy link
Contributor

p1gp1g commented May 14, 2024

  1. I was talking about battery optimization for Element.
  2. Please check, I've already seen someone who thought nothing were changed but the notification channel was mute
  3. Of course, here you are: PID=$(adb shell pidof im.vector.app) && adb logcat --pid $PID

@warioishere
Copy link
Author

  1. I was talking about battery optimization for Element.

    1. Please check, I've already seen someone who thought nothing were changed but the notification channel was mute

    2. Of course, here you are: PID=$(adb shell pidof im.vector.app) && adb logcat --pid $PID

what do you mean by channel notifications? All notifications on Android settings notification wise are allowed for the app. Also i get loud notfication on messages.

I will check battery optimiztions on element later. Just curious why I should disable it as it didnt read anything about disabling bat optimizations when own push servers are used.

Using googles push services makes the phone ring. Also on battery optimization activated on element.

Ill check the logs on element later or tomorrow with my gf

thanks in advance :)

@maximushugus
Copy link

I confirm I have the same issue as @warioishere
I have a very similar configuration with self hosted Synapse server, with self hosted ntfy server.
I also get normal messages notification, but no call notification on my phone without google services, relying on unified push for notifications.

I have to verify but it looks as if other users on my Synapse server wich are using Android with google notification also gets messages notifications but not call notification

@maximushugus
Copy link

maximushugus commented May 19, 2024

Looks similar to #8428 and #7135

@warioishere
Copy link
Author

I can just tell that the matrix server can reach the ntfy server and everytime I get a message server, I get this on my matrix logs:

2024-05-19 14:47:47,711 - synapse.push.httppusher - 236 - INFO - httppush.process-293 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upuTdBfWrtUslO?up=1 starting at stream_ordering 1317362

when someone calls me, there is no log like this. I didnt check the element logs yet, sorry

@maximushugus
Copy link

Here is what I tried : in element by default in the general notification settings, "messages sent by robots" is disable. I enabled it, I will see if this resolve the problem

@p1gp1g
Copy link
Contributor

p1gp1g commented May 20, 2024

I can just tell that the matrix server can reach the ntfy server and everytime I get a message server, I get this on my matrix logs:

2024-05-19 14:47:47,711 - synapse.push.httppusher - 236 - INFO - httppush.process-293 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upuTdBfWrtUslO?up=1 starting at stream_ordering 1317362

when someone calls me, there is no log like this. I didnt check the element logs yet, sorry

That's interesting, can you try your exact same setup with an account on matrix.org ? There might be something with synapse then

@warioishere
Copy link
Author

That's interesting, can you try your exact same setup with an account on matrix.org ? There might be something with synapse then

yes, I'll try later. I can imagine that its actually a synapse problem, because it doesnt work n schildichat too, although its a fork I guess and it could have a similar issue.

Will let you know

@warioishere
Copy link
Author

I can just tell that the matrix server can reach the ntfy server and everytime I get a message server, I get this on my matrix logs:

2024-05-19 14:47:47,711 - synapse.push.httppusher - 236 - INFO - httppush.process-293 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upuTdBfWrtUslO?up=1 starting at stream_ordering 1317362

when someone calls me, there is no log like this. I didnt check the element logs yet, sorry

That's interesting, can you try your exact same setup with an account on matrix.org ? There might be something with synapse then

sorry for this late answer. Tested on matrix.org with my own ntfy server. It works instantly. Getting Call notification.
I it looks like its my matrix instance. But I dont know what to check for or change in homeserver.yml
Do you you have any hint on that?

@warioishere
Copy link
Author

Additional Info: we are using our own coturn server. Are there things or additional configs needed to be done there?

@warioishere
Copy link
Author

warioishere commented Jun 5, 2024

Additional Info, we are using a Letsencrypt Certificate from letsencrypt for the coturn server, there was once a coturn tester for matrix instances, but I cant find it anymore. It said that time ago that the setup was functional. Now i read this again:

NB: If your TLS certificate was provided by Let's Encrypt, TLS/DTLS will not work with any Matrix client that uses Chromium's WebRTC library. This currently includes Element Android & iOS; for more details, see their [respective](https://github.com/element-hq/element-android/issues/1533) [issues](https://github.com/element-hq/element-ios/issues/2712) as well as the underlying [WebRTC issue](https://bugs.chromium.org/p/webrtc/issues/detail?id=11710). Consider using a ZeroSSL certificate for your TURN server as a working alternative.

Could be the issue?

@warioishere
Copy link
Author

I changed to ZeroSSL Certificates, now Element Crashes after Calling the phone with my own matrix-synapse instance:

osVersion: google/husky/husky:14/AP1A.240505.005/2024053100:user/release-keys
package: im.vector.app:40106142
process: im.vector.app
processUptime: 55946 + 249 ms
installer: org.fdroid.fdroid

java.lang.RuntimeException: Unable to start service im.vector.app.core.services.CallAndroidService@b58b5ec with Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5079)
	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:5035)
	at android.os.Parcel.readParcelable(Parcel.java:5017)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3186)
	at android.os.Parcel.createException(Parcel.java:3175)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.os.Parcel.readException(Parcel.java:3093)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6876)
	at android.app.Service.startForeground(Service.java:878)
	at androidx.work.impl.foreground.SystemForegroundService$Api29Impl$$ExternalSyntheticApiModelOutline0.m(R8$$SyntheticClass:1)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat(Service.kt:31)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat$default(Service.kt:6)
	at im.vector.app.core.services.CallAndroidService.handleUnexpectedState(CallAndroidService.kt:55)
	at im.vector.app.core.services.CallAndroidService.handleCallTerminated(CallAndroidService.kt:89)
	at im.vector.app.core.services.CallAndroidService.onStartCommand(CallAndroidService.kt:98)
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5061)
	... 11 more

@santilococo
Copy link

I changed to ZeroSSL Certificates, now Element Crashes after Calling the phone with my own matrix-synapse instance:

osVersion: google/husky/husky:14/AP1A.240505.005/2024053100:user/release-keys
package: im.vector.app:40106142
process: im.vector.app
processUptime: 55946 + 249 ms
installer: org.fdroid.fdroid

java.lang.RuntimeException: Unable to start service im.vector.app.core.services.CallAndroidService@b58b5ec with Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5079)
	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:5035)
	at android.os.Parcel.readParcelable(Parcel.java:5017)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3186)
	at android.os.Parcel.createException(Parcel.java:3175)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.os.Parcel.readException(Parcel.java:3093)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6876)
	at android.app.Service.startForeground(Service.java:878)
	at androidx.work.impl.foreground.SystemForegroundService$Api29Impl$$ExternalSyntheticApiModelOutline0.m(R8$$SyntheticClass:1)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat(Service.kt:31)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat$default(Service.kt:6)
	at im.vector.app.core.services.CallAndroidService.handleUnexpectedState(CallAndroidService.kt:55)
	at im.vector.app.core.services.CallAndroidService.handleCallTerminated(CallAndroidService.kt:89)
	at im.vector.app.core.services.CallAndroidService.onStartCommand(CallAndroidService.kt:98)
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5061)
	... 11 more

I am having the exact same problem. With background synchronization as the notification method, it works great (although not always instantly), but at least call notifications work sometimes. However, if I use ntfy, it crashes when an incoming call is received, throwing the exact same error as @warioishere described. I think this might be related to the fact that Element is trying to do something with foreground services, but it isn't allowed (since it is not using that method). I can help with debugging this if you think my theory might be correct.

@warioishere
Copy link
Author

warioishere commented Oct 6, 2024

I changed to ZeroSSL Certificates, now Element Crashes after Calling the phone with my own matrix-synapse instance:

osVersion: google/husky/husky:14/AP1A.240505.005/2024053100:user/release-keys
package: im.vector.app:40106142
process: im.vector.app
processUptime: 55946 + 249 ms
installer: org.fdroid.fdroid

java.lang.RuntimeException: Unable to start service im.vector.app.core.services.CallAndroidService@b58b5ec with Intent { act=im.vector.app.core.services.CallService.ACTION_CALL_TERMINATED cmp=im.vector.app/.core.services.CallAndroidService (has extras) }: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5079)
	at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2397)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loopOnce(Looper.java:232)
	at android.os.Looper.loop(Looper.java:317)
	at android.app.ActivityThread.main(ActivityThread.java:8532)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
	at com.android.internal.os.ExecInit.main(ExecInit.java:50)
	at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
	at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:359)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service im.vector.app/.core.services.CallAndroidService
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
	at android.os.Parcel.readParcelableInternal(Parcel.java:5035)
	at android.os.Parcel.readParcelable(Parcel.java:5017)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3186)
	at android.os.Parcel.createException(Parcel.java:3175)
	at android.os.Parcel.readException(Parcel.java:3151)
	at android.os.Parcel.readException(Parcel.java:3093)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6876)
	at android.app.Service.startForeground(Service.java:878)
	at androidx.work.impl.foreground.SystemForegroundService$Api29Impl$$ExternalSyntheticApiModelOutline0.m(R8$$SyntheticClass:1)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat(Service.kt:31)
	at im.vector.app.core.extensions.ServiceKt.startForegroundCompat$default(Service.kt:6)
	at im.vector.app.core.services.CallAndroidService.handleUnexpectedState(CallAndroidService.kt:55)
	at im.vector.app.core.services.CallAndroidService.handleCallTerminated(CallAndroidService.kt:89)
	at im.vector.app.core.services.CallAndroidService.onStartCommand(CallAndroidService.kt:98)
	at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:5061)
	... 11 more

I am having the exact same problem. With background synchronization as the notification method, it works great (although not always instantly), but at least call notifications work sometimes. However, if I use ntfy, it crashes when an incoming call is received, throwing the exact same error as @warioishere described. I think this might be related to the fact that Element is trying to do something with foreground services, but it isn't allowed (since it is not using that method). I can help with debugging this if you think my theory might be correct.

sorry to answer so late, but why does it work with googles fcm without a problem,
Nobody, absolute nobody from the devs are responding. they rather fix millions of issues, which I dont even realize that they are there, but fucking notfications with a own push provider they fucking dont care.

I talked to the devs of ntfy and they say, as far as the logs say, they cant do anything, the push server delivers the message to matrix-synapse properly, and also to the client instantly whenever a message is sent:

2024-10-06 10:09:07,417 - synapse.push.httppusher - 236 - INFO - httppush.process-8679 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,417 - synapse.push.httppusher - 236 - INFO - httppush.process-8680 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,419 - synapse.push.httppusher - 236 - INFO - httppush.process-8681 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,419 - synapse.push.httppusher - 236 - INFO - httppush.process-8678 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753670
2024-10-06 10:09:07,443 - synapse.http.client - 428 - INFO - httppush.process-8681 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:07,448 - synapse.http.client - 428 - INFO - httppush.process-8679 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:07,451 - synapse.http.client - 428 - INFO - httppush.process-8678 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:07,462 - synapse.http.client - 428 - INFO - httppush.process-8680 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:09:39,233 - synapse.push.httppusher - 236 - INFO - httppush.process-8682 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753689
2024-10-06 10:09:39,235 - synapse.push.httppusher - 236 - INFO - httppush.process-8684 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753689
2024-10-06 10:09:39,235 - synapse.push.httppusher - 236 - INFO - httppush.process-8683 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753689
2024-10-06 10:09:39,235 - synapse.push.httppusher - 236 - INFO - httppush.process-8685 - Processing 0 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,573 - synapse.push.httppusher - 236 - INFO - httppush.process-8689 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,574 - synapse.push.httppusher - 236 - INFO - httppush.process-8688 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,574 - synapse.push.httppusher - 236 - INFO - httppush.process-8687 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,574 - synapse.push.httppusher - 236 - INFO - httppush.process-8686 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753689
2024-10-06 10:11:17,608 - synapse.http.client - 428 - INFO - httppush.process-8686 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:17,611 - synapse.http.client - 428 - INFO - httppush.process-8688 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:17,615 - synapse.http.client - 428 - INFO - httppush.process-8687 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:17,627 - synapse.http.client - 428 - INFO - httppush.process-8689 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,056 - synapse.push.httppusher - 236 - INFO - httppush.process-8690 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upvnGFStGzxUfC?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,058 - synapse.push.httppusher - 236 - INFO - httppush.process-8691 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upRfmKVtd7pBP9?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,058 - synapse.push.httppusher - 236 - INFO - httppush.process-8693 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upY7KEE1gg3Xgx?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,059 - synapse.push.httppusher - 236 - INFO - httppush.process-8692 - Processing 1 unprocessed push actions for @marioyd:matrix.yourdevice.ch/im.vector.app.android/https://ntfy.yourdevice.ch/upOpna7Q1rvIi1?up=1 starting at stream_ordering 1753696
2024-10-06 10:11:18,071 - synapse.http.client - 428 - INFO - httppush.process-8690 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,074 - synapse.http.client - 428 - INFO - httppush.process-8691 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,079 - synapse.http.client - 428 - INFO - httppush.process-8692 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,090 - synapse.http.client - 428 - INFO - httppush.process-8693 - Received response to POST https://ntfy.yourdevice.ch/_matrix/push/v1/notify: 200
2024-10-06 10:11:18,293 - synapse.push.httppusher

@p1gp1g
Copy link
Contributor

p1gp1g commented Oct 8, 2024

If you have an exception android.app.ForegroundServiceStartNotAllowedException, this is because you need to set unrestricted battery use for element.

FCM don't have that issue because they use an option reserved for system applications (BroadcastOptions#setTemporaryAppAllowlist)

The good news is there is a way to do the same thing without this privilege. And it will be implemented in the next version of unifiedpush

@warioishere
Copy link
Author

If you have an exception android.app.ForegroundServiceStartNotAllowedException, this is because you need to set unrestricted battery use for element.

FCM don't have that issue because they use an option reserved for system applications (BroadcastOptions#setTemporaryAppAllowlist)

The good news is there is a way to do the same thing without this privilege. And it will be implemented in the next version of unifiedpush

Why does it work on matrix.org server then with my ntfy server and the same element version?
I get calling notification when on a matrix.org account but using my own ntfy server.

@p1gp1g
Copy link
Contributor

p1gp1g commented Oct 8, 2024

This is what this particular exception means.

@warioishere
Copy link
Author

This is what this particular exception means.

I still dont understand why it works on matrix.org Servers and not on my homeserver. What are people doing wrong, as I am not the only one with this kind of problems.

I don't need to set element for unlimited background to work with calling notifications with own ntfy server and an account on matrix.org

@p1gp1g
Copy link
Contributor

p1gp1g commented Oct 8, 2024

That's probably how you test it. You have 2 solutions: disable battery optimizations for element (which won't increase your battery consumption), or wait for the new version to be published and adopted by element.

@warioishere
Copy link
Author

That's probably how you test it. You have 2 solutions: disable battery optimizations for element (which won't increase your battery consumption), or wait for the new version to be published and adopted by element.

I dont want to question anything what you say, still I dont unterstand why i dont need to disable bat optimization for element when I use an matrix.org account.

I want to understand the matter, not just do some things which I don't understand.
Thanks for your time :)

@warioishere
Copy link
Author

And I just checked. Bat optimization was already deactivated for element

@p1gp1g
Copy link
Contributor

p1gp1g commented Oct 8, 2024

That's interesting. Can you double check you have "allow background usage" and "unrestricted" ? (The new android UI for that is terrible...)

There may be another issue behind the scene then

@warioishere
Copy link
Author

That's interesting. Can you double check you have "allow background usage" and "unrestricted" ? (The new android UI for that is terrible...)

There may be another issue behind the scene then

I double checked:

Screenshot_20241008-164608

Element is also not in the Battery Manager in restricted apps

@p1gp1g
Copy link
Contributor

p1gp1g commented Oct 8, 2024

You also have to click on the label "allow background usage" to check if it is optimized

@warioishere
Copy link
Author

warioishere commented Oct 8, 2024

You also have to click on the label "allow background usage" to check if it is optimized

okay, didnt know that, indeed terribly hidden... It was on optimized, something changed:

Now I get a notification for a call, but just a notfication, also now when the phone is screen off, but yea it doesnt ring. But with the matrix.org account on my other phone, with battery optimizations, I the phone rings normally when receiving a call.

Both phones have same OS and same element version using the same ntfy server (my own)

@warioishere
Copy link
Author

Additional info: still this huge delay of message notifications, up to 30min until a newly received messages is shown.

@warioishere
Copy link
Author

More Info: searched through the issues and found this guys which also had problems:

#7690

I installed element 1.5.28 and guess what? The phone is ringing also with my matrix server and my own ntfy server.
Calling function is just broke in current element version. Can anyone of the devs be tagged? I dont know who they are, or who is in charge for this. I know element is in maintenance mode, but its unbearable like this. Pls fix this issue which has been almost present for a year because there are people that dont wanna wait for element-x to arrive in a year with all functions, and propably broke too..

Pls pls pls fix this no calling notfications I would be so happy. We dont want to use googles push or downgrade to such an old version

@warioishere
Copy link
Author

more information:

element 1.5.28 can be in battery optimized mode, it still works. Doesnt need to be in unrestricted mode.

@warioishere
Copy link
Author

@p1gp1g I am waiting for what you have to say to that older element versions do still work, I see that you are also one of the contributors to element-android.

I really would love to know your opinion

But hey, my guess is, because I opened another issue where I gathered infos about that little research, and again, no one replies, that its actually not wanted that element works with self hostet push instances?

I mean man, that this topic is permantly ignored by whole element-hq just lets me think that, and nothing else, no other reason for that. It used to work, it could be changed back to when it worked, but its not done.

@warioishere
Copy link
Author

@p1gp1g I know you are propably busy, but can you share your opinion on that? I am running and hosting a whole matrix ecosystem with seperate coturn server since over two years now, and trying to push matrix in switzerland hard, but what everyone hates is, that calling notification do not work, which makes people like not really happy with matrix, and then they switch back to their usual behavior using whatsapp/telegram and co, thats what we want to prevent.

@warioishere
Copy link
Author

sorry but did you read my messages? I did that, and all I get on normal element is a message notification (for a call), and not a ringing notification. I just get a messages notfication only once and then nothing anymore when someone is calling.

I was asking your friendlly, why this element version from the past, as I stated here:

#8761 (comment)

makes element/the phone ring when somebody calls. I dont need to even give unrestricted network permissions on that old version. It rings as it should. Even in optimized mode.

Again, do that: element-hq/element-x-android#3031 (comment)

For info:

* [Not receiving notifications on the F-Droid version with unified push element-x-android#3031 (comment)](https://github.com/element-hq/element-x-android/issues/3031#issuecomment-2451420774)

* [Not receiving notifications on the F-Droid version with unified push element-x-android#3031 (comment)](https://github.com/element-hq/element-x-android/issues/3031#issuecomment-2451422699)

@warioishere
Copy link
Author

warioishere commented Nov 5, 2024

@p1gp1g just another testing, I upgrade on my testing phone from element 1.5.28, to 1.5.30 and thats the version where issues started to arrise: calling notifications stops working.

I can make you a video if you dont believe.

Version 1.5.28 works with ringing notification even in optimized battery mode.
From 1.5.30 on, you need it to have unrestricted mode for it not to crash, and then only in unrestricted mode, it receives a ringing notification.
Version 1.5.3.2 the same behavior - only unrestricked mode works with a ringing notification it rings until you take the call
Version 1.6.0 doesnt work anymore, no calling ringing notification even in unrestricted mode. this is the version where you started to get no more ringing, but just a single notification once. Again, its in unrestricted mode.

You know, everything I wanna do is just help, and this calling issue is a really issue, I am not dreaming, everyone here that uses ntfy and our server with coturn has the same issue. I am not making this up, if its working on 1.5.28 just completly normaly, why not reverting back to that state in the topic of how notification works?

I am not a coder, just a systemadmin. Again, I dont want to bother, but its essential that we have a working calling notification. And thats just not the case.

I spend another hour now on testing and giving you information, i dont know how much time I already spend on finding out whats the problem, we even reinstalled our infrastructed, reinstalled coturn, our own ntfy server because people told me I propably have setup problems, but I dont. ntfy server is whitelisted on the homeserver.yml. the Firewalls are not the problem, neither certificates or wrong settings on the coturn server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

4 participants