Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

fix(avatars): add profile server client to proxy remote images #1496

Merged
merged 1 commit into from
Aug 12, 2014

Conversation

zaach
Copy link
Contributor

@zaach zaach commented Aug 2, 2014

Fixes #1458.
Fixes #1447.
Fixes #1469. It fixes the client portion, at least. The server depends on mozilla/fxa-profile-server#31.

Not sure if we want to merge until the server side is ready.

@zaach zaach added the WIP label Aug 2, 2014
return msg;
};

var ERROR_TO_CODE = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be moved to their own module?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kind of want to refactor things and put all the errors into an error.js. The variety of error modules is starting to feel cluttered and potentially confusing. Follow up PR?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zaach - totally.

@zaach zaach added the strings label Aug 5, 2014
@zaach
Copy link
Contributor Author

zaach commented Aug 5, 2014

@shane-tomlinson updated!

@zaach zaach removed the WIP label Aug 5, 2014
@zaach zaach mentioned this pull request Aug 5, 2014
});

afterEach(function () {
Assertion.generate = Assertion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does that work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it syntactic sugar to allow for Assertion() and Assertion.generate() to do the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't think we're actually using Assertion() anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, the Assertion module aliases Assertion() to Assertion.generate() and the line above is resetting Assertion.generate after it was overwritten in beforeEach.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay cool that makes sense. Thanks @zaach. Worth adding a comment to explain that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good idea.

@zaach
Copy link
Contributor Author

zaach commented Aug 7, 2014

@vladikoff or @ckarlof, can you review?

function ($, _, p, Session, ConfigLoader, OAuthClient, Assertion, AuthErrors) {

function ProfileClient(options) {
if (!(this instanceof ProfileClient)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What situation does this cover?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an idiom for allowing var client = ProfileClient() as well as var client = new ProfileClient(). I coppied it from the OAuth client.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay cool. I figured it was something like that. My opinion is that it encourages inconsistent use without a lot of actual benefit, but that's just my opinion 😄.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I tend to agree.

@@ -14,7 +14,7 @@ define([
var NAMESPACE = '__fxa_session';

// and should not be saved to sessionStorage
var DO_NOT_PERSIST = ['client_id', 'prefillPassword', 'prefillYear', 'error', 'service'];
var DO_NOT_PERSIST = ['client_id', 'prefillPassword', 'prefillYear', 'error', 'service', 'cropImgWidth', 'cropImgHeight', 'cropImgSrc'];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid clogging sessionStorage with image data.

@zaach
Copy link
Contributor Author

zaach commented Aug 12, 2014

Issue have been fixed or filed. I think we're ready to merge @ckarlof or @vladikoff!

ckarlof added a commit that referenced this pull request Aug 12, 2014
fix(avatars): add profile server client to proxy remote images
@ckarlof ckarlof merged commit b5cfdfc into master Aug 12, 2014
@ckarlof ckarlof deleted the profile-server-client branch August 12, 2014 00:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants