Skip to content

Introduce PushHistoryService to store data about the received push #4573

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

Merged
merged 7 commits into from
Apr 11, 2025

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Apr 10, 2025

Content

Introduce PushHistoryService to store data about the received push
Add a push database to store the info about the push.

Motivation and context

Help diagnostic notification issues.

Screenshots / GIFs

Screen_recording_20250411_112024.mp4
image

Tests

  • Navigate to Settings / Notifications / Push history
  • Observe that each time a push is received, a new entry is added at the top of the list.

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 added the PR-Feature For a new feature label Apr 10, 2025
Copy link
Contributor

github-actions bot commented Apr 10, 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/ZEBWs5

Copy link

codecov bot commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 85.26316% with 56 lines in your changes missing coverage. Please review.

Project coverage is 80.10%. Comparing base (1dcd608) to head (93bf6a1).
Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
...ies/push/impl/history/DefaultPushHistoryService.kt 0.00% 13 Missing ⚠️
.../libraries/push/impl/store/DefaultPushDataStore.kt 0.00% 10 Missing ⚠️
...ibraries/push/impl/history/di/PushHistoryModule.kt 0.00% 9 Missing ⚠️
...aries/troubleshoot/impl/history/PushHistoryView.kt 93.45% 0 Missing and 7 partials ⚠️
...shoot/impl/history/DefaultPushHistoryEntryPoint.kt 0.00% 6 Missing ⚠️
...oid/libraries/push/impl/push/DefaultPushHandler.kt 91.66% 0 Missing and 4 partials ⚠️
.../android/libraries/push/impl/DefaultPushService.kt 50.00% 2 Missing ⚠️
...mpl/notifications/CallNotificationEventResolver.kt 60.00% 1 Missing and 1 partial ⚠️
.../libraries/push/impl/history/PushHistoryService.kt 97.43% 0 Missing and 1 partial ⚠️
...ications/DefaultOnMissedCallNotificationHandler.kt 0.00% 0 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4573      +/-   ##
===========================================
+ Coverage    80.08%   80.10%   +0.01%     
===========================================
  Files         2087     2098      +11     
  Lines        55121    55442     +321     
  Branches      6876     6896      +20     
===========================================
+ Hits         44144    44411     +267     
- Misses        8617     8659      +42     
- Partials      2360     2372      +12     

☔ 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.

@bmarty bmarty added the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 10, 2025
@github-actions github-actions bot removed the Record-Screenshots Runs the 'Record Screenshots' CI job and adds a commit with any new screenshots found. label Apr 10, 2025
ElementBot and others added 4 commits April 10, 2025 16:48
Was: w: /libraries/troubleshoot/impl/src/test/kotlin/io/element/android/libraries/troubleshoot/impl/history/PushHistoryPresenterTest.kt:35:27 Cannot access class 'PushProvider' in the expression type. While it may work, this case indicates a configuration mistake and can lead to avoidable compilation errors, so it may be forbidden soon. Check your module classpath for missing or conflicting dependencies.
Copy link

@bmarty bmarty marked this pull request as ready for review April 11, 2025 09:24
@bmarty bmarty requested a review from a team as a code owner April 11, 2025 09:24
@bmarty bmarty requested review from ganfra and removed request for a team April 11, 2025 09:24
Copy link
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.

Thanks for this, LGTM!

@bmarty bmarty merged commit c7f0566 into develop Apr 11, 2025
34 checks passed
@bmarty bmarty deleted the feature/bma/pushHistory branch April 11, 2025 10:56
@toger5
Copy link

toger5 commented Apr 11, 2025

Does this help in removing push notifications once you looked at the message in another client?

@bmarty
Copy link
Member Author

bmarty commented Apr 11, 2025

Does this help in removing push notifications once you looked at the message in another client?

Nope

@p1gp1g
Copy link

p1gp1g commented Apr 16, 2025

This feature is very helpful. I think it would help to be able to see the received data (JSON), especially when the push is "invalid push data". What do you think ?

I see number of them with UnifiedPush

@bmarty
Copy link
Member Author

bmarty commented Apr 16, 2025

Actually this is a bit misleading. Data are not invalid, it's just that this is a push with no EventId and no RoomId. I think these are push that are sent to update the read marker unread notification counter. The android application ignores them, but I think the iOS application uses them (at least the legacy one).

I'll update the wording a bit so that it's clearer.

@p1gp1g
Copy link

p1gp1g commented Apr 16, 2025

I see. I have observed this kind of error when receiving a message when I also had the web client opened. I only received the push notification with the error. Having the JSON would have help to be sure it was this kind of notification (then there might be something to look at server side)

@bmarty
Copy link
Member Author

bmarty commented Apr 16, 2025

This is how an ignored (Firebase) Push will now render in this screen:

image

@p1gp1g
Copy link

p1gp1g commented Apr 16, 2025

It looks good, I think it will be helpful

@bmarty
Copy link
Member Author

bmarty commented Apr 16, 2025

(updated and in review at #4601)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Feature For a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants