BUG: Moved asset only appears in target collection after reload
Description
If an asset is "moved" from one collection to another, it is not visible in the target collection without a reload of the module.
Steps to Reproduce
- Create at least two collections A (first level) and B (second level).
- Upload file to collection B.
- Click file in collection B and select collection A as "Collection".
Expected behavior
- The file disappears from the view as I moved it to collection A.
- When I open Collection A, I see the file.
Actual behavior
- ✔️ The file disappears from the view as I moved it to collection A.
- 🐛 When I open Collection A, I don't see the file. As soon as I refresh the page, it shows up.
This only happens when moving a file up in the hierarchy, in my case from collection B to A. Moving from A to B works flawlessly.
Affected Versions
Neos: 8.3 UI: 8.3.4 Media Module: 0.13
It also seems that the state of the footer is not properly updated. It still shows "1 assets" and the pagination:
In theory I have all necessary cache flushes in place. It might be the assets list of the parent is still cached and I need to flush it separately. Will need further investigation.
This bug is really a bit annoying as it doesn't happen every time. Some timing issue when the various instances and caches are being updated.
1.3.0 includes a partial fix. But there are still some cases in which it doesn't reliably work. Like a 50/50% chance when reassigning an asset.