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

chore(access): Parallelizing invocation of authz claim retrieval #2441

Merged
merged 2 commits into from
Jun 26, 2023

Conversation

betimshahini
Copy link
Contributor

Description

Parallelizes invocation of setup and retrieval functions for authz claim values.

Related Issues

  • N/A

Testing

  • Regression test using account with apps with existing authorizations.

Checklist

  • I have read the CONTRIBUTING guidelines
  • I have tested my code (manually and/or automated if applicable)
  • I have updated the documentation (if necessary)

@betimshahini betimshahini marked this pull request as ready for review June 26, 2023 10:28
result = { ...result, ...createInvalidClaimDataObject(scopeValue) }
}
)
const retrieverResults = await Promise.allSettled(retrieverPromises)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this intended to be inside the for loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

? r.value
: createInvalidClaimDataObject(scopeValue)
)
.forEach((claimData) => (result = { ...result, ...claimData }))
Copy link
Contributor

Choose a reason for hiding this comment

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

Loops twice over array, would a reduce 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.

Not in this case as I'm having to convert from a PromiseSettledResult to a ClaimData, which requires a map anyway before doing a reduce.

@betimshahini betimshahini merged commit 7ef3b8c into main Jun 26, 2023
@betimshahini betimshahini deleted the chore/parallelizing-authz-claim-retrieval branch June 26, 2023 11:28
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