CivicDataLab / CivicDataLab/DataSpaceFrontend

[Bug] Ghost model DB record created immediately on 'Add New AI Model' click before any form input

Open
#410 0 comments 0 reactions 1 assignee View on GitHub

@Abhishekfm is already working on this.

Since Jun 22, 2026.

bug
Dominant language
TypeScript
Stars
1
Forks
0
Avg merge
1d 7h
Merged PRs (30d)
19

Description

Summary

Clicking Add New AI Model immediately creates a model record in the database (e.g. ID 168, named "New AI Model") and navigates to the edit wizard — before the user has filled in any data.

If the user closes the editor or navigates away without filling anything, an orphaned draft model with no name, no metadata, and no version remains in the database.

Impact

  • Pollutes the Draft models list with incomplete entries
  • May count against org model quotas
  • Makes it impossible to distinguish intentional drafts from abandoned attempts
  • During testing, model ID 168 was created and left as an empty draft

Steps to Reproduce

  1. Navigate to /dashboard/organization/{org}/aimodels
  2. Click Add New AI Model
  3. Observe: URL immediately changes to /aimodels/edit/{id}/details with a new model ID
  4. Close the editor without filling any fields
  5. Return to the models list — the empty "New AI Model" draft is present

Expected Behaviour

Either:

  • (a) Show a "Name your model" prompt before creating the DB record, OR
  • (b) Auto-delete models closed within 60s of creation with no metadata filled

Environment

  • URL: https://dev.civicdataspace.in/dashboard/organization/civicdatalab/aimodels
  • Discovered: 2026-06-22 via QA audit
  • Report ref: CDS-002

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.