aws-amplify / aws-amplify/amplify-studio
Visual Data editor loses unsaved work when creating new model with similar name as existing model
- Dominant language
- No language data
- Stars
- 135
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
### Before opening, please confirm:
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-adminui/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-adminui/blob/main/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
### App Id
dntco4q28bj1y
### Region
ap-southeast-2
### Environment name
dev
### Figma File Version (if applicable)
_No response_
### Amplify CLI Version
_No response_
### If applicable, what version of Node.js are you using?
_No response_
### What operating system are you using?
Windows 10
### Browser type?
Google Chrome
### Describe the bug
When creating a group of related models in the visual data editor a bug occurs when starting to name a new model with the same beginning word as an existing model, the editor corrupts the models and unsaved work is lost. When starting to name the new model it somehow picks a data relationship from the existing model with the similar name and applies it. The existing model relationships now point to the new model. The delete button on the relationships is then unresponsive and the screen refreshes and loses all unsaved work.
### Expected behavior
When creating a new model it does not automatically pick up data or relationships from existing models.
### Reproduction steps
1. Create a new model named Ingredient and give it a name string field.
2. Create a new model named Product and give it a name string field.
3. Add a many-to-many relationship on Product to Ingredient
4. Create a new model named MenuItem and give it a name string field.
5. Create a many-to-many relationship on MenuItem to Product.
6. Create a many-to-many relationship on MenuItem to Ingredient.
7. Create a new model and start to name it Menu - notice that at "Men" it automatically adds two many-to-many relationships to the new model pointing to MenuItem, and the two relationships on MenuItem start to point to this new "Men" model.
8. Try deleting the relationships on MenuItem and re-adding them - note that Product now has two MenuItem relationships, one of which can't be deleted
9. The first time I tried this and was trying to correct the problems the screen refreshed and I lost all unsaved work
### Project Identifier
_No response_
### Additional information
_No response_
Contributor guide
Research direction
Start in the Visual Data editor and reproduce the issue by creating Ingredient, Product, and MenuItem models with the listed relationships, then naming another model "Men". Done means the new model does not inherit relationships from MenuItem, existing relationships remain correct and deletable, and the editor does not refresh or lose unsaved work.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100