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: Play Store reported a crash error when closing the tabs. #3791

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Apr 16, 2024

Fixes #3790

This error was occurring due to the user frequently clicking the close icon of the same tab, in this situation first click closes the tab, and the second immediate click again triggers the closeTab function but recyclerView does not have the valid view for this position because it is in removing process so this makes this view invalid and recyclerView returns the -1 index for invalid views. So this was the reason for this issue, to address this issue we have added a check in our closeTab method if the incoming index is -1 then it will not execute the further code.

Issue Fix
CloseTabIssue.mp4
CloseTabFix.mp4
  • Enhanced the Tab closed snackBar behavior. Now, when the user clicks the UNDO button to restore a tab, we disable the snackBar's "UNDO" button to prevent subsequent clicks. This prevents the addition of multiple tabs if the UNDO button is clicked multiple times, as this type of restored tab leads to unexpected behavior see below video.
SnackbarMultipleClickIssue.mp4

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 52.91%. Comparing base (cf745d3) to head (40e86d0).

Files Patch % Lines
.../kiwix/kiwixmobile/core/main/CoreReaderFragment.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3791      +/-   ##
============================================
- Coverage     52.94%   52.91%   -0.03%     
  Complexity     1303     1303              
============================================
  Files           292      292              
  Lines         10999    11003       +4     
  Branches       1460     1461       +1     
============================================
- Hits           5823     5822       -1     
- Misses         4203     4209       +6     
+ Partials        973      972       -1     

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

* This error was occurring due to the user frequently clicking the close icon of the same tab, in this situation first click closes the tab, and the second immediate click again triggers the `closeTab` function but recyclerView does not have the valid view for this position because it is in removing process so this makes this view invalid and recyclerView returns the `-1` index for invalid views. So this was the reason for this issue, to address this issue we have added a check in our `closeTab` method if the incoming index is `-1` then it will not execute the further code.
…s the `UNDO` button to restore a tab, we disable the snackBar's "UNDO" button to prevent subsequent clicks. This prevents the addition of multiple tabs if the `UNDO` button is clicked multiple times, as this type of restored tab leads to unexpected behavior see below video.
@kelson42 kelson42 merged commit 236f695 into main Apr 17, 2024
9 of 10 checks passed
@kelson42 kelson42 deleted the Fix#3790 branch April 17, 2024 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.

Play Store reported a crash error when closing the tabs.
3 participants