Skip to content

fix: tolerate concurrent user creation - #106

Open
vycdev2 wants to merge 1 commit into
vycdev:developfrom
vycdev2:fix/concurrent-user-creation
Open

fix: tolerate concurrent user creation#106
vycdev2 wants to merge 1 commit into
vycdev:developfrom
vycdev2:fix/concurrent-user-creation

Conversation

@vycdev2

@vycdev2 vycdev2 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Handle a unique-key race when concurrent Discord message handlers create the same user.
  • Clear the failed EF change tracker and reload the persisted user instead of failing activity processing.
  • Add a SQLite regression test that simulates the competing insert.

Verification

  • dotnet restore Morpheus.sln — passed (existing NU1903 SQLite vulnerability warning).
  • dotnet test Morpheus.Tests/Morpheus.Tests.csproj --no-restore --filter FullyQualifiedName~UsersServiceTests — passed: 1/1.
  • dotnet build Morpheus.sln --no-restore — passed: 0 errors (existing NU1903 warning).
  • dotnet test Morpheus.Tests/Morpheus.Tests.csproj --no-build --no-restore — 298 passed, 2 failed: existing tr-TR culture cases unavailable in this runner's globalization-invariant mode.
  • git diff --check upstream/develop...HEAD — passed.

Risk

  • Low — the change only recovers from a concurrent unique-key conflict and preserves the existing creation path otherwise.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

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.

1 participant