Skip to content
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

Add hash column to directus_files that updates only when replacing an existing file #22751

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

that1matt
Copy link
Contributor

@that1matt that1matt commented Jun 13, 2024

Scope

What's changed:

  • directus_files now includes a hash column that gets updated when using the Replace File toggle.

Potential Risks / Drawbacks

  • I am not sure if I am missing anything on the migration side.
  • Adding a migration to add a column to a system collection.
  • I am not sure how to setup a test for v-upload.vue just yet.
  • add test for v-upload.vue
  • add test for files.ts service

Review Notes / Questions

  • Added some test coverage, but I am not 100% sure they are "good" tests. They seem to cover all the use cases, but the issue is how the implementation of the readableStreamToString happens after the file is processed to prevent a race condition with sharp. Would love to get some extra eyes on the tests to make sure they are valid and complete.

Fixes #22606

Copy link

changeset-bot bot commented Jun 13, 2024

🦋 Changeset detected

Latest commit: 2be2411

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@directus/system-data Patch
@directus/types Patch
@directus/api Patch
@directus/app Patch
@directus/sdk Patch
@directus/utils Patch
@directus/composables Patch
@directus/extensions-sdk Patch
@directus/extensions Patch
@directus/themes Patch
@directus/validation Patch
directus Patch
@directus/env Patch
@directus/extensions-registry Patch
@directus/memory Patch
@directus/pressure Patch
@directus/storage-driver-azure Patch
@directus/storage-driver-cloudinary Patch
@directus/storage-driver-gcs Patch
@directus/storage-driver-s3 Patch
@directus/storage-driver-supabase Patch
create-directus-extension Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@that1matt that1matt force-pushed the fix-22606 branch 3 times, most recently from 6dbbed3 to 89c27c6 Compare June 19, 2024 21:10
@rijkvanzanten rijkvanzanten self-assigned this Jun 20, 2024
@that1matt that1matt force-pushed the fix-22606 branch 5 times, most recently from 2d52b6f to aad7064 Compare June 25, 2024 15:43
app/src/components/v-upload.vue Outdated Show resolved Hide resolved
@that1matt that1matt force-pushed the fix-22606 branch 2 times, most recently from 9dd63a0 to 4b4ef89 Compare June 26, 2024 00:36
@that1matt that1matt force-pushed the fix-22606 branch 3 times, most recently from fa4b621 to 5c009af Compare June 26, 2024 15:24
api/src/services/files.ts Outdated Show resolved Hide resolved
api/src/services/files.ts Outdated Show resolved Hide resolved
@that1matt that1matt changed the title Add version column to directus_files that updates when using the Replace File toggle. Add version column to directus_files that updates only when replacing an existing file Jun 26, 2024
@that1matt that1matt force-pushed the fix-22606 branch 2 times, most recently from 00889bf to 5bc392c Compare June 27, 2024 14:51
@that1matt

This comment has been minimized.

@that1matt that1matt changed the title Add version column to directus_files that updates only when replacing an existing file Add replaced_on column to directus_files that updates only when replacing an existing file Jun 28, 2024
api/src/services/files.ts Outdated Show resolved Hide resolved
@that1matt that1matt changed the title Add replaced_on column to directus_files that updates only when replacing an existing file Add hash column to directus_files that updates only when replacing an existing file Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

Provide a unique value (version identifier) when replacing existing files/images
3 participants