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

feat(metrics): metrics flow for iframeless flow #6227

Merged
merged 2 commits into from May 30, 2018
Merged

feat(metrics): metrics flow for iframeless flow #6227

merged 2 commits into from May 30, 2018

Conversation

vladikoff
Copy link
Contributor

@vladikoff vladikoff commented May 22, 2018

Fixes #5882

@philbooth feedback?

@ghost ghost assigned vladikoff May 22, 2018
@ghost ghost added the waffle:active label May 22, 2018
@vladikoff
Copy link
Contributor Author

@philbooth
Copy link
Contributor

feedback?

Looks perfect to me!


module.exports = function (config) {
const FLOW_ID_KEY = config.get('flow_id_key');
const FLOW_EVENT_NAME = 'flow.begin';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@philbooth what flow event name should we use here?

Copy link
Contributor

Choose a reason for hiding this comment

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

flow.begin is correct (there's a whole bunch of post-processing that's keyed on it, so it's not really a choice at this point tbh)

Copy link
Contributor

Choose a reason for hiding this comment

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

We'll also need to remove app/scripts/views/mixins/flow-begin-mixin.js from the client-side of course. Probably you already realised that, just making sure.

Any places that were mixing it in can mix in flow-events-mixin.js instead now, I think, and everything should just magically work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm, We cannot just remove flow-begin from client-side because there are still iframe versions of the flow. So we either not record a begin if there was a query flow sent or some other solution

Copy link
Contributor

@philbooth philbooth May 26, 2018

Choose a reason for hiding this comment

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

Oh good point, lol. Yeah, maybe add some condition to the begin mixin so it doesn't emit the event if the query params are set?

@vladikoff vladikoff requested a review from a team May 25, 2018 20:26
@vladikoff vladikoff force-pushed the i5882-v2 branch 2 times, most recently from b31fb0e to bd74c53 Compare May 29, 2018 15:23
@vladikoff
Copy link
Contributor Author

@philbooth r? added a change to avoid sending begin on query

Copy link
Contributor

@philbooth philbooth left a comment

Choose a reason for hiding this comment

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

Looks good, just one comment about a possible extra test we can/should add?

createFlow();

assert.equal(flow.get('flowId'), QUERY_FLOW_ID);
assert.equal(flow.get('flowBegin'), QUERY_FLOW_BEGIN);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this test also assert that markEventLogged is called correctly? (or if not here then somewhere)

} else if (this.has('flowBegin')) {
this.logError(AuthErrors.toMissingResumeTokenPropertyError('flowId'));
} else if (urlParams.flow_begin_time && urlParams.flow_id) {
this.set('flowId', urlParams.flow_id);

Choose a reason for hiding this comment

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

Should flow_begin_time and flow_id be checked for validity? The schema below is even used when populating from the data attributes.

@vbudhram vbudhram added this to the FxA-0: quality milestone Jun 20, 2018
@vladikoff vladikoff removed their assignment Jun 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants