Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content

fix: lifecycleScope of the coroutine

Hasib Prince requested to merge 2267-fix_crash into main

Description

This MR should fix the crash reported in sentry. Here, We have fixed a lifecycle-related issue.

Screenshots

Technical details

ApplicationFragment used lifecyclescope instead of lifecyclescope of viewLifecycleowner. Here, the fragment's lifecycle is bigger than the view's lifecycle when the view may not be available. In this situation, If user moves to another fragment, there is a chance that the view can be accessed when the view is already destroyed.

So, we have used the lifecycle scope of viewLifecycleOwner so that the view can only be accessed when it is available. We have fixed same type of usage in other fragments as well.

Tests

Issues

backlog/-/issues/2267

10 commandments of code reviews

👪 https://gitlab.e.foundation/internal/wiki/-/wikis/mobile-team/guidelines/Code-review

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced lifecycle management of coroutines across multiple fragments to prevent potential memory leaks.
    • Updated coroutine launch contexts to align with the view's lifecycle, improving application robustness.

These changes ensure smoother performance and reliability when interacting with the app, particularly during view transitions.

Edited by CodeRabbitAI

Merge request reports

Loading