Differential D307387
Bug 2048202 - Update HomeFragment.initStoriesState to use safe component access and prevent potential lifecycle-related crash AcceptedPublic Authored by sfamisa on Wed, Jun 17, 6:45 PM. Referenced Files None Subscribers
Details
Diff Detail
Event Timelinesfamisa created this revision.Wed, Jun 17, 6:45 PM phab-bot published this revision for review.Wed, Jun 17, 6:46 PM phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)". phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)". phab-bot removed a project: secure-revision. sfamisa added inline comments.Wed, Jun 17, 6:50 PM
jdelorenzo accepted this revision.Wed, Jun 17, 6:53 PM jdelorenzo added a project: testing-exception-other (Please leave a comment explaining why) . jdelorenzo added a subscriber: jdelorenzo. Comment Actionsnot blocking for this fix - is it possible to reproduce this lifecycle condition with an ActivityScenario test or something like that, so we can have a test that catches this behavior in the future? testing-exception-other: this change safely guards against a crash, is unlikely to introduce side effects, and may not be easily testable with a unit test This revision is now accepted and ready to land.Wed, Jun 17, 6:53 PM jdelorenzo added inline comments.Wed, Jun 17, 6:54 PM
sfamisa added a comment.Wed, Jun 17, 7:02 PM Comment Actions
Good question! I tried, but it was incredibly tricky to reproduce. You have to be in such as state where we try to do JUST after the fragment gets destroyed. If we injected , I would have been able to advance the clock, while delaying the but it's pretty much impossible to test with the way our code is set up 😅 We could probably also solve it properly by moving things out to a lifecycle observer and injecting Settings, AppStore & pocket stories service (that was how I fixed a leak associated with the top sites in https://phabricator.services.mozilla.com/D246359. sfamisa added a comment.Wed, Jun 17, 7:12 PM Comment Actions
Revision Contents
Diff 1302792 | ||||||||||||||||||||||||||||||||||||||||||
