Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

For #6832 - Fix various fragment not attached to a context crashes #10106

Merged
merged 1 commit into from
Apr 23, 2020

Conversation

ekager
Copy link
Contributor

@ekager ekager commented Apr 22, 2020

If you use lifecycleScope to launch, it will be canceled before the fragment's onDestroy(), which can be too late to touch views inside of the scope. We want to be using viewLifecycleScope for a tighter lifecycle.

See a list of the rare but numerous crashes I believe are tied to this issue:
https://sentry.prod.mozaws.net/operations/fenix-nightly/?query=is%3Aunresolved+attached+to+a+context&statsPeriod=14d

Pull Request checklist

  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Screenshots: This PR includes screenshots or GIFs of the changes made or an explanation of why it does not
  • Accessibility: The code in this PR follows accessibility best practices or does not include any user facing features. In addition, it includes a screenshot of a successful accessibility scan to ensure no new defects are added to the product.

After merge

  • Milestone: Make sure issues finished by this pull request are added to the milestone of the version currently in development.

To download an APK when reviewing a PR:

  1. click on Show All Checks,
  2. click Details next to "Taskcluster (pull_request)" after it appears and then finishes with a green checkmark,
  3. click on the "Fenix - assemble" task, then click "Run Artifacts".
  4. the APK links should be on the left side of the screen, named for each CPU architecture

@liuche
Copy link
Contributor

liuche commented Apr 22, 2020

Link these commits to #6832?

@ekager
Copy link
Contributor Author

ekager commented Apr 22, 2020

Not positive they will ALL be resolved, but will do!

@ekager ekager changed the title No issue - Fix various fragment not attached to a context crashes For #6832 - Fix various fragment not attached to a context crashes Apr 22, 2020
@codecov-io
Copy link

Codecov Report

Merging #10106 into master will decrease coverage by 0.08%.
The diff coverage is 4.68%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #10106      +/-   ##
============================================
- Coverage     19.28%   19.20%   -0.09%     
+ Complexity      532      531       -1     
============================================
  Files           340      340              
  Lines         13789    13790       +1     
  Branches       1846     1846              
============================================
- Hits           2659     2648      -11     
- Misses        10893    10904      +11     
- Partials        237      238       +1     
Impacted Files Coverage Δ Complexity Δ
...a/org/mozilla/fenix/addons/AddonDetailsFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...g/mozilla/fenix/addons/AddonsManagementFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/org/mozilla/fenix/browser/BaseBrowserFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../fenix/collections/CollectionCreationController.kt 50.90% <0.00%> (ø) 0.00 <0.00> (ø)
...la/fenix/collections/CollectionCreationFragment.kt 90.00% <ø> (-0.20%) 6.00 <0.00> (ø)
...nix/components/toolbar/BrowserToolbarController.kt 65.90% <ø> (ø) 0.00 <0.00> (ø)
...c/main/java/org/mozilla/fenix/home/HomeFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ozilla/fenix/library/bookmarks/BookmarkFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...y/bookmarks/addfolder/AddBookmarkFolderFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...nix/library/bookmarks/edit/EditBookmarkFragment.kt 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
... and 19 more

Continue to review full report at Codecov.

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

@ekager ekager requested a review from boek April 22, 2020 21:48
@ekager ekager merged commit c4e8336 into mozilla-mobile:master Apr 23, 2020
@ekager ekager deleted the lifecycle-view branch April 23, 2020 03:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants