Closed Bug 1231549 Opened 9 years ago Closed 8 years ago

Set default profile endpoint server URI for Firefox Accounts not created via the web flow

Categories

(Firefox for Android Graveyard :: Android Sync, defect)

defect
Not set
normal

Tracking

(firefox47 fixed)

RESOLVED FIXED
Firefox 47
Tracking Status
firefox47 --- fixed

People

(Reporter: nalexander, Assigned: daniel9618, Mentored)

References

Details

(Whiteboard: [lang=java][good next bug])

Attachments

(2 files)

When we landed Bug 1171141, we didn't migrate Firefox Accounts forward by including a default or stage profile URI when appropriate.

This ticket tracks adding a default fallback to the profile server URI accessor around https://dxr.mozilla.org/mozilla-central/rev/319be5e7ce3061c7c16f24d750b6dacdbcac4c35/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java#301 -- see the example for OAuth just past that -- or migrating null URIs forward in place (in the upgrade receiver, I suppose).
(In reply to Nick Alexander :nalexander from comment #0)
> When we landed Bug 1171141, we didn't migrate Firefox Accounts forward by
> including a default or stage profile URI when appropriate.

This means that all users with Firefox Accounts *created* before Fennec 44 are not displaying profile images throughout the App, even when they could.
See Also: → 1237406
Mentor: nalexander, vivekb.balakrishnan
Whiteboard: [lang=java][good next bug]

(In reply to Nick Alexander :nalexander from comment #0)
> When we landed Bug 1171141, we didn't migrate Firefox Accounts forward by
> including a default or stage profile URI when appropriate.
> 
> This ticket tracks adding a default fallback to the profile server URI
> accessor around
> https://dxr.mozilla.org/mozilla-central/rev/
> 319be5e7ce3061c7c16f24d750b6dacdbcac4c35/mobile/android/services/src/main/
> java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java#301 -- see
> the example for OAuth just past that -- or migrating null URIs forward in
> place (in the upgrade receiver, I suppose).

I understood the first approach, but I didn't quite get the second one, do you mind expanding on that?
Flags: needinfo?(nalexander)
(In reply to dlim from comment #2)
> 
> (In reply to Nick Alexander :nalexander from comment #0)
> > When we landed Bug 1171141, we didn't migrate Firefox Accounts forward by
> > including a default or stage profile URI when appropriate.
> > 
> > This ticket tracks adding a default fallback to the profile server URI
> > accessor around
> > https://dxr.mozilla.org/mozilla-central/rev/
> > 319be5e7ce3061c7c16f24d750b6dacdbcac4c35/mobile/android/services/src/main/
> > java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java#301 -- see
> > the example for OAuth just past that -- or migrating null URIs forward in
> > place (in the upgrade receiver, I suppose).
> 
> I understood the first approach, but I didn't quite get the second one, do
> you mind expanding on that?

Each time the Android package is upgraded, we get a broadcast notification.  I can't recall what we currently do in there :)  See https://dxr.mozilla.org/mozilla-central/source/mobile/android/services/src/main/java/org/mozilla/gecko/fxa/receivers/FxAccountUpgradeReceiver.java.

We could use that upgrade receiver to check if we have a null profile server URI, do the fallback calculation, and update the state.  The advantage there is that we get "good data" into the account, rather than always working around the problem forever.  The dis-advantage -- upgrades can fail, can conflict, are less flexible to roll-back, etc.
Flags: needinfo?(nalexander)
(In reply to Nick Alexander :nalexander from comment #3)
> (In reply to dlim from comment #2)
> > 
> > (In reply to Nick Alexander :nalexander from comment #0)
> > > When we landed Bug 1171141, we didn't migrate Firefox Accounts forward by
> > > including a default or stage profile URI when appropriate.
> > > 
> > > This ticket tracks adding a default fallback to the profile server URI
> > > accessor around
> > > https://dxr.mozilla.org/mozilla-central/rev/
> > > 319be5e7ce3061c7c16f24d750b6dacdbcac4c35/mobile/android/services/src/main/
> > > java/org/mozilla/gecko/fxa/authenticator/AndroidFxAccount.java#301 -- see
> > > the example for OAuth just past that -- or migrating null URIs forward in
> > > place (in the upgrade receiver, I suppose).
> > 
> > I understood the first approach, but I didn't quite get the second one, do
> > you mind expanding on that?
> 
> Each time the Android package is upgraded, we get a broadcast notification. 
> I can't recall what we currently do in there :)  See
> https://dxr.mozilla.org/mozilla-central/source/mobile/android/services/src/
> main/java/org/mozilla/gecko/fxa/receivers/FxAccountUpgradeReceiver.java.
> 
> We could use that upgrade receiver to check if we have a null profile server
> URI, do the fallback calculation, and update the state.  The advantage there
> is that we get "good data" into the account, rather than always working
> around the problem forever.  The dis-advantage -- upgrades can fail, can
> conflict, are less flexible to roll-back, etc.

It seems like there are more drawbacks that benefits of going with the second option?
Comment on attachment 8722605 [details] [diff] [review]
Set default profile endpoint server URI for Firefox Accounts not created via the web flow

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

It's possible for users to have custom auth servers, in which case the default profile server is not appropriate.  So, if the profileURI is null, then check for stage and default auth servers and return the appropriate profile server, following the oauth server example.

Yes, this is a little ridiculous :)
Attachment #8722605 - Flags: review?(nalexander) → feedback+
Comment on attachment 8722640 [details] [diff] [review]
Set default profile endpoint server URI for Firefox Accounts not created via the web flow

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

Excellent.

You should be able to set the "checkin-needed" flag on the bug, which will have a sheriff see your patch, see my review, and land your code.  Good work!
Attachment #8722640 - Flags: review?(nalexander) → review+
(In reply to Nick Alexander :nalexander from comment #8)
> Comment on attachment 8722640 [details] [diff] [review]
> Set default profile endpoint server URI for Firefox Accounts not created via
> the web flow
> 
> Review of attachment 8722640 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Excellent.
> 
> You should be able to set the "checkin-needed" flag on the bug, which will
> have a sheriff see your patch, see my review, and land your code.  Good work!

Thanks!  
However, I don't think I
(In reply to dlim from comment #9)
> (In reply to Nick Alexander :nalexander from comment #8)
> > Comment on attachment 8722640 [details] [diff] [review]
> > Set default profile endpoint server URI for Firefox Accounts not created via
> > the web flow
> > 
> > Review of attachment 8722640 [details] [diff] [review]:
> > -----------------------------------------------------------------
> > 
> > Excellent.
> > 
> > You should be able to set the "checkin-needed" flag on the bug, which will
> > have a sheriff see your patch, see my review, and land your code.  Good work!

Thanks!  
However, I don't think I have the ability to add keywords to a bug, it's not showing an edit button beside the 'keyword' field?
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0ed2152fd50b
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
mfinkle: no rush, but you might verify that your profile avatar begins to appear in new Nightly builds.  Thanks!
Flags: needinfo?(mark.finkle)
Assignee: nobody → daniel9618
Verified. It works now.
Flags: needinfo?(mark.finkle)
No longer blocks: TelemetryAdditions
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: