When using an external asset source, assets get imported when they are selected for use via the media selection screen (if they have not previously been imported). To check if an asset needs to be imported, the system checks if the asset already has a localAssetIdentifier. If it doesn't have the localAssetIdentifier, the importAction() of the Neos\Media\Browser\Controller\AssetProxyController is triggered.
The import process takes a few moments. Once it finishes, the asset is selected an the media selection screen closes. The user does not get any feedback about any background processes running and is not blocked from clicking on the asset again. Since editors tend to be impatient, this leads to them clicking on the asset multiple times, triggering the import multiple times and leading to several versions of the same asset being imported into the database.
Expected Behavior
An asset import process should only be triggered once. After it started running, it should not allow another import process to be started for the same asset.
We already discussed a few ideas for how to implement that. The best way seems to be to have a process queue/stack.
We were also thinking that it might be a good idea to have a cleanup command for projects that already have that problem, so the database doesn't have redundant assets.
Steps To Reproduce
implement a remote asset source
find an asset that has not yet been imported (you can check that with the browser tools -> data-local-asset-identifier should not have a value)
select that asset for use via the media selection screen and click on it multiple times before the selection screen closes
check the neos_media_domain_model_importedasset table in your database, counting the entries for each remoteassetidentifier (SELECT remoteassetidentifier, count(*) FROM neos_media_domain_model_importedasset GROUP BY remoteassetidentifier ORDER BY count(*) DESC;)
Is there an existing issue for this?
Current Behavior
When using an external asset source, assets get imported when they are selected for use via the media selection screen (if they have not previously been imported). To check if an asset needs to be imported, the system checks if the asset already has a
localAssetIdentifier
. If it doesn't have thelocalAssetIdentifier
, theimportAction()
of theNeos\Media\Browser\Controller\AssetProxyController
is triggered.The import process takes a few moments. Once it finishes, the asset is selected an the media selection screen closes. The user does not get any feedback about any background processes running and is not blocked from clicking on the asset again. Since editors tend to be impatient, this leads to them clicking on the asset multiple times, triggering the import multiple times and leading to several versions of the same asset being imported into the database.
Expected Behavior
An asset import process should only be triggered once. After it started running, it should not allow another import process to be started for the same asset.
We already discussed a few ideas for how to implement that. The best way seems to be to have a process queue/stack. We were also thinking that it might be a good idea to have a cleanup command for projects that already have that problem, so the database doesn't have redundant assets.
Steps To Reproduce
data-local-asset-identifier
should not have a value)neos_media_domain_model_importedasset
table in your database, counting the entries for eachremoteassetidentifier
(SELECT remoteassetidentifier, count(*) FROM neos_media_domain_model_importedasset GROUP BY remoteassetidentifier ORDER BY count(*) DESC;
)Environment
Anything else?
No response