Skip to content
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

Schema attribute changes not reflected in Entity detail page #203

Closed
TeodoraPavlova opened this issue Apr 10, 2024 · 4 comments · Fixed by #207
Closed

Schema attribute changes not reflected in Entity detail page #203

TeodoraPavlova opened this issue Apr 10, 2024 · 4 comments · Fixed by #207

Comments

@TeodoraPavlova
Copy link
Contributor

If you change the schema attributes and after that go to entity detail page, you won't see schema changes reflected. The changes are visible after page reload.

I thought that we can update the activeSchema value with triggering an update in SchemaEdit component (if we provide a function, which will do the update in <App/>, inject it into <SchemaEdit/> and invoke it). It turned out that the activeSchema object gets updated, but provide() does not get called again after updating the object.

It could be possible that at this point this can not be resolved properly (without javascript page reload) and it could be issue related with the usage of the options API. In theory, it should be reactive and the provide() should get called after.

If there is no other easy solution at this point, a page reload (on successful response) will do the job.

@crazyscientist
Copy link
Collaborator

Nice catch 👍

The description currently covers only the client that applied the change to the schema. Maybe we should also consider the impact on other clients that unaware of the schema change?

@TeodoraPavlova
Copy link
Contributor Author

I agree.. it can get very messy, especially if the slug is changed 😆

@TeodoraPavlova
Copy link
Contributor Author

Maybe we should also consider the impact on other clients that unaware of the schema change?

What do you think about implementing server side events for this one? Or just client polling?

@crazyscientist
Copy link
Collaborator

server side events for this one? Or just client polling?

I would go with the latter: Instead of the current "fetch once and provide to the rest of the app" approach, I would switch to a "fetch just in time" approach whenever it is needed.

crazyscientist pushed a commit that referenced this issue May 8, 2024
* Load schema on demand (fixes #203)
* refactor move schema.js to composables
* rename event update-schema to updateSchema in order to find occurrences easily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants