Skip to content

Bug: Soft-deleted repository blocks re-submission with UNIQUE constraint error #347

@MuLeiSY2021

Description

@MuLeiSY2021

Description

When a repository submission fails (e.g. due to wrong credentials) and is then deleted from the admin panel, the record is soft-deleted (IsDeleted=1) but the UNIQUE constraint on (OrgName, RepoName) still blocks re-submission of the same
repository.

Steps to Reproduce

  1. Submit a private repository (e.g. org/repo) with incorrect credentials
  2. The repository processing fails
  3. Delete the repository from admin panel (/admin/repositories)
  4. Try to submit the same repository again

Expected Behavior

Re-submission should succeed since the previous record was deleted.

Actual Behavior

Backend returns SQLite Error 19: UNIQUE constraint failed: Repositories.OrgName, Repositories.RepoName

The admin panel shows no repositories (soft-deleted records are hidden), so the user has no way to fix this through the UI.

Suggested Fix

Either:

  • Add a unique index filter: WHERE IsDeleted = 0 (so soft-deleted records don't conflict)
  • Or check for soft-deleted duplicates on submission and either hard-delete or restore them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions