Skip to content

Conversation

@gjwnc
Copy link
Contributor

@gjwnc gjwnc commented Aug 26, 2019

If one set's Neos.MetaData.Extractor.realtimeExtraction.enabled to false in Settings.yaml, the signal assetRemoved is not handled. Thus the nodedata table still contains nodes which have properties where the metadata entry is linked to a resource which does not exist any more, e.g. from properties of such a Neos.MetaData:Image node

{
    "assetObject": {
        "__flow_object_type": "Neos\\Media\\Domain\\Model\\Image",
        "__identifier": "033f5153-9089-467b-be6c-55735c69c19b"
    }
    ....

So, this patch is about preventing possible inconsistencies in the nodedata table.

This commit, always handles the signal assetRemoved using ExtractionManager::onAssetRemoved which signals MetaDataCollectionUpdated via Neos\MetaData\MetaDataManager. Thus the asset's metadata node is removed and rebuilding the metadata is also prevented by using onAssetRemoved.

Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, sounds very reasonable! I am just not 100% sure about the implementation… so I left some comments.

@gjwnc
Copy link
Contributor Author

gjwnc commented Sep 30, 2021

@daniellienert Do you have any concerns to prevent a merge?

I'm using this fix in a fork for two years now and it works well.

@kdambekalns
Copy link
Member

@daniellienert To me this seems ok, but I wonder… maybe the whole idea of realtime extraction is to not do anything and instead rely on a cron job or the like to run metadata:extract? So it is in fact intended to have those "dangling links" until an update is explicitly done?

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 this pull request may close these issues.

2 participants