Closed Bug 985868 Opened 10 years ago Closed 10 years ago

Sync notification repeatedly appears when offline

Categories

(Firefox :: Sync, defect)

31 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 31
Tracking Status
firefox29 --- wontfix
firefox30 - fixed
firefox31 --- fixed

People

(Reporter: ato, Assigned: markh)

References

Details

Attachments

(1 file)

On a machine without network access I repeatedly get a notification
about failing to sync.

The popup-at-the-bottom message reminding you to fix your sync setup
disappears when you click the X, but reappears after roughly 10
seconds:

“Sync has not been able to complete during the last 14 days.  Please
check your network settings.”

Whilst this message is annoying in the first place (yes, I know I'm
offline) making it not appear again for the duration of the user's
session seems a reasonable fix.
I've some thoughts around this, but would like to get some more context first.

* You say the machine is offline; is "work offline" selected, or is the problem simply that it's not been connected to a network for this period?

* Do you use this machine regularly?  ie, over the last 14 days, has it been used (roughly) daily?  Or has it only been used for a few of those 14 days?

* Do you expect this machine to come back online soon?  I guess I'm asking why sync is setup on this machine in the first place?  Or to put it another way, at what point do you consider it would be OK to start reporting there has been a prolonged interval without a sync succeeding for this machine?  Never? After a month?  (Note that this assumes you haven't explicitly set "work offline" - clearly in that case we shouldn't be complaining)

(Note I'm not challenging the premise - I'm trying to formulate some ideas for how to avoid anything annoying while also not leaving the user with the impression Sync is silently doing its thing when it isn't, and hasn't been for quite some time)
Flags: needinfo?(ato)
(In reply to Mark Hammond [:markh] from comment #1)
> * You say the machine is offline; is "work offline" selected, or is the
> problem simply that it's not been connected to a network for this period?

Work offline isn't selected.  This was a case of a laptop without internet
connectivity for a short period of time.

> * Do you use this machine regularly?  ie, over the last 14 days, has it been
> used (roughly) daily?  Or has it only been used for a few of those 14 days?

The machine is used occasionally, probably not a great deal over the past 14
days.  Should I be suspecting that I have an outdated nightly on it and upgrade
to see if the problem persists?

> * Do you expect this machine to come back online soon?  I guess I'm asking
> why sync is setup on this machine in the first place?  Or to put it another
> way, at what point do you consider it would be OK to start reporting there
> has been a prolonged interval without a sync succeeding for this machine? 
> Never? After a month?  (Note that this assumes you haven't explicitly set
> "work offline" - clearly in that case we shouldn't be complaining)

The machine comes online at home or in the office, so sync is needed.

> (Note I'm not challenging the premise - I'm trying to formulate some ideas
> for how to avoid anything annoying while also not leaving the user with the
> impression Sync is silently doing its thing when it isn't, and hasn't been
> for quite some time)

Okay, so the context is that I leave home with the laptop, open it at the
train station whilst waiting for the train where there's no connectivity, then
plugging it in again when I reach the office.
Flags: needinfo?(ato)
Thanks for the helpful update:

(In reply to Andreas Tolfsen (:ato) from comment #2)

> Should I be suspecting that I have an outdated nightly on it and
> upgrade to see if the problem persists?

Nope - I was just trying to get some insight into how this machine is used.  Current nightlies will have the same behaviour.

I'm going to keep this bug as simply "don't warn multiple times in the same session" and I opened bug 990809 for us to tweak the algorithm that decides when to initially show it.
This patch arranges for sync's errorHandler to only report a prolonged error once per application run.  The logic is in sync rather than in the Fx UI code as that UI code is per-window, so keeping a global flag is somewhat trickier.
Assignee: nobody → mhammond
Status: NEW → ASSIGNED
Attachment #8405172 - Flags: review?(rnewman)
An additional piece of historical context: part of the reason for warning in this circumstance *does* apply to this scenario.

It's trying to clue the user in to the fact that -- as the message says -- this machine isn't up to date, because Firefox hasn't been able to sync.

If you don't realize that you clicked "Work Offline" a while ago, for example, that's actually valuable information. Sync doesn't have any other UI channel to convey passive information, so instead it displays a (hostile, non-actionable) error.
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 8405172 [details] [diff] [review]
0001-Bug-985868-only-report-prolonged-sync-errors-once-pe.patch

Review of attachment 8405172 [details] [diff] [review]:
-----------------------------------------------------------------

Such tests. Much correctness. Wow.

::: services/sync/modules/policies.js
@@ +506,5 @@
> +   * Flag that indicates if we have already reported a prolonged failure.
> +   * Once set, we don't report it again, meaning this error is only reported
> +   * one per run.
> +   */
> +  reportedProlongedError: false,

didReport…

@@ +782,5 @@
> +      if (!this.reportedProlongedError) {
> +        this._log.trace("shouldReportError: true (first prolonged sync failure).");
> +        this.reportedProlongedError = true;
> +        return true;
> +      }

Invert conditional.
Attachment #8405172 - Flags: review?(rnewman) → review+
https://hg.mozilla.org/mozilla-central/rev/a80a58607a35
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 31
Don't think we want to track this, but we might want to take the patch. Request approval?
Comment on attachment 8405172 [details] [diff] [review]
0001-Bug-985868-only-report-prolonged-sync-errors-once-pe.patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): FxA Sync
User impact if declined: User may be repeatedly nagged about sync not having completed recently
Testing completed (on m-c, etc.): Landed on m-c
Risk to taking this patch (and alternatives if risky): Low risk, limited to sync
String or IDL/UUID changes made by this patch: None
Attachment #8405172 - Flags: approval-mozilla-aurora?
Attachment #8405172 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Marking in-testsuite+ since this appears to have landed with tests. Please correct me if I am wrong.
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.