Skip to content

PB-1403: Only update asset timestamp when the underlying file has changed. - #648

Merged
adk-swisstopo merged 1 commit into
developfrom
PB-1403-asset
Jun 4, 2026
Merged

PB-1403: Only update asset timestamp when the underlying file has changed.#648
adk-swisstopo merged 1 commit into
developfrom
PB-1403-asset

Conversation

@adk-swisstopo

Copy link
Copy Markdown
Member

The updated field of Asset objects is updated when any field is updated. This causes unecessary churn and confusion when hidden metadata are updated.

This change ensures the updated field is only updated when the file or checksum_multihash field is updated. This also adds a test to verify the timestamp is not updated when the description is updated.

This PR is branched from another refactoring PR which is being reviewed separately.

@boecklic boecklic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

…nged.

The `updated` field of `Asset` objects is updated when any field is updated.
This causes unecessary churn and confusion when hidden metadata are updated.

This change ensures the `updated` field is only updated when the `file` or
`checksum_multihash` field is updated.

This also adds a test to verify the timestamp is not updated when the
description is updated.
@adk-swisstopo
adk-swisstopo merged commit 6c09501 into develop Jun 4, 2026
3 checks passed
@adk-swisstopo
adk-swisstopo deleted the PB-1403-asset branch June 4, 2026 07:31
adk-swisstopo added a commit that referenced this pull request Jun 9, 2026
In #648 we modified Asset triggers
such that `etag` and `updated` fields are only updated when the underlying file
is modified. However we later determined that `etag` should be updated when any
field is updated.

This change splits the trigger into two: one for the timestamp and one for the
ETag. We make the ETag trigger unconditional and update the tests accordingly.
@adk-swisstopo adk-swisstopo added the feature New feature or enhancement label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants