Do not offer to restore tabs if no crash happened

RESOLVED FIXED

Status

()

Firefox for iOS
General
RESOLVED FIXED
3 months ago
3 months ago

People

(Reporter: st3fan, Assigned: st3fan)

Tracking

unspecified
Other
iOS

Firefox Tracking Flags

(fxios8.1+)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 months ago
Here is the thing: we started using Sentry to log database errors. Those events also have a stack trace attached. This all works as expected.

What we did not expect is that these 'user initiated crashes that do not terminate the application' are seen as regular crash reports.

So when we start up, and one of these reports is pending, SentryIntegration.crashedLastLaunch, which calls into KSCrash, returns true because it does not know better.

As a result we show the Restore Tabs dialog in cases where this was not needed.

This patch works around that by keeping track of a persistent flag in the UserDefaults that we use to find out if we succesfully went through app startup and clean backgrounding.

If we crash before we have a chance to update the flag in applicationDidEnterBackground(), we know with more certainty that we have to show the Restore Tabs dialog.
(Assignee)

Updated

3 months ago
Assignee: nobody → sarentz
tracking-fxios: --- → 8.1+
(Assignee)

Comment 1

3 months ago
Created attachment 8891439 [details] [review]
PR https://github.com/mozilla-mobile/firefox-ios/pull/2988

Lots of comments in the code.
Attachment #8891439 - Flags: review?(rnewman)
Attachment #8891439 - Flags: review?(jdarcangelo)
Attachment #8891439 - Flags: review?(jdarcangelo) → review+
(Assignee)

Comment 2

3 months ago
Landed on v8.x, moved to master.
See Also: → bug 1385217
(Assignee)

Updated

3 months ago
Status: NEW → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → FIXED
(Assignee)

Updated

3 months ago
Duplicate of this bug: 1385217
Attachment #8891439 - Flags: review?(rnewman) → review+
You need to log in before you can comment on or make changes to this bug.