-
Notifications
You must be signed in to change notification settings - Fork 20
Use sourceLastUpdateTime in Update Dataset and File Metadata #842
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
Use sourceLastUpdateTime in Update Dataset and File Metadata #842
Conversation
…Time in file metadata updates
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 implements optimistic concurrency control for dataset and file metadata editing by replacing internal version numbers with last update timestamps. The changes prevent concurrent editing conflicts by using the sourceLastUpdateTime query parameter to ensure users are editing the most recent version of the metadata.
- Replaces
datasetInternalVersionNumberparameter withdatasetLastUpdateTimeacross all dataset metadata forms - Updates file metadata editing to include
datasetLastUpdateTimefor concurrency control - Adds
lastUpdateTimefield toDatasetVersionmodel for tracking version timestamps
Reviewed Changes
Copilot reviewed 50 out of 52 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/dataset/domain/models/Dataset.ts | Adds lastUpdateTime field to DatasetVersion model |
| src/sections/shared/form/DatasetMetadataForm/index.tsx | Replaces datasetInternalVersionNumber prop with datasetLastUpdateTime |
| src/sections/edit-file-metadata/EditFilesList.tsx | Adds datasetLastUpdateTime prop for file metadata concurrency control |
| src/files/domain/useCases/editFileMetadata.ts | Updates to accept sourceLastUpdateTime parameter |
| tests/component/sections/shared/dataset-metadata-form/DatasetMetadataForm.spec.tsx | Updates test cases to use datasetLastUpdateTime instead of internalVersionNumber |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/sections/collection/featured-items/custom-featured-item-card/CustomFeaturedItemCard.tsx
Show resolved
Hide resolved
packages/design-system/src/lib/components/rich-text-editor/RichTextEditor.tsx
Show resolved
Hide resolved
…eLastUpdateTime-in-update-dataset-metadata
ChengShi-1
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
…eLastUpdateTime-in-update-dataset-metadata

What this PR does / why we need it:
Adds a mechanism to avoid two users updating same dataset version metadata and also same file metadata version.
Usese sourceLastUpdateTime query param for optimistic concurrency control. Depends on this js-dataverse PR.
Which issue(s) this PR closes:
Suggestions on how to test this:
Step 1: Run the Development Environment
./run-env.sh unstable.Step 2:
Test the concurrency control in edit dataset metadata page.
Test the concurrency control in edit file metadata page.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No.
Is there a release notes or changelog update needed for this change?:
Yes, added.