UpdateDatasetMetadata and UpdateFileMetadata use cases: use sourceLastUpdateTime#379
Merged
ofahimIQSS merged 8 commits intodevelopfrom Oct 3, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR extends the file and dataset update functionality to use sourceLastUpdateTime for optimistic concurrency control, replacing the previous internalVersionNumber approach for datasets and adding time-based conflict detection for file metadata updates.
- Replaces
internalVersionNumberparameter withsourceLastUpdateTimefor dataset updates - Adds
lastUpdateTimefield to file models and enables optimistic locking for file metadata updates - Updates all transformers to use string-based timestamps instead of Date objects for
lastUpdateTime
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/datasets/domain/models/Dataset.ts | Changes lastUpdateTime from Date to string type |
| src/datasets/domain/repositories/IDatasetsRepository.ts | Replaces internalVersionNumber with sourceLastUpdateTime parameter |
| src/datasets/domain/useCases/UpdateDataset.ts | Updates method signature and documentation for new timestamp-based approach |
| src/datasets/infra/repositories/DatasetsRepository.ts | Implements sourceLastUpdateTime query parameter instead of sourceInternalVersionNumber |
| src/datasets/infra/repositories/transformers/datasetTransformers.ts | Removes Date conversion for lastUpdateTime field |
| src/datasets/infra/repositories/transformers/datasetPreviewsTransformers.ts | Removes Date conversion for lastUpdateTime field |
| src/files/domain/models/FileModel.ts | Adds required lastUpdateTime field |
| src/files/domain/repositories/IFilesRepository.ts | Adds optional sourceLastUpdateTime parameter |
| src/files/domain/useCases/UpdateFileMetadata.ts | Adds sourceLastUpdateTime parameter with documentation |
| src/files/infra/repositories/FilesRepository.ts | Implements conditional sourceLastUpdateTime query parameter |
| src/files/infra/repositories/transformers/FilePayload.ts | Adds required lastUpdateTime field |
| src/files/infra/repositories/transformers/fileTransformers.ts | Maps lastUpdateTime from payload to model |
| test/integration/datasets/DatasetsRepository.test.ts | Updates test to use new timestamp-based conflict detection |
| test/integration/files/FilesRepository.test.ts | Adds comprehensive test for file metadata optimistic locking |
| test/testHelpers/datasets/datasetHelper.ts | Updates to use string instead of Date for lastUpdateTime |
| test/testHelpers/datasets/datasetPreviewHelper.ts | Updates to use string instead of Date for lastUpdateTime |
| test/testHelpers/files/filesHelper.ts | Adds lastUpdateTime field to test helpers |
| test/unit/files/UpdateFileMetadata.test.ts | Updates test expectations to include new undefined parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ekraffmiller
approved these changes
Oct 2, 2025
Contributor
ekraffmiller
left a comment
There was a problem hiding this comment.
looks good, approved
Contributor
|
Looks good, merging |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Updates the use cases UpdateDatasetMetadata and UpdateFileMetadata to use sourceLastUpdateTime query parameter for optimistic concurrency control.
Which issue(s) this PR closes:
Suggestions on how to test this:
Check test are passing.
Is there a release notes or changelog update needed for this change?:
Yes, added.