Skip to content

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

Description

@saqibmanan

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions