-
Notifications
You must be signed in to change notification settings - Fork 10
UpdateDatasetMetadata and UpdateFileMetadata use cases: use sourceLastUpdateTime #379
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, approved
|
Looks good, merging |
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.