Race condition with reactivity
In some very specific cases, we can see a race condition after a resource update, which leads to error and widgets not properly rendered.
This happens because we do:
PATCH resource
clear cache resource
GET resource
for all nested resources
clear cache nested resource
GET nested resource
notify components
for all subscriptions
clear cache subscribed resource
<-- component notified above rendering, but resource not fetched yet
GET nested subscribed resource
notify components
I suggest to do it this way:
PATCH resource
clear cache resource
GET resource
for all nested resources and subscriptions
clear cache
GET resource
notify components
Like this, when we notify components, everything has already been re-fetched