Skip to content

linkUserByEmail: Split out helper functions, reduce scope of try/catches#521

Open
bheesham wants to merge 8 commits intomozilla-iam:masterfrom
bheesham:split-up-link-users-by-email
Open

linkUserByEmail: Split out helper functions, reduce scope of try/catches#521
bheesham wants to merge 8 commits intomozilla-iam:masterfrom
bheesham:split-up-link-users-by-email

Conversation

@bheesham
Copy link
Contributor

The general approach here was to:

  1. Move functions outside of the main exported function, onExecutePostLogin;
  2. Reduce the size of our try/catch blocks to be more specific;
  3. Add a retry, since there may be transient network errors we're failing on by only relying on the SDK's retry behaviour.

Jira: IAM-1761

@bheesham bheesham force-pushed the split-up-link-users-by-email branch from 7349ee8 to 5c44301 Compare February 24, 2026 22:45
@bheesham bheesham requested a review from Flipez February 24, 2026 22:45
@bheesham bheesham force-pushed the split-up-link-users-by-email branch from 5c44301 to 5bdc41b Compare February 24, 2026 22:57
@bheesham bheesham force-pushed the split-up-link-users-by-email branch 2 times, most recently from 9521bb8 to 0eb74a3 Compare February 25, 2026 21:01
This should address cases not addressed by the Auth0 SDK.

Since we don't currently collect logs as to why these calls may be failing, we
simply log the error and move on (er, retry). Once we understand where this
code is failing we should be more specific about our try/catches.

Jira: IAM-1761
Jira: IAM-1761
@bheesham bheesham force-pushed the split-up-link-users-by-email branch from 0eb74a3 to 2e9b2a1 Compare February 25, 2026 21:06
Copy link
Contributor

@gcoxmoz gcoxmoz left a comment

Choose a reason for hiding this comment

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

Not my primary language, but breakup of functions makes sense to me in each of the commits.

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