During asset refresh, getExistingFile does not return the updated file

Created on 3 November 2020, about 4 years ago
Updated 29 October 2024, 2 months ago

Problem/Motivation

something is causing delays writing to database, after a $file->save() call that updates the file entity, the new entity is not reflected on DB immediately, making the file loaded again from the DB incorrect under certain conditions, mainly making that the incorrect image styles be flushed, because it uses an outdated file uri.

Steps to reproduce

  1. Create a media with a DAM asset
  2. Update the asset on DAM, changing the file name
  3. Add the asset to the refresh queue and execute it

Proposed resolution

Use an static variable to store in memory the File entity, so then when it is updated, subsequents calls to getExistingFile returns the same File entity from memory, no matter if it was not reflected to DB yet

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡·Argentina matiasmiranda Yerba Buena

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024