-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Datamodel updates not saved when just moving a field and then generating models. #13022
Comments
This is very likely due to TanStack Query not updating the query data because TanStack uses structural sharing to only update query data that has been changed. Since the JSON specification defines objects as an unordered collection, and the property order is saved as an object, changing the order of the properties will not update the query data. Screen.Recording.2024-07-08.133815.mp4I think a proper solution to this would be to change "properties": [
{ "name": "property1", "type": "string" },
{ "name": "property2", "type": "string" }
] But since I am not sure how big this refactoring would be, I will submit a smaller PR that disables structural sharing for just this query and we could discuss how to solve the root issue. |
Tested in dev - OK :) |
Description of the bug
See title. Making only changes to the order of fields saves as expected, but if those are the only changes, then clicking "Generer modeller" directly after changing order of fields causes the order to revert back to the old order.
Steps To Reproduce
Screen.Recording.2024-06-25.at.11.07.20.mov
Additional Information
Updated data model is saved as expected when just changing the order of fields, the issue seems to be with "Generer modeller" directly after changing the field order. Making any other changes, or re-loading the page after changing order, seems to resolve the issue.
Looks like there may be some outdated state used when "Generer modeller" is clicked that is causing this? Re-load of model before generating models seems to do the trick. We should ensure that the updated data model is passed to the backend when generating models.
The text was updated successfully, but these errors were encountered: