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

BUG: AssetUsageStrategy returns references to nodes of different contentstreams #4808

Open
dlubitz opened this issue Dec 18, 2023 · 2 comments
Assignees
Milestone

Comments

@dlubitz
Copy link
Contributor

dlubitz commented Dec 18, 2023

Current state:
At the moment the AssetUsageStrategy fetches all usages of an asset from the AssetUsageFinder (over all content repositories) and groups them by node (nodeaggregateid, origindimensionspacepointhash). Which seems to be quite handy to figure out how many nodeaggregates and dimensions are using the asset.

But if you need to work with the referenced nodes, it doesn't respect the content streams where the node belongs to. Moreover, the group by chooses (by internal sorting) one of the contentstreams.

Expected behavior
In Neos <9.0 the AssetUsage returned all usages of the live workspace and the usages of changed nodes in user workspaces . Which seems to be the ideal for the output of the asset usage in the media module.

On the other hand we want to use the AssetUsage for content cache flushing, where we need exactly each asset usage per contentstream, to ensure all possible cache keys get flushed.

So we need to define what the expected behavior for Neos 9.0 is. And where to solve that. Do we need the same behavior as in Neos <9.0? Or do we specifiy a new behavior?

Problems

  1. The AssetUsage Projection currently stores the usage for each workspace - independend of the change-state. So it's not possible to get just live-workspace and changed-node occurrences.
  2. We have two different use cases, with different needs - but just one interface.
@dlubitz dlubitz added the 9.0 label Dec 18, 2023
@dlubitz dlubitz added this to the 9.0 (ES CR) milestone Dec 18, 2023
@dlubitz dlubitz added the Bug label Dec 18, 2023
@dlubitz dlubitz self-assigned this Dec 29, 2023
@dlubitz
Copy link
Contributor Author

dlubitz commented Dec 29, 2023

Use cases

We have identified the three following use cases for asset usage:

Media Module

(1) Usage count

Number of effected nodes, where the selected asset is referenced. We could discuss, if we count it on a property base, so the same image in two properties of the same node would count 2 usages.

(2) Usage references

Nodes/Properties where the selected asset is referenced.

(!) For the Media Module, we would aim for the same "usage count" as the number of "usage references" we have.

(?) We need to specify which nodes we count and show here. Just live workspace? Also other workspaces? Just "changed" nodes in other workspaces?

Content Cache

(3) Content Cache Flush

Nodes where the selected asset is referenced.

(?) We need to check and specify which nodes (contentstreams/workspaces) we need here for flushing. We need to check how content cache entries are tagged atm and what is useful.

Implementation

How do we wan't archive this? ATM we have one interface AssetUsageStrategyInterface, which can't fulfill all of these use cases. Shall we extend the interface or create a new addional one?

@dlubitz
Copy link
Contributor Author

dlubitz commented Mar 14, 2024

As discussed with @kitsunet we will go with following plan:

  • For content cache, we don't need to use AssetUsageStrategy, so we can simply query for ContentCache need with the GlobalAssetUsageService.
  • For Usage Count and Usage references we can try to reduce the usages to there "real" usages with help of the original dimension spacepoint and compare that with there dimension space point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

1 participant