Skip to content

Commit

Permalink
Fix #6611 - Updated sentry log message to include more details for fa…
Browse files Browse the repository at this point in the history
…iling to start Leanplum (#6727)

- Added option in debug menu to reset ETP Constants and show cover sheet
  • Loading branch information
nbhasin2 committed Jun 3, 2020
1 parent 8dcaaf9 commit e58fe89
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Client/Application/LeanplumIntegration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class LeanPlumClient {
fileprivate func start() {
guard let settings = getSettings(), isLocaleSupported(), !Leanplum.hasStarted() else {
enabled = false
Sentry.shared.send(message: "LeanplumIntegration - Could not be started")
Sentry.shared.send(message: "LeanplumIntegration - Could not be started | Settings: \(String(describing: getSettings())) | isLocaleSupported: \(isLocaleSupported()) | Leanplum has not started: \(!Leanplum.hasStarted())")
log.error("LeanplumIntegration - Could not be started")
return
}
Expand Down
2 changes: 1 addition & 1 deletion Client/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class BrowserViewController: UIViewController {
var scrollController = TabScrollingController()

fileprivate var keyboardState: KeyboardState?
fileprivate var hasTriedToPresentETPAlready = false
var hasTriedToPresentETPAlready = false
var pendingToast: Toast? // A toast that might be waiting for BVC to appear before displaying
var downloadToast: DownloadToast? // A toast that is showing the combined download progress

Expand Down
21 changes: 21 additions & 0 deletions Client/Frontend/Settings/AppSettingsOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,27 @@ class SentryIDSetting: HiddenSetting {
}
}

class ShowEtpCoverSheet: HiddenSetting {
let profile: Profile

override var title: NSAttributedString? {
return NSAttributedString(string: NSLocalizedString("Debug: ETP Cover Sheet On", comment: "Debug option to show ETP Cover Sheet"), attributes: [NSAttributedString.Key.foregroundColor: UIColor.theme.tableView.rowText])
}

override init(settings: SettingsTableViewController) {
self.profile = settings.profile
super.init(settings: settings)
}

override func onClick(_ navigationController: UINavigationController?) {
BrowserViewController.foregroundBVC().hasTriedToPresentETPAlready = false
// ETP is shown when user opens app for 3rd time on clean install.
// Hence setting session to 2 (0,1,2) for 3rd install as it starts from 0 being 1st session
self.profile.prefs.setInt(2, forKey: PrefsKeys.KeyInstallSession)
self.profile.prefs.setString(ETPCoverSheetShowType.CleanInstall.rawValue, forKey: PrefsKeys.KeyETPCoverSheetShowType)
}
}

class ToggleOnboarding: HiddenSetting {
override var title: NSAttributedString? {
return NSAttributedString(string: NSLocalizedString("Debug: Toggle onboarding type", comment: "Debug option"), attributes: [NSAttributedString.Key.foregroundColor: UIColor.theme.tableView.rowText])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ class AppSettingsTableViewController: SettingsTableViewController {
SentryIDSetting(settings: self),
ChangeToChinaSetting(settings: self),
ToggleOnboarding(settings: self),
LeanplumStatus(settings: self)
LeanplumStatus(settings: self),
ShowEtpCoverSheet(settings: self)
])]

return settings
Expand Down

0 comments on commit e58fe89

Please sign in to comment.