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: Download fragment page is crashing. #3952

Closed
wants to merge 2 commits into from
Closed

Conversation

MohitMaliFtechiz
Copy link
Collaborator

@MohitMaliFtechiz MohitMaliFtechiz commented Jul 22, 2024

Fixes #3949

Thanks to @CalebKL for reproducing and fixing the issue.

@MohitMaliFtechiz MohitMaliFtechiz marked this pull request as draft July 22, 2024 16:39
@MohitMaliFtechiz MohitMaliFtechiz changed the title Fixes of Download fragment page is crashing. Fixed: Download fragment page is crashing. Jul 22, 2024
@CalebKL
Copy link
Contributor

CalebKL commented Jul 22, 2024

@MohitMaliDeveloper I have tested the the app with the above changes and it seems not to crash anymore. Since we are observing RxJavaUncaughtExceptionHandling.setup on the ZimManageViewModel init block, we would be able to prevent the crash when the viewmodel is alive. Although, I first thought it would be better to add it on the onCreate block when we start the application just incase we have any other rxjava's UndeliverableException that we might need to handle. But for now since its only affecting the ZimManageViewModel the solution would suffice.

You can also log the exception if you add this anywhere in the code.

  fun undeliverableException() {
    Observable.create { o ->
      o.onNext(1)
      o.onError(Exception("test"))
    }.take(1).subscribe { Log.d("ZimManageViewmodel", "---$it") }
  }

Run the app and cause the exception and observe the logs in the logcat

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 27.77778% with 13 lines in your changes missing coverage. Please review.

Project coverage is 53.23%. Comparing base (974c7d4) to head (895e564).

Files Patch % Lines
...kiwix/kiwixmobile/zimManager/ZimManageViewModel.kt 27.77% 13 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3952      +/-   ##
============================================
- Coverage     53.27%   53.23%   -0.04%     
- Complexity     1411     1413       +2     
============================================
  Files           303      303              
  Lines         11777    11795      +18     
  Branches       1568     1570       +2     
============================================
+ Hits           6274     6279       +5     
- Misses         4489     4501      +12     
- Partials       1014     1015       +1     

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

@MohitMaliFtechiz
Copy link
Collaborator Author

Duplicate of #3953

@MohitMaliFtechiz MohitMaliFtechiz marked this as a duplicate of #3953 Jul 23, 2024
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.

Crash loading the Download Fragment page
3 participants