CivicDataLab / CivicDataLab/DataSpaceFrontend
[Bug] Ghost model DB record created immediately on 'Add New AI Model' click before any form input
Open
@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
- Navigate to
/dashboard/organization/{org}/aimodels - Click Add New AI Model
- Observe: URL immediately changes to
/aimodels/edit/{id}/detailswith a new model ID - Close the editor without filling any fields
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.