Skip to content
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

Fixed: Duplicate resume/cancel buttons in download notification. #4239

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

MohitMaliFtechiz
Copy link
Collaborator

Fixes #4235

  • When there is a single download running, and we pause the download from the notification then we push a custom notification and update the foreground service notification. So when we are pushing our custom notification it is performing on the IO thread, and when we are setting it on the foreground service, then instead of updating the same notification it creates a new notification and shows it, and in the meantime, our pushing the cancel notification finishes and push a second notification. Due to the same notification ID, it updates the same notification but its actions(resume/cancel) are added twice.
  • We fixed it by synchronizing the process. Now, it first pushes the notification for paused download, and then if there is no other downloading going then it will set the current notification to foreground service.

Before Fix

BeforeFix.mp4

After Fix

AfterFix.mp4

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.50%. Comparing base (b025813) to head (765da6b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4239      +/-   ##
============================================
- Coverage     57.83%   57.50%   -0.34%     
+ Complexity     1597     1581      -16     
============================================
  Files           316      316              
  Lines         14063    14059       -4     
  Branches       1740     1740              
============================================
- Hits           8134     8085      -49     
- Misses         4731     4781      +50     
+ Partials       1198     1193       -5     

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

* When there is a single download running, and we pause the download from the notification then we push a custom notification and update the foreground service notification. So when we are pushing our custom notification it is performing on the IO thread, and when we are setting it on the foreground service, then instead of updating the same notification it creates a new notification and shows it, and in the meantime, our pushing the cancel notification finishes and push a second notification. Due to the same notification ID, it updates the same notification but its actions(resume/cancel) are added twice.
* We fixed it by synchronizing the process. Now, it first pushes the notification for paused download, and then if there is no other downloading going then it will set the current notification to foreground service.
@kelson42 kelson42 merged commit 9a82600 into main Feb 27, 2025
31 checks passed
@kelson42 kelson42 deleted the Fixes#4235 branch February 27, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notification with 2 resume buttons
3 participants