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

No notifications when background data disabled

Open twouters opened this issue 7 months ago • 3 comments

Steps to reproduce

  1. Disable background data
  2. Lock device (not sure if this is a required step)
  3. Wait for push notification
  4. No notification pops up

Outcome

What did you expect?

I expected a notification

What happened instead?

I did not get a notification, but Push history shows the following:

Unable to resolve event: msg=error sending request for url (...), details=SdkError(Http(Reqwest(reqwest::Error { kind: Request, url: "...", source: hyper_util::client::legacy::Error(Connect, ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: No address associated with hostname" })) })))
- Idle: false
- Power Saving Mode: false
- Ignoring Battery Optimizations: false
- Device Light Idle Mode: false
- Low Power Standy Enabled: false
- Exempt from Low Power Standby: true

Your phone model

No response

Operating system version

No response

Application version and app store

25.04.3 Play Store

Homeserver

No response

Will you send logs?

No

Are you willing to provide a PR?

No

twouters avatar May 06 '25 09:05 twouters

Do not disable background data? On some device, it's also possible to add exception for applications allowed to use data when in the background.

For privacy reason, the Push data received from Firebase / UnifiedPush provider does not contain the message content, but only ids. The application needs to retrieve the content from the homeserver to be able to render the notification, and to do so perform a network request.

bmarty avatar May 06 '25 13:05 bmarty

Sure, but Element could still notify me that it got an incomplete push instead of failing/ignoring pushes silently? I suppose the same happens if the application can't reach the matrix server for another reason (upstream dns or network issues or whatever), in which case the user is also missing notifications.

twouters avatar May 06 '25 14:05 twouters

I've been wondering for some time now, why I'm getting unreliable Notifications with Element X but not with Element, until I saw in the push history that there are DNS Errors. I checked my Background Data Settings after reading this, and it was turned off on my Pixel, even though I've never changed that setting.

I'd say for a non-technical User that's something pretty hard to find in a case where it's not enabled by default.

jannis3005 avatar May 08 '25 06:05 jannis3005