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

Notifications not working: "Unable to get a notification data / Unable to resolve event $eventid"

Open frebib opened this issue 7 months ago • 9 comments

Steps to reproduce

Uncertain

Outcome

What did you expect?

Notifications. They've been working fine for months but suddenly stopped the other day.

What happened instead?

2025-06-05T08:25:27.259829Z  WARN elementx: [Push/VectorFirebaseMessagingService] New Firebase message. Priority: 1/1 |
2025-06-05T08:25:27.294408Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:78 | spans: get_notification{room_id="!piRDLorRSaVBdlbefn:nerdhouse.io" event_id="$H8IdXKef8sY5-Zih5CIhtU_CanF_ZlXeUTBnoAU7ql0"} > try_sliding_sync > sync_once{conn_id="notifications" } > send{request_id="REQ-168" method=POST uri="https://matrix.ecmp.network/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="733B"}
2025-06-05T08:25:27.369928Z DEBUG matrix_sdk::http_client: Got response | crates/matrix-sdk/src/http_client/mod.rs:214 | spans: get_notification{room_id="!piRDLorRSaVBdlbefn:nerdhouse.io" event_id="$H8IdXKef8sY5-Zih5CIhtU_CanF_ZlXeUTBnoAU7ql0"} > try_sliding_sync > sync_once{conn_id="notifications" } > send{request_id="REQ-168" method=POST uri="https://matrix.ecmp.network/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="733B" status=200 response_size="28.9k"}
2025-06-05T08:25:27.445722Z  WARN elementx: [Push/PushHandler] Unable to get a notification data
uniffi.matrix_sdk.InternalException: Unable to resolve event $H8IdXKef8sY5-Zih5CIhtU_CanF_ZlXeUTBnoAU7ql0
        at io.element.android.libraries.push.impl.notifications.DefaultNotifiableEventResolver.resolveEvent-1_PhezE(SourceFile:249)
        at io.element.android.libraries.push.impl.notifications.DefaultNotifiableEventResolver$resolveEvent$1.invokeSuspend(SourceFile:13)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:9)
        at kotlinx.coroutines.DispatchedTask.run(SourceFile:115)
        at android.os.Handler.handleCallback(Handler.java:991)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loopOnce(Looper.java:232)
        at android.os.Looper.loop(Looper.java:317)
        at android.app.ActivityThread.main(ActivityThread.java:8934)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
 |

Your phone model

Pixel 8 Pro

Operating system version

Android 15

Application version and app store

25.05.4 from the play store

Homeserver

ecmp.network; conduwuit (whatever the last/latest build is/was)

Will you send logs?

Yes

Are you willing to provide a PR?

No

frebib avatar Jun 05 '25 08:06 frebib

I'm not sure if this is the bug I sent from the app (some details aren't the same, I'm on an S23), but I can provide more details/logs if needed, as I'm experiencing this annoying bug

tmayoff avatar Jun 05 '25 12:06 tmayoff

I can't verify this, but my partner wasn't having the issue until recently. The only change is that she's now on 25.05.4. That's right about when it stopped working for me as well.

tmayoff avatar Jun 06 '25 14:06 tmayoff

Same here. Using the Play store version without custom notify. Just noticed today that I am having issues with someone else who has an account on my server. We are both missing notifications. Both using android element-x but I dont know which version he is using.

I found this related entry in my push history:

Image

1848 avatar Jun 07 '25 18:06 1848

I am having this issue in both Element X and SchildiChat Next (fork of Element X). I installed SchildiChat because notifications stopped working over a month ago on EX, but a few days after installing SchildiChat, I started having the same error as EX.

I think this seems to be a DNS error (based on #3031) and I get notifications from SchildiChat that connection timed out after 30s, but it doesn't tell me which address failed. Besides, because I don't receive notifications anymore, I need to manually open the app to sync messages, it's not doing it on the background.

On the other hand, notifications work just fine on EX in iOS.

Xinayder avatar Jun 11 '25 09:06 Xinayder

Update: After setting background usage from "optimized" to "unristricted", it seems the notifications are now (more) reliable (I did not perform any proper testing).

1848 avatar Jun 14 '25 08:06 1848

My battery setting is already set to unrestricted, I've not received a notification since at least June 4th

tmayoff avatar Jun 17 '25 00:06 tmayoff

I also have battery set to unrestricted and even then I don't get notifications for messages, or when I do, it's just random. But I have received 3 or 4 notifications in the past month. I wish there was more focus on this issue as it's really breaking UX.

Xinayder avatar Jun 17 '25 14:06 Xinayder

"Unrestricted Battery Use" is not recommended on Android. It will drain your battery more than necessary.

The recommended way is that the push notification receiver (GooglePlayServices) on reception of a push notification temporarily lifts the target app's battery restriction. This used to work up to version 202505030.apk.

drrossum avatar Jun 19 '25 11:06 drrossum

Since updating a couple of days ago, I'm now not receiving any notifications at all other than the new "You have new messages" silent notification. Battery optimisation is disabled and the notification push test works fine. I'm also on the same network as the homeserver at home so there's basically zero chance that my phone can't reach it. Furthermore it looks like from the logs that the network request succeeded? Is the issue that the response from the homeserver doesn't contain the event that EX needs?

2025-06-28T08:10:41.047542Z  WARN elementx: [Push/VectorFirebaseMessagingService] New Firebase message. Priority: 1/1 | 
2025-06-28T08:10:48.774767Z DEBUG matrix_sdk::http_client::native: Sending request num_attempt=1 | crates/matrix-sdk/src/http_client/native.rs:78 | spans: try_sliding_sync > sync_once{conn_id="notifications" } > send{request_id="REQ-769" method=POST uri="https://matrix.nerdhouse.io/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="783B"}
2025-06-28T08:10:48.961192Z DEBUG matrix_sdk::http_client: Got response | crates/matrix-sdk/src/http_client/mod.rs:214 | spans: try_sliding_sync > sync_once{conn_id="notifications" } > send{request_id="REQ-769" method=POST uri="https://matrix.nerdhouse.io/_matrix/client/unstable/org.matrix.simplified_msc3575/sync" request_size="783B" status=200 response_size="93.7k"}
2025-06-28T08:10:49.096295Z ERROR elementx: Could not retrieve event for notification with $ihYzpc4Nu8F5ulE_IiUq30-38tvTTsM5ICE2XZSuSY0 | 
2025-06-28T08:10:49.112535Z  WARN elementx: [Push/Notification/DefaultNotifiableEventResolver] Unable to resolve notification -> fallback | 

frebib avatar Jun 28 '25 08:06 frebib