Closed Bug 1227843 Opened 9 years ago Closed 9 years ago

Support Chinese Sync and Firefox Account service endpoints in Firefox for iOS

Categories

(Firefox for iOS :: Sync, defect)

All
iOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
Tracking Status
fxios 1.4+ ---

People

(Reporter: dxue, Unassigned, NeedInfo)

References

Details

(Whiteboard: [china])

Attachments

(3 files)

Because the great wall in China, we need to provide local service as default sync service in China. And users can switch between local service and global service by enable/disable a preference.
Blocks: 1227832
(In reply to DongShengXue from comment #0)
> And users can switch between local service and global
> service by enable/disable a preference.

It's not clear to me exactly what this means _once a user has created an account_. Presumably before then it's just like switching between stage and prod. After we could get partitioning, unrecognized accounts, unreachable servers, or other baffling behavior.

Answers to some or all of these would be great.

* Can Chinese users access China-hosted Firefox Accounts / Sync servers from outside China? (I.e., is the restriction one-way?)

* Are Firefox Accounts global with only Sync servers being scoped to China?

* Are Chinese-created Firefox Accounts scoped to China?

* To what extent do we need to explain to users what's going on, when they might switch, and what the results are?

* What does the Android repack do?

* What does desktop do?
Flags: needinfo?(nalexander)
Flags: needinfo?(dxue)
Flags: needinfo?(dcoates)
(In reply to Richard Newman [:rnewman] from comment #1)
> (In reply to DongShengXue from comment #0)
> * Can Chinese users access China-hosted Firefox Accounts / Sync servers from
> outside China? (I.e., is the restriction one-way?)
> 
Sure, Chinese users can access China-hosted Firefox Accounts / Sync servers from outside China. 

> * Are Firefox Accounts global with only Sync servers being scoped to China?
> 
Unfortunately, all the services hosted on AWS being scoped to China.

> * Are Chinese-created Firefox Accounts scoped to China?
> 
Whether the accounts are scoped to China depending on the location of the server.

> * To what extent do we need to explain to users what's going on, when they
> might switch, and what the results are?
> 
I add an attachment to explain it, please see the screenshot.

> * What does the Android repack do?
> * What does desktop do?
> 
We have customized the sync service in the same way for desktop and android in China
Flags: needinfo?(dxue)
I actually have a suggestion for a different approach.

I think the checkbox is confusing and I would rather not include it at all and see this flow:

1) User goes to Settings and selects Sign In
2) We detect if the app was downloaded from the Chinese App Store
3) If it was then we show an intermediate screen or a dialog where the user can select the server location. We can present this as [Mozilla China Server / Mozilla Global Server / Cancel] or something similar.
4) After the selection we continue with the normal sign-in flow.

This removes uncertainty and 'state' about things like 'what happens if you change it while you are logged in'.
Flags: needinfo?(dxue)
Whiteboard: [china]
Another option is that we grey-out the switch as soon as you are logged in. So that you can only change it when you are not currently logged in.

Looping in Darrin and Robin to ask about UX perspective.
Flags: needinfo?(randersen)
Flags: needinfo?(dhenein)
This is delaying the introduction of Firefox for iOS in the Chinese App Store.

Why is this specific to Firefox for iOS?

Surely this is the same for all versions of Firefox - which work just fine with out sync servers inside the GFW.
(In reply to Stefan Arentz [:st3fan] from comment #4)
> I actually have a suggestion for a different approach.
> 
> I think the checkbox is confusing and I would rather not include it at all
> and see this flow:
> 
> 1) User goes to Settings and selects Sign In
> 2) We detect if the app was downloaded from the Chinese App Store
> 3) If it was then we show an intermediate screen or a dialog where the user
> can select the server location. We can present this as [Mozilla China Server
> / Mozilla Global Server / Cancel] or something similar.
> 4) After the selection we continue with the normal sign-in flow.
> 
> This removes uncertainty and 'state' about things like 'what happens if you
> change it while you are logged in'.

This is a great idea. Actually, at the beginning I wanted to do this.
But there is a issue for me, one is how to detect the region, another is too many entry point to login web page, for example the remote tab, welcome page, settings page.
I think if the Chinese version is a separate version, we don't need to detect region in code. If not we must detect region to hide or show the preference.
Finally, the prefernece is a withoutAccountSetting, if user connected with him accout, the setting should be hidden.
Flags: needinfo?(dxue)
Flags: needinfo?(nalexander)
Summary: Support sync from Chinese local server → Support Chinese Sync and Firefox Account service endpoints in Firefox for iOS
(In reply to Simon Blanchard from comment #6)
> This is delaying the introduction of Firefox for iOS in the Chinese App
> Store.
> 
> Why is this specific to Firefox for iOS?

The code bases for Desktop, Android, and iOS are disjoint.  There's work to be done to allow customization for iOS.
 
> Surely this is the same for all versions of Firefox - which work just fine
> with out sync servers inside the GFW.

My guess is there's no technical limitation for Firefox for iOS to work, in China, to external Sync servers -- other than the Great Firewall potentially blocking traffic to said servers.
(In reply to DongShengXue from comment #7)
> (In reply to Stefan Arentz [:st3fan] from comment #4)
> > I actually have a suggestion for a different approach.
> > 
> > I think the checkbox is confusing and I would rather not include it at all
> > and see this flow:
> > 
> > 1) User goes to Settings and selects Sign In
> > 2) We detect if the app was downloaded from the Chinese App Store
> > 3) If it was then we show an intermediate screen or a dialog where the user
> > can select the server location. We can present this as [Mozilla China Server
> > / Mozilla Global Server / Cancel] or something similar.
> > 4) After the selection we continue with the normal sign-in flow.
> > 
> > This removes uncertainty and 'state' about things like 'what happens if you
> > change it while you are logged in'.
> 
> This is a great idea. Actually, at the beginning I wanted to do this.
> But there is a issue for me, one is how to detect the region, another is too
> many entry point to login web page, for example the remote tab, welcome
> page, settings page.
> I think if the Chinese version is a separate version, we don't need to
> detect region in code. If not we must detect region to hide or show the
> preference.
> Finally, the prefernece is a withoutAccountSetting, if user connected with
> him accout, the setting should be hidden.

There are only two places that construct the FxAContentViewController to start the sign-in/sign-up process; you could do things in these two places.

However, I'd suggest making the profile's accountConfiguration configurable *when no Account exists*.  (After that, it's locked down!)

That would let us expose a way to make stage accounts (rather than prod accounts), and we could use the same logic and a China-specific test to expose the setting for China.

Finally, I would change BrowserViewController.presentSignInViewController to be less sophisticated in China, and always take the user to the Settings page (so they can see the toggle).  This seems better than routing the view controller through a layer of checks and configuration, although that probably can be made to work.
Attached file Pull request
Attachment #8692699 - Flags: review?(sarentz)
Another thought would be to let the user decide which server they'd like to use when signing in/up (through an interstitial or actionsheet)... this way we avoid the complexity of managing server preferences (and changes!) once the user is signed in.

To switch servers, you could log out and when signing back in, see the choice again.
Flags: needinfo?(dhenein)
Comment on attachment 8692699 [details] [review]
Pull request

Merged
Attachment #8692699 - Flags: review?(sarentz) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [china] → [china][needsuplift]
No longer depends on: 1228043
Attached image flow.png
zh_CN settings
v1.x 8c9df6c
Whiteboard: [china][needsuplift] → [china]
Verified on v1.4(1404).

It works fine on both iOS 8.4.1 and iOS 9.2
Changing the status to Verified based on the previous comment
Status: RESOLVED → VERIFIED
Flags: needinfo?(dcoates)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: