PB-1403: Only update asset timestamp when the underlying file has changed. - #648
Merged
Conversation
benschs
approved these changes
Jun 4, 2026
…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
force-pushed
the
PB-1403-asset
branch
from
June 4, 2026 07:16
c713890 to
0e4d3f5
Compare
This was referenced Jun 9, 2026
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.
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.
The
updatedfield ofAssetobjects is updated when any field is updated. This causes unecessary churn and confusion when hidden metadata are updated.This change ensures the
updatedfield is only updated when thefileorchecksum_multihashfield 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.