-
Notifications
You must be signed in to change notification settings - Fork 120
fix(avatars): integrate the profile images backend #1584
Conversation
018f0e1
to
0316885
Compare
0316885
to
c16090e
Compare
Functional tests are now working locally, but we need to wait for the fxa-dev server to be updated before we merge. |
|
||
function t (s) { return s; } | ||
|
||
var GRAVATAR_URL = 'https://www.gravatar.com/avatar/'; | ||
var EXPORT_LENGTH = 600; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's dis? 600px? 600chars?
Looks good, @zaach, but I would consider refactoring some of tests (particularly the view tests) to use mocked deps. |
client_id: config.oauthClientId, | ||
scope: 'profile:write' | ||
}; | ||
var oauthClient = new OAuthClient({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For testing this, it would be cool to mock out the OAuthClient
, ProfileClient
, and Assertion
modules and check that the expected methods on those objects are called with the expected parameters (e.g., the expected audience to Assertion.generate
). In general, this is how we'd like to use mocks to test our objects, and I think this would be a good trial of using that approach (i.e., mocking out the direct object dependencies and not necessarily the actual servers).
3f97c56
to
69add1c
Compare
This is ready for another round of reviews. |
@@ -25,7 +25,6 @@ | |||
<nav id="avatar-options"> | |||
<input type="file" id="imageLoader" name="imageLoader" accept="image/png, image/jpeg"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No GIFs? NNNOOOOOOOO!!!
//assert.equal(result, 'data:image/jpeg;base64,ohhai'); | ||
//}); | ||
//}); | ||
//}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for those commented out tests. |
bc36725
to
55ea03f
Compare
@shane-tomlinson I'll let you merge after you feel confident about whatever issue you were having running it. |
@zaach - verifier is now patched, thanks for that. Now I'm seeing other oddness: I open http://127.0.0.1:3030/settings/avatar/camera, click on "Take picture", and in the profile server console, I see the following error:
This results in an "incorrect password" message displayed to the user: The request log to the profile server:
|
The above error is due to not having GraphicsMagick installed. Once that was installed, no problem. The error message should be changed to something other than |
I do not know what caused this console error, but I see this:
|
@zaach - Every time I attempt to use a gravatar image, two calls are made to session/status, and then one to /avatar on the profile server. I keep receiving the error "No Gravatar found", even though this email address has an associated gravatar.
|
@zaach - should the image cropper be available when taking a snapshot from the camera? |
If I change my profile photo and visit |
@shane-tomlinson No image cropper after a camera photo, as per discussion with Ryan. For |
55ea03f
to
9eba71a
Compare
Fixes #1660. This issue occurred because the context of an error was being discarded as the error was rethrown in the form submission handler. Rather than depend on error context being passed around, we store it on individual error objects.
9eba71a
to
a3c4f2a
Compare
@@ -11,14 +11,16 @@ define([ | |||
'lib/promise', | |||
'lib/session', | |||
'lib/auth-errors', | |||
'lib/oauth-errors', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not actually used anywhere in base.
* remove unused deps from base.js. * remove `errors` parameter in `displayError` calls in views/mixins/service-mixin
fix(avatars): integrate the profile images backend I give this my r+.
@zaach - I merged this as "good to go" but I still cannot use gravatar images. I am unsure if this is a problem with my setup, or whether this is a legitimate problem. If this is a problem, let's file a bug and open a follow on PR. Nice work on this, and thanks for working through it with me! |
@shane-tomlinson Hmm, what email address are you using? I can try it locally and see how it goes on my setup. |
@zaach - sent you an email with it. |
We shouldn't merge this before the dev backend is ready: mozilla/fxa-dev#24.
Fixes #1556.