-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Uploaded image asset preview is incorrect if an image with same name got uploaded and deleted before #3295
Comments
the asset preview cache is saved: vendure/packages/asset-server-plugin/src/asset-server.ts Lines 127 to 135 in 7d462a0
but it is not being deleted along with the assets when removed: vendure/packages/core/src/service/services/asset.service.ts Lines 495 to 512 in 7d462a0
|
hmm, but manually removing the cached preview file still will have this issue. |
I think the main challenge here is that the cached images have a hash appended so it is not as simple as just calling "delete" on a specific file. Let's say we have
The AssetStorageStrategy only has a deleteFile method, which means we need to know the precise file name to delete. We can't simple do "list all files that start with Therefore I think this is only solvable by extending the AssetStorageStrategy interface in some way to allow bulk deletion of matching files. Whatever API we come up with would need to be implementable on local file system (trivial) and s3 (needs research) at a minimum. |
Describe the bug
When upload an image asset in admin page, and then delete it. Upload a different image with the same name as the one deleted. the deleted one is shown instead of the new image.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should see correct imgae in preview
Environment (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: