You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a delete request is made using the Vuex-ORM Axios plugin, the entity in the Vuex store is first updated to a "truncated" state, with fields set to default or null values, before it is removed from the store. This leads to a jarring and confusing UI experience, where the user sees the entity in this truncated state briefly before it disappears.
Steps to reproduce the bug
Define models
Example: User, with fields id, first_name, last_name, etc.
Create data
Example: Create a User with id: 5, first_name: 'John', last_name: 'Doe'.
Retrieve data
Example: Fetch the user data using User.api().get(...).
Delete data
Example: Delete a user using User.api().delete('/api/users/5').
In the UI, observe that the user data is first set to a truncated state like { "$id": "$uid3", "id": "$uid3", "first_name": "", "last_name": "", ... } before being deleted.
Expected behavior
When a delete request is made, I expect that the entity not deleted (because I didn't add delete: entityId) until the request is complete (which happens) without first transitioning to a truncated state (doesn't happen it does go through this state which is weird). The deletion should happen smoothly without showing an intermediate, confusing state to the users.
The text was updated successfully, but these errors were encountered:
ivan006
changed the title
Entity Briefly Enters a Truncated State Before Deletion When Using Vuex-ORM Axios Plugin
Entity Briefly Enters a Truncated State Before Deletion When Using Vuex-ORM Axios Plugin when i dont add delete option
Aug 15, 2023
Describe the bug
When a delete request is made using the Vuex-ORM Axios plugin, the entity in the Vuex store is first updated to a "truncated" state, with fields set to default or null values, before it is removed from the store. This leads to a jarring and confusing UI experience, where the user sees the entity in this truncated state briefly before it disappears.
Steps to reproduce the bug
Define models
User
, with fieldsid
,first_name
,last_name
, etc.Create data
User
withid: 5
,first_name: 'John', last_name: 'Doe'
.Retrieve data
User.api().get(...)
.Delete data
User.api().delete('/api/users/5')
.See error
{ "$id": "$uid3", "id": "$uid3", "first_name": "", "last_name": "", ... }
before being deleted.Expected behavior
When a delete request is made, I expect that the entity not deleted (because I didn't add
delete: entityId
) until the request is complete (which happens) without first transitioning to a truncated state (doesn't happen it does go through this state which is weird). The deletion should happen smoothly without showing an intermediate, confusing state to the users.Versions
The text was updated successfully, but these errors were encountered: