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

errors with push notifications

Open Git-Forked opened this issue 6 months ago • 28 comments

Steps to reproduce

  1. Where are you starting? What can you see? -> Push History

note: Test notifications are always successful.

Errors Received:

  • Unable to resolve event. Push not handled.
  • Invalid or ignored push data: {"notification":"counts":{"unread":0)."id:"","sender":"type":null}}

Outcome

What did you expect?

Notifications are received without error.

What happened instead?

Very few are received, and most have error.

Your phone model

Samsung Galaxy

Operating system version

Android 10

Application version and app store

25.06.0

Homeserver

matrix.org

Will you send logs?

No

Are you willing to provide a PR?

No

Git-Forked avatar Jun 15 '25 05:06 Git-Forked

Hello, thanks for reporting. We have recently added a banner to suggest user to disable the battery optimization for the application when this happens. If battery optimization is disalbed, it will help to resolve more event when a Push is received, and so render the notification on the phone. Have you disabled the battery optimization for Element X?

bmarty avatar Jun 16 '25 07:06 bmarty

I am running the latest version, 25.06.02, with Element X battery usage set to unrestricted, and I don't get any notifications. I get notified for room invites, but not messages.

Checking the push history, notifications fail with "Unable to resolve event: no notification data"

This has been happening at least since May.

Image

Xinayder avatar Jun 17 '25 14:06 Xinayder

Did you try clearing the cache in elementx (not android). This has always worked for me after version upgrades.

Also making sure the ntfy is in battery unrestricted mode.

I am running the latest version, 25.06.02, with Element X battery usage set to unrestricted, and I don't get any notifications. I get notified for room invites, but not messages.

Checking the push history, notifications fail with "Unable to resolve event: no notification data"

This has been happening at least since May.

Image

escix avatar Jun 18 '25 00:06 escix

@escix I don't use ntfy, as you can see from the log it's using FCM. And clearing cache doesn't change the result, I still cannot get notified by new messages, only very rarely.

Xinayder avatar Jun 18 '25 14:06 Xinayder

I'm also seeing these since yesterday, might be related. I tried upgrading Synapse and my self-hosted ntfy server but no luck. Also switching to Firebase, but same issue. All notifications in the log show this pattern:

22 June 2025 at 10:33
No sessionId
No roomId
No eventId
[Deferred] Invalid or ignored push data

then:

22 June 2025 at 10:33
No sessionId
No roomId
No eventId
Invalid or ignored push data: 
{ "notification": {"counts":
{"unread":0},"id":"", "sender":"", "type": null}}

Sometimes there's a longer json with a pushkey and a default_payload, but sender and type are always empty and null.

TheSunCat avatar Jun 22 '25 09:06 TheSunCat

Problem is back for me too. Synapse 1.132.0, Element X for Android v25.06.3 (from play store). Tested with different users (and devices) on same synapse instance. Currently not receiving any notifications at all.

Synapse log shows POSTs of the devices so I guess the connection/pushing is working and data is received but not processed or invalid. Would it be possible to enable more debugging for this? Its really hard to convince people to join or use Element when issues like this persist.

BTW: There are multiple issues around the same problem now, maybe its a good idea to consolidate?

1848 avatar Jun 30 '25 18:06 1848

I'm also getting the errors in the original post for some push events. It seems like notifications are working fine, but they're not automatically being cleared when read in another client. With the Element app, when a message was read in another client the notifications automatically disappeared on my phone, but that is not the case here.

These errors could be those push events not being handled.

Eminent-Entropy avatar Jun 30 '25 21:06 Eminent-Entropy

I'm also having issues with receiving notifications through Ntfy or Firebase. This has been ongoing for a few months. I've tried older builds and the F-Droid version, but without success. On Element X, the Troubleshoot notifications feature shows all green. I've also deleted and recreated the ntfy topic. All battery management settings are set to Unrestricted.

When I send a test notification from the Ntfy web GUI or with Curl, I receive the notification on my phone within 1-3 seconds without any problems.

Server:

2025-07-13 23:10:20,872 - synapse.http.client - 442 - INFO - http_pusher.on_new_receipts-16 - Received response to POST https://ntfy.server.example/_matrix/push/v1/notify: 200

Client:

2025-07-13T23:10:20.786054Z  WARN elementx: [Push/VectorUnifiedPushMessagingReceiver] Invalid data received from UnifiedPush | 

Ntfy:

{"notification":{"counts":{"unread":0},"devices":[{"app_id":"im.vector.app.android","data":{"default_payload":{"cs":"e454567b-a28d-4208-b090-dea48e28b1f0"},"format":"event_id_only"},"pushkey":"ntfy.server.example/XXXXXXXXXXXXXX?up=1","pushkey_ts":1752448215}],"id":"","sender":"","type":null}}
Image

These are somewhat similar issues: https://github.com/element-hq/element-x-android/issues/4826 https://github.com/element-hq/element-x-android/issues/4828

Knud3 avatar Jul 13 '25 23:07 Knud3

Surprisingly, today I've received most, if not all, notifications. However, there's still the same error alongside the delivered message.

Image

Also, how to prevent Synapse from sending notifications to outdated Ntfy channels? Unfortunately, all of my earlier test channels continue to receive unwanted messages as well.

Knud3 avatar Jul 14 '25 19:07 Knud3

Issue still persists on my end, on both SchildiChat and Element X. Element X keeps showing Unable to resolve event: showing fallback notification when I receive a psh notification, but the weirder thing is, all calls to my homeserver succeed with HTTP 200.

Sometimes I get the proper notification popup, but it's rare and I have no idea why it suddenly starts working - and it works only for one chat at a time.

EDIT: looking at the code that added the generic "You have new messages" popup, could it be that there's a race condition happening that the notification is queried before the app gets notice of the event on the room, thus it returns null? As a workaround, can't the app requery the event after it received the notification?

https://github.com/element-hq/element-x-android/pull/4889/files#diff-0bb813608da48524818c5d74fc27597666af6b449c5163d541a4de98b718e24fL46

Xinayder avatar Jul 16 '25 13:07 Xinayder

@Xinayder : we are going to tweak a bit the push history data to reflect a bit more what can make the fallback notification to appear :

  • event is missing in the sync
  • event can't be decrypted

In the meantime, what version of the app are you using, because we've made some fixes lately on the sdk side.

ganfra avatar Jul 18 '25 11:07 ganfra

v25.06.2

I keep updated with the latest version on F-Droid.

Git-Forked avatar Jul 18 '25 19:07 Git-Forked

It looks like the F-Droid version is behind multiple version, will this be updated soon?

Git-Forked avatar Jul 18 '25 19:07 Git-Forked

I will use Obtainium to keep updated.

Now using version: v25.07.1

Git-Forked avatar Jul 18 '25 19:07 Git-Forked

With the latest version I get some notifications, however, most still fail with one of the errors posted at the top.

All tests pass successfully, even the new loopback test.

Git-Forked avatar Jul 19 '25 02:07 Git-Forked

Notifications used to work for me until I tried the troubleshoot option (some months ago). After a while I tried it again and Element X started showing the generic "a message is available" notifications and some errors in the push history.

Since yesterday or so, I don't get any notifications at all, but push history shows "handled successfully but notification was filtered out". They shouldn't be filtered out, as far as I can tell.

lnicola avatar Jul 19 '25 17:07 lnicola

@lnicola - That might be #5052.

Susurrus avatar Jul 29 '25 17:07 Susurrus

I also haven’t received any notifications for a few months now. Seeing the same error messages as exemplified above. All the while all tests pass when clicking on “Troubleshoot notifications”.

iclanzan avatar Aug 15 '25 16:08 iclanzan

The generic push notification has appeared much often after I migrated from 25.6.3 to 25.8.3. Battery was left as optimised as before.

If possible, can the generic fallback notification be at least normal priority and not silent? I have missed lots of encrypted DM notifications only to find out it was silenced.

- Idle: true

- Power Save Mode: false

- Ignoring Battery Optimizations: false

- Device Light Idle Mode: false

- Low Power Standby Enabled: false

- Exempt from Low Power Standby: true

Kimiblock avatar Aug 26 '25 03:08 Kimiblock

For comparison, SchildiNext with Notification worker on seems to have better reliability. I'll spend more time observing.

Kimiblock avatar Aug 26 '25 10:08 Kimiblock

202505030 seems to be the last version that has working push notifications. It's surprising that such a big issue remains unresolved for three months..

drrossum avatar Aug 26 '25 10:08 drrossum

Indeed. All my contacts have the same issue, which makes Element close to unusable. Element/matrix has already had more than a decade time to mature. Basic issues like this should not be found anymore.

takiainen avatar Sep 08 '25 11:09 takiainen

Just an update, notifications started working again for me, about a week ago.

lnicola avatar Sep 08 '25 11:09 lnicola

Notifications don't work for me, last week included, and for the past 3 months or so. It's not that it's not working that blows my mind. It's the lack of investigations. At least visible on Github.

Jucgshu avatar Sep 08 '25 17:09 Jucgshu

Looks related to #3031

pheki avatar Sep 23 '25 02:09 pheki

Push Notifications started working again for me in version 2025.9.2. They had been broken since 2025.6.0.

Not sure if everyone's issues have been fixed, but I thank the devs for the attention!

drrossum avatar Oct 15 '25 12:10 drrossum

I haven't seen a change in notifications across any recent versions. I did however enable the WorkManager option in the Developer options and that improved things, but I still get generic notifications.

I also get the Invalid or ignored push data: {"notification":"counts":{"unread":0)."id:"","sender":"type":null}} as mentioned in the OP. I'm on mozilla.org and I get them effectively daily. I think this was a change recently, where SSS changes things so this is calculated locally after a pull notification so the server doesn't need to send this, right? If this is indeed related to a spec change, maybe instead of using the error icon and stating "invalid or ignored push data", this would be more clear as with an INFORMATION or WARNING icon and some text like "ignored due to spec change". This would prevent folks from posting here thinking it's a relevant error.

Susurrus avatar Oct 27 '25 17:10 Susurrus

The Invalid or ignored push data: {"notification":"counts":{"unread":0)."id:"","sender":"type":null}} displayed as an error is a bit too much on this developer screen. The content of this push has never been useful for Android but it was for iOS to update the app badge count. The same data was just sent to the 2 apps with no distinction.

Nothing is expected to be displayed to the Android end user from this push. It is just noise from the network. A coming release of Sygnal will stop sending it (https://github.com/element-hq/element-meta/issues/3014).

manuroe avatar Oct 30 '25 16:10 manuroe