Skip to content

fix: delay before updating unread messages badge (WPB-23126)#4557

Open
sbakhtiarov wants to merge 2 commits intodevelopfrom
fix/unread-badge-update
Open

fix: delay before updating unread messages badge (WPB-23126)#4557
sbakhtiarov wants to merge 2 commits intodevelopfrom
fix/unread-badge-update

Conversation

@sbakhtiarov
Copy link
Contributor

@sbakhtiarov sbakhtiarov commented Feb 2, 2026

https://wearezeta.atlassian.net/browse/WPB-23126

https://wearezeta.atlassian.net/browse/WPB-23126

Issue:

Unread messages badge is not removed instantly when user closes a conversation after reading all messages.

Cause:

The app relies on UpdateConversationReadDateUseCase which has a 3-second debounce. If the user closes the conversation before debounce completes, the badge persists until the delayed update finishes.

Solution:

  • Inject and call MarkConversationAsReadLocallyUseCase when leaving the conversation to immediately update the local read date
  • Use DisposableEffect to handle all exit scenarios (back button, system gestures, navigation, etc.)
  • Track the last read timestamp in MessageComposerViewModel and flush it on conversation close

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.48%. Comparing base (2d0e494) to head (df3228e).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4557      +/-   ##
===========================================
+ Coverage    48.46%   48.48%   +0.02%     
===========================================
  Files          575      575              
  Lines        19825    19831       +6     
  Branches      3315     3316       +1     
===========================================
+ Hits          9608     9616       +8     
+ Misses        9202     9200       -2     
  Partials      1015     1015              
Files with missing lines Coverage Δ
...conversations/composer/MessageComposerViewModel.kt 75.26% <100.00%> (+4.00%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2d0e494...df3228e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants