Skip to content

Allow non UTC lastUpdateTimestamp#12350

Closed
stevenwinship wants to merge 2 commits into
developfrom
12349-fix-update-metadata-not-assuming-utc-timestamp
Closed

Allow non UTC lastUpdateTimestamp#12350
stevenwinship wants to merge 2 commits into
developfrom
12349-fix-update-metadata-not-assuming-utc-timestamp

Conversation

@stevenwinship

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Which issue(s) this PR closes:#12349

Special notes for your reviewer:

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

@stevenwinship stevenwinship self-assigned this Apr 21, 2026
@github-actions github-actions Bot added the Type: Bug a defect label Apr 21, 2026
@stevenwinship stevenwinship moved this to In Progress 💻 in IQSS Dataverse Project Apr 21, 2026
@stevenwinship stevenwinship added Size: 3 A percentage of a sprint. 2.1 hours. FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) labels Apr 21, 2026
@coveralls

coveralls commented Apr 21, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 24.9% (+0.02%) from 24.881% — 12349-fix-update-metadata-not-assuming-utc-timestamp into develop

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:12349-fix-update-metadata-not-assuming-utc-timestamp
ghcr.io/gdcc/configbaker:12349-fix-update-metadata-not-assuming-utc-timestamp

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@landreev

landreev commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

I may be missing something, but I'm not sure if this is the right way to address the issue.
We do NOT want to allow "non UTC lastUpdate timestamps". The method should never see any timestamps other than in UTC (with the "Z"). That's how Dataverse reports them, regardless of where the system lives. And from what I understand, in the workflow for which the API is designed, this timestamp will always come from the output of our APIs.
For example, in the context of the test in FilesIT.java, it will be the output of /api/files/<id>, with something like

        "dataFile": {
             ...
            "publicationDate": "2026-04-20",
            "directoryLabel": "data/subdir1",
            "lastUpdateTime": "2026-04-20T20:25:05Z",
            "fileAccessRequest": true
         }

So, the way the format was hardcoded in validateInternalTimestampIsNotOutdated(), as

DateUtil.parseDate(sourceLastUpdateTime, "yyyy-MM-dd'T'HH:mm:ss'Z'")

was in fact correct - I think it's fair to reject any other formats there. What was not correct was that it was parsed ignoring the time zone completely, so it defaulted to local. But it just needs to force the UTC, aka "+00:00" - and then everything will just work. I think?

if (date == null) {
LocalDateTime dtIN = null;
try {
dtIN = sourceLastUpdateTime != null ? LocalDateTime.parse(sourceLastUpdateTime, DateTimeFormatter.ISO_OFFSET_DATE_TIME) : null;

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.

DateTimeFormatter.ISO_INSTANT is what we want here, I believe.
That will force the "2011-12-03T10:15:30Z"-like format; and the resulting date will be parsed as UTC.

@stevenwinship stevenwinship removed their assignment Apr 22, 2026
@stevenwinship stevenwinship moved this from In Progress 💻 to Done 🧹 in IQSS Dataverse Project Apr 22, 2026
@stevenwinship

Copy link
Copy Markdown
Contributor Author

Closing

@stevenwinship
stevenwinship deleted the 12349-fix-update-metadata-not-assuming-utc-timestamp branch April 22, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 21 FY26 Sprint 21 (2026-04-08 - 2026-04-22) Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Fix update time stamp check to not assume UTC

3 participants