Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(api): prefer async/await in session routes #2384

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

philbooth
Copy link
Contributor

Related to #2305.

@mozilla/fxa-devs r?

@philbooth philbooth added this to the Train 145: FxA milestone Sep 3, 2019
@philbooth philbooth requested a review from a team September 3, 2019 09:50
@philbooth philbooth self-assigned this Sep 3, 2019
@philbooth philbooth force-pushed the pb/2305-async-await-session branch 5 times, most recently from bcf00ab to f903b07 Compare September 3, 2019 13:18
// independent verification codes.
let newVerificationState = {};
if (origSessionToken.tokenVerificationId) {
newVerificationState.tokenVerificationId = random.hex(
Copy link
Member

Choose a reason for hiding this comment

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

I assume these return promises? That's why there's P.props below? If so, why not await them here and avoid the P.props entirely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Just for efficiency I think, so they're awaited concurrently.

Copy link
Member

@bbangert bbangert 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, the P.props can prolly be removed if both key sets await instead, but I'm fine either way.

@philbooth philbooth merged commit efa246a into master Sep 3, 2019
@philbooth philbooth deleted the pb/2305-async-await-session branch September 3, 2019 17:28
@philbooth philbooth restored the pb/2305-async-await-session branch September 3, 2019 17:29
@philbooth philbooth deleted the pb/2305-async-await-session branch September 3, 2019 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants