Skip to content

Concurrent team creation can generate duplicate slugs and cause team namespace collisions #499

Open

Description

@Ridanshi

Summary

Team slug generation relies on availability checks performed separately from persistence.

Under concurrent team creation requests, multiple operations can generate identical slugs.

Affected Files

  • teamService.ts
  • slug.ts

Root Cause

The slug allocation flow performs uniqueness validation before record creation.

Concurrent requests can observe the same available slug and attempt insertion simultaneously.

The workflow lacks transactional slug allocation guarantees.

Reproduction

  1. Create multiple teams with identical or similar names simultaneously.
  2. Observe slug generation.
  3. Inspect resulting team records.
  4. Observe duplicate slug attempts or creation failures.

Expected Behavior

Slug allocation should remain unique under concurrent creation.

Actual Behavior

Concurrent requests can collide on slug generation.

Why This Is Difficult To Detect

Sequential creation behaves correctly.

The issue only appears under concurrency.

Production Impact

  • Team creation failures
  • Namespace collisions
  • Inconsistent URLs
  • User confusion

Suggested Fix

Introduce atomic slug allocation or retry generation on collision.

Severity

Medium-High

Activity

  1. Ridanshi commented on Jun 6, 2026

    @Ridanshi
    ContributorAuthor

    I investigated this issue and would like to work on it.

    The current team slug allocation workflow appears vulnerable to concurrent creation races.

    I plan to:

    • review slug generation logic
    • preserve existing URL behavior
    • enforce uniqueness under concurrency
    • add regression tests covering simultaneous team creation

    Please assign this issue to me.

  2. Harxhit commented on Jun 12, 2026

    @Harxhit
    Collaborator

    @Ridanshi I have assigned this issue to you.

  3. moved this from Todo to In progress in DevCardon Jun 12, 2026
  4. added 2 commits that reference this issue on Jun 18, 2026
    eb5635e
    23267eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions