Skip to content

fix(auth): converge concurrent identity binding - #786

Merged
XiaoSeS merged 1 commit into
mainfrom
fix/issue-613-oauth-concurrency-20260831
Aug 31, 2026
Merged

fix(auth): converge concurrent identity binding#786
XiaoSeS merged 1 commit into
mainfrom
fix/issue-613-oauth-concurrency-20260831

Conversation

@XiaoSeS

@XiaoSeS XiaoSeS commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

What

Closes #613.

Concurrent first-time OAuth callbacks now converge on the identity binding committed by the winning transaction instead of returning HTTP 500.

Design

  • Execute the initial binding attempt in a REQUIRES_NEW transaction.
  • Force the unique identity coordinate with saveAndFlush before membership or activation events.
  • On a unique-key race, let the failed transaction roll back and resolve the winning binding in a second REQUIRES_NEW transaction.
  • Re-throw unrelated integrity failures when no winning binding exists.
  • Preserve pending, disabled, merged, and system-account outcomes without logging the OAuth subject.

Tests

  • Winning principal convergence.
  • Pending-user convergence.
  • Unrelated integrity failure propagation.
  • Existing active, pending, disabled, merged, system-account, verified-email, membership, event, and role behavior.

Signed-off-by: XiaoSeS 87064762+XiaoSeS@users.noreply.github.com

Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
@XiaoSeS
XiaoSeS merged commit ac42c23 into main Aug 31, 2026
10 checks passed
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.

[Bug] Concurrent first-time OAuth binding returns 500

1 participant