Closed Bug 1061382 Opened 10 years ago Closed 4 years ago

If background syncs are disabled, Add to Firefox can never send a tab

Categories

(Firefox for Android Graveyard :: Overlays, defect)

All
Android
defect
Not set
normal

Tracking

(fennec+)

RESOLVED INCOMPLETE
Tracking Status
fennec + ---

People

(Reporter: rnewman, Unassigned, Mentored)

References

Details

You'll get "Send to another device" in the overlay. Tap it, and the log will show:

  E/GeckoSendTab( 7483): Not all provided GUIDs are real devices:
  E/GeckoSendTab( 7483): Invalid GUID: null

and the UI will say there was an error.

We need to force a sync of the clients engine regardless of the background sync setting.
This is a far from polished experience, so worth tracking, I think.
Mentor: rnewman, chriskitching, nalexander
tracking-fennec: --- → ?
Literally cannot be done with toggling the user's Android Sync setting which is Not Something That Should be Done.  I suggest we drive users to the Account Status page, where we message that Sync is not turned on and make it easy to toggle.  (As of Bug 983856.)
(In reply to Nick Alexander :nalexander from comment #2)
> Literally cannot be done with toggling the user's Android Sync setting which
> is Not Something That Should be Done.  I suggest we drive users to the
> Account Status page, where we message that Sync is not turned on and make it
> easy to toggle.  (As of Bug 983856.)

I just want to make sure we're talking about the same thing here.

On my phone I have my Android Sync enabled.

I have "Background Data" turned off, so nothing -- Gmail, email, Firefox Sync -- will sync until I hit the "Sync Now" widget.

In this mode, apps can still trigger their own syncs in response to user interaction. Gmail shows "Auto-sync turned off", but lets you pull to refresh. The built-in Android mail app, similarly.

In this situation we never fetch client records, which breaks the tab sending UI. I propose we do what Gmail does -- do a sync regardless of Background Data.

Am I misunderstanding some magic here?
(In reply to Richard Newman [:rnewman] from comment #3)
> (In reply to Nick Alexander :nalexander from comment #2)
> > Literally cannot be done with toggling the user's Android Sync setting which
> > is Not Something That Should be Done.  I suggest we drive users to the
> > Account Status page, where we message that Sync is not turned on and make it
> > easy to toggle.  (As of Bug 983856.)
> 
> I just want to make sure we're talking about the same thing here.
> 
> On my phone I have my Android Sync enabled.
> 
> I have "Background Data" turned off, so nothing -- Gmail, email, Firefox
> Sync -- will sync until I hit the "Sync Now" widget.
> 
> In this mode, apps can still trigger their own syncs in response to user
> interaction. Gmail shows "Auto-sync turned off", but lets you pull to
> refresh. The built-in Android mail app, similarly.

Is this actually triggering a sync?  I thought "BD off" => "no Sync whatsoever".  If FORCE_SYNC or some other flag is available, by all means we should force harder.

> 
> In this situation we never fetch client records, which breaks the tab
> sending UI. I propose we do what Gmail does -- do a sync regardless of
> Background Data.

Little chicken and egg, here: you need the client records before you send the tab.
(In reply to Nick Alexander :nalexander from comment #4)

> Is this actually triggering a sync?  I thought "BD off" => "no Sync
> whatsoever".  If FORCE_SYNC or some other flag is available, by all means we
> should force harder.

It looks that way (they're listed as real accounts in Accounts & sync).

> Little chicken and egg, here: you need the client records before you send
> the tab.

And also to pick which client to send to.
(In reply to Richard Newman [:rnewman] from comment #5)
> (In reply to Nick Alexander :nalexander from comment #4)
> 
> > Is this actually triggering a sync?  I thought "BD off" => "no Sync
> > whatsoever".  If FORCE_SYNC or some other flag is available, by all means we
> > should force harder.
> 
> It looks that way (they're listed as real accounts in Accounts & sync).

No, I mean does this actual do an OS level Sync, or does it upload data some other way?  (Even using the sync code, but not from a triggered OS level Sync.)  Bump the log levels for the Sync manager and see if it's really triggering a Sync?  Does the "last Synced" timestamp update?

> > Little chicken and egg, here: you need the client records before you send
> > the tab.
> 
> And also to pick which client to send to.

Right, that's what I meant.
I think we need to chat about what's possible and what's not.
tracking-fennec: ? → +
Flags: needinfo?(alam)
Trying to understand this from the user's perspective here. Let me know if I've missed anything please!

(In reply to Richard Newman [:rnewman] from comment #3)
> (In reply to Nick Alexander :nalexander from comment #2)
> > Literally cannot be done with toggling the user's Android Sync setting which
> > is Not Something That Should be Done.  I suggest we drive users to the
> > Account Status page, where we message that Sync is not turned on and make it
> > easy to toggle.  (As of Bug 983856.)

This sounds like it makes sense to me. As a user, they turned it off once upon a time but now they want to "send tab". There is a gap in that mental connection between those two actions ("I turned off background sync" and "I want to send a tab") that I think we need to bridge for them.

> I just want to make sure we're talking about the same thing here.
> 
> On my phone I have my Android Sync enabled.
> 
> I have "Background Data" turned off, so nothing -- Gmail, email, Firefox
> Sync -- will sync until I hit the "Sync Now" widget.
> 
> In this mode, apps can still trigger their own syncs in response to user
> interaction. Gmail shows "Auto-sync turned off", but lets you pull to
> refresh. The built-in Android mail app, similarly.

I think we do need to show some indicator of whether this "Background Sync" is on/off to the user so they realize there's a connection there.

(In reply to Nick Alexander :nalexander from comment #4)
> Is this actually triggering a sync?  I thought "BD off" => "no Sync
> whatsoever".  If FORCE_SYNC or some other flag is available, by all means we
> should force harder.

Do you mean we could have this "send tab" function "just work" if the user triggers it regardless of their background sync is on/off?
Flags: needinfo?(alam) → needinfo?(nalexander)
> Do you mean we could have this "send tab" function "just work" if the user
> triggers it regardless of their background sync is on/off?

We can make it work, Nick and I are just not sure how much effort it would take.

It might be that we can ask the OS to do a sync and "force harder". (A foreground sync, if you will.) In that case it's very little work.

It might be that we have to basically run a sync inside a service 'manually', because the OS scheduler won't let us. That's much more complicated.

My opinion is that if a user takes an action that's 'active' like this, it should occur immediately, even if it happens to be implemented as a SyncAdapter and background data is turned off.
I'd echo what rnewman said, and add that we could disable bits of the UI if we don't think we'll be able to Sync (right now, or ever).  We do special things to message this in the Sync status pane; we could add UI to show "Sync is set up but this won't work until you investigate" and take folks to the Sync status pane.
Flags: needinfo?(nalexander)
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.