Skip to content

Fix signup duplicate upstream id - #1754

Merged
nygrenh merged 3 commits into
masterfrom
fix-signup-duplicate-upstream-id
Jul 10, 2026
Merged

Fix signup duplicate upstream id#1754
nygrenh merged 3 commits into
masterfrom
fix-signup-duplicate-upstream-id

Conversation

@Redande

@Redande Redande commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Prevented soft-deleted user records from being returned or updated.
    • Improved signup handling when an account with the same upstream identity already exists.
    • Preserved clear error responses for duplicate email addresses and unexpected signup failures.

@Redande Redande changed the title Fix signup duplicate upstream Fix signup duplicate upstream id Jul 10, 2026
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f626a855-9aac-488b-8f95-0833ba5e16bb

📥 Commits

Reviewing files that changed from the base of the PR and between 005f35e and eba5b3b.

📒 Files selected for processing (3)
  • services/headless-lms/models/.sqlx/query-3ad1dd4e432eba7a681e55b02ca8db9f4f52c921431259b90dd9bd3c79a6aa76.json
  • services/headless-lms/models/src/users.rs
  • services/headless-lms/server/src/controllers/auth.rs

📝 Walkthrough

Walkthrough

The change excludes soft-deleted users from upstream-ID lookups and email updates. Signup now handles active upstream-ID uniqueness conflicts by loading the existing user, while retaining existing responses for duplicate emails and other insertion failures.

Changes

Active user signup handling

Layer / File(s) Summary
Active user query filtering
services/headless-lms/models/src/users.rs, services/headless-lms/models/.sqlx/query-*.json
User lookup and email-update queries now require deleted_at IS NULL, and the stored SQLx query hash is updated.
Signup conflict recovery
services/headless-lms/server/src/controllers/auth.rs
Signup recovers from users_upstream_id_active_uniq_idx conflicts by fetching the existing user; email conflicts and other errors retain their existing responses.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: bug

Suggested reviewers: nygrenh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: handling duplicate upstream IDs during signup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-signup-duplicate-upstream-id
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix-signup-duplicate-upstream-id

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the bug Something isn't working label Jul 10, 2026
@nygrenh
nygrenh enabled auto-merge (squash) July 10, 2026 09:02
@nygrenh
nygrenh merged commit 695fab2 into master Jul 10, 2026
22 checks passed
@nygrenh
nygrenh deleted the fix-signup-duplicate-upstream-id branch July 10, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working headless-lms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants