Skip to content

fix: message list paged lifecycle resulting in notifications being cleared#3815

Merged
jamesarich merged 4 commits into
meshtastic:mainfrom
mdecourcy:fix/messagelistpaged-lifecycle
Nov 26, 2025
Merged

fix: message list paged lifecycle resulting in notifications being cleared#3815
jamesarich merged 4 commits into
meshtastic:mainfrom
mdecourcy:fix/messagelistpaged-lifecycle

Conversation

@mdecourcy

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug where message notifications were being cleared after 3 seconds even when the app was backgrounded or the screen was locked. The unread debounce timer now only marks messages as read and clears notifications when the message thread is actually visible to the user. This was introduced during my pagination work.

Problem: When a user left a message thread open and locked their screen or backgrounded the app, incoming message notifications would automatically disappear after 3 seconds due to the unread debounce continuing to run in the background.

Solution: Added lifecycle awareness to the UpdateUnreadCountPaged composable. The debounce now:

  • Pauses when the screen is locked or app is backgrounded (ON_PAUSE)
  • Restarts fresh when the user returns to the screen (ON_RESUME)
  • Only clears notifications after 3 seconds of the message thread being actively visible

@mdecourcy mdecourcy marked this pull request as ready for review November 26, 2025 00:32
@jamesarich jamesarich enabled auto-merge November 26, 2025 00:50
@github-actions github-actions Bot added the bugfix PR tag label Nov 26, 2025
@jamesarich jamesarich added this pull request to the merge queue Nov 26, 2025
Merged via the queue into meshtastic:main with commit 07ade75 Nov 26, 2025
5 checks passed
@codecov

codecov Bot commented Nov 26, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.54%. Comparing base (6d0bd61) to head (55fd9ec).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...g/meshtastic/feature/messaging/MessageListPaged.kt 0.00% 26 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3815      +/-   ##
========================================
- Coverage   0.54%   0.54%   -0.01%     
========================================
  Files        386     386              
  Lines      22484   22494      +10     
  Branches    2820    2821       +1     
========================================
  Hits         122     122              
- Misses     22341   22351      +10     
  Partials      21      21              

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

@jamesarich jamesarich added this to the 2.7.8 milestone Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants