Skip to content

bugfix: component re-render after update

The problem was that after a form submission, the dropdowns were not properly updated.

This was caused by the refresh function of the store, which was doing this:

clear cache for resource
fetch data for resource
publish(resource)  <- the form is re-rendered.

for all nested resources
  clear cache for nested resource
  fetch data for nested resource
  publish(nested_resource)

The problem was, the nested resources are removed from the cache just before the re-render, so they do not appear in the form. I switch to something like this:

clear cache for resource
fetch data for resource

for all nested resources
  clear cache for nested resource
  fetch data for nested resource
  publish(nested_resource)

publish(resource)

This way, we make sure that the components have all the values they need before rendering

Merge request reports