Skip to content

Show generic notification when Event cannot be resolved#4889

Merged
bmarty merged 10 commits intodevelopfrom
feature/bma/genericNotification
Jun 19, 2025
Merged

Show generic notification when Event cannot be resolved#4889
bmarty merged 10 commits intodevelopfrom
feature/bma/genericNotification

Conversation

@bmarty
Copy link
Copy Markdown
Member

@bmarty bmarty commented Jun 17, 2025

Content

Ensure that when a Push is received and the application is unable to resolve the Event (network error, etc.) the application still shows a notification to the user.

This PR also contain a few more commit around Push, can be reviewed commit per commit

Motivation and context

Less missed messages due to system blocking network request when the application is in background.

Screenshots / GIFs

Notification_fallback.mp4

Tests

  • Hard to repro the issue manually without patching the code.
  • Apply the patch : notifcationFallback.patch
  • Run the application
  • Receive a message
  • Observe the fallback notification
  • The battery optimization banner may also get displayed.

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner June 17, 2025 14:55
@bmarty bmarty requested review from jmartinesp and removed request for a team June 17, 2025 14:55
@bmarty bmarty added the PR-Change For updates to an existing feature label Jun 17, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 17, 2025

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/JUMkay

Copy link
Copy Markdown
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

<item quantity="other">"%d notifications"</item>
</plurals>
<string name="notification_fallback_content">"Notification"</string>
<string name="notification_fallback_content">"You have new message(s)."</string>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds a bit odd to me, maybe a native speaker could suggest some alternative?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me

Copy link
Copy Markdown
Contributor

@frebib frebib Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc WhatsApp says You may have new messages which is a less commited variant of the same thing

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mxandreas / @amshakal any suggestion for this wording? I agree that You may have new messages is probably a better option.

Copy link
Copy Markdown
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should display the battery optimisation banner in those cases

@bmarty
Copy link
Copy Markdown
Member Author

bmarty commented Jun 17, 2025

I don't think we should display the battery optimisation banner in those cases

With the fallback notification, we will never show the banner then?

@ganfra
Copy link
Copy Markdown
Member

ganfra commented Jun 18, 2025

I don't think we should display the battery optimisation banner in those cases

With the fallback notification, we will never show the banner then?

Is it displayed only once? If the user dismiss it, this won't be shown again on the next fallback notification? This is what I failed to see in the PR, but maybe it's already the case?

@bmarty
Copy link
Copy Markdown
Member Author

bmarty commented Jun 18, 2025

Ah OK, yes, it's shown only once. If the user dismiss it (or disable battery optimization) it will not be shown again. If the user clear the cache, it can be shown again (see this commit)

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 78.26087% with 10 lines in your changes missing coverage. Please review.

Project coverage is 80.30%. Comparing base (df33cf2) to head (3d8a641).
Report is 33 commits behind head on develop.

Files with missing lines Patch % Lines
...oid/libraries/push/impl/push/DefaultPushHandler.kt 42.85% 7 Missing and 1 partial ⚠️
...atrix/impl/notification/RustNotificationService.kt 95.23% 0 Missing and 1 partial ⚠️
.../push/impl/push/MutableBatteryOptimizationStore.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4889   +/-   ##
========================================
  Coverage    80.29%   80.30%           
========================================
  Files         2152     2152           
  Lines        57177    57216   +39     
  Branches      7199     7201    +2     
========================================
+ Hits         45913    45947   +34     
- Misses        8821     8826    +5     
  Partials      2443     2443           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link
Copy Markdown

@bmarty bmarty merged commit 911fba7 into develop Jun 19, 2025
29 of 31 checks passed
@bmarty bmarty deleted the feature/bma/genericNotification branch June 19, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR-Change For updates to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants