Closed Bug 1220301 Opened 9 years ago Closed 9 years ago

Don't call beginTimedSyncs unless there's an account

Categories

(Firefox for iOS :: Sync, defect)

All
iOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: rnewman, Assigned: Gavin, Mentored)

Details

(Whiteboard: [good first bug][lang=swift])

Attachments

(1 file)

Right now we set up the timer unconditionally: func applicationDidBecomeActive() { self.backgrounded = false self.beginTimedSyncs() } and then we spam the log: 2015-10-30 14:06:26.024 [Warning] [Profile.swift:744] withSyncInputs(_:function:) > No account; can't sync. 2015-10-30 14:06:26.024 [Debug] [Profile.swift:805] syncOnTimer() > Timed history sync succeeded. Status: Not started: no account. 2015-10-30 14:21:26.053 [Debug] [Profile.swift:788] syncOnTimer() > Running timed logins sync. 2015-10-30 14:21:26.055 [Warning] [Profile.swift:744] withSyncInputs(_:function:) > No account; can't sync. 2015-10-30 14:21:26.055 [Debug] [Profile.swift:796] syncOnTimer() > Timed logins sync succeeded. Status: Not started: no account. 2015-10-30 14:21:26.056 [Debug] [Profile.swift:802] syncOnTimer() > Running timed history sync. 2015-10-30 14:21:26.056 [Warning] [Profile.swift:744] withSyncInputs(_:function:) > No account; can
Is it sufficient to put a guard let _ = self.profile.account else { return } before the beginTimedSyncs()?
I'd use guard self.profile.hasAccount() else { return } but yes, that's the idea! Note that we also need to add a call to beginTimedSyncs in BrowserSyncManager.onAddedAccount -- we would no longer be automatically running a timer before you sign in, so we'd need to start one when the account is added.
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #8699155 - Flags: review?(rnewman)
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: