integreat-cms icon indicating copy to clipboard operation
integreat-cms copied to clipboard

Update media file paths

Open david-venhoff opened this issue 11 months ago • 4 comments

Short description

Update media file paths when uploading a new file in order to avoid caching problems.

Proposed changes

Instead of making sure that a path gets reused when a media file is replaced, always create a new path for the new file, so that no caching problems occur. This is done by prepending the epoch time to the filename.

Then replace all internal links to the old path with links to the new path.

Side effects

  • Hopfully none, old file paths should still work

Resolved issues

Fixes: #1168


Pull Request Review Guidelines

david-venhoff avatar Mar 19 '24 15:03 david-venhoff

Note to self: update https://github.com/digitalfabrik/integreat-app/issues/2130 when this is merged

david-venhoff avatar Mar 19 '24 15:03 david-venhoff

Code Climate has analyzed commit 0cdaac9a and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 86.9% (50% is the threshold).

This pull request will bring the total coverage in the repository to 81.7% (0.1% change).

View more on Code Climate.

codeclimate[bot] avatar Mar 19 '24 15:03 codeclimate[bot]

Is there any possibility to reproduce the bug locally? Trying the steps to reproduce in the issue description with Redis aktivated, it won't work 🤔

MizukiTemma avatar Apr 09 '24 10:04 MizukiTemma

For more information about the current workaround the app team currently uses, you can take a look at their issue: https://github.com/digitalfabrik/integreat-app/issues/2130 With this pr, the path always changes which removes the need to redownload the files all the time.

david-venhoff avatar Apr 11 '24 16:04 david-venhoff