Timezone fix in validateInternalTimestampIsNotOutdated()#12355
Merged
ekraffmiller merged 2 commits intodevelopfrom Apr 28, 2026
Merged
Timezone fix in validateInternalTimestampIsNotOutdated()#12355ekraffmiller merged 2 commits intodevelopfrom
ekraffmiller merged 2 commits intodevelopfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
It's still working with the server living on GMT (it just passed Jenkins tests). |
Contributor
Author
|
The simplest fix would be just this: ... no need really to mess with the incoming ISO 8601 string. |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
be405f7 to
0d5883d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
stevenwinship
approved these changes
Apr 27, 2026
Contributor
|
I tested this in my local environment by changing the timezone to eastern in docker compose, as described. I reproduced it in the unstable image (created a dataset, then attempted to edit, which failed). I switched to the PR image and Edit Dataset worked. |
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.
What this PR does / why we need it:
In the intended API workflow the client using the
sourceLastUpdateTimeparameter would be reusing the timestamps obtained from the output of other Dataverse APIs, like/versionsand/files, where they are always reported in UTC, ISO 8601-formatted. (with the "Z", for ex.:2026-04-22T14:30:00Z; regardless of where the server lives).This format is specified as required in the guides.
However, the scheme appears to work only if the server happens to live in GMT and save the timestamps in the database that are already UTC.
That happens to be the case with Jenkins, beta, qa and docker instances (and that's how the bug stayed unnoticed for a year). But it becomes a problem on servers that use different time zones. Such as our "real" servers, demo.dataverse.org and dataverse.harvard.edu that live in US Eastern. (It was confirmed that file metadata could not be updated in the SPA on demo because of this)
Which issue(s) this PR closes:
Special notes for your reviewer:
The simplest, minimalist fix would be 3 characters total: change
yyyy-MM-dd'T'HH:mm:ss'Z'toyyyy-MM-dd'T'HH:mm:ssX. i.e., from "ignore the literal 'Z'" to "parse ISO 8601 time zone", which recognizes "Z" as "+0000".But I added some comments and rewrote a few sentences that describe the parameter in the API guide.
Branch rebased to squash the commits.
Suggestions on how to test this:
Testing is straightforward, you just need a Dataverse instance operating in a non-GMT time zone. If you have a working Payara etc. setup installed locally on your computer, then you are all set. Unless you live in London, etc.
If you are testing with a Docker environment, you should be able to configure it to run in US Eastern by adding this to your
docker-compose-dev.yml:Rebuild your Docker env. completely from scratch.
I recommend to make sure to reproduce the actual bug in 6.10.1 and current develop; as there were some conflicting reports on how easy that was.
It should be possible to test the bug, and the fix by simply making the 2 API calls involved directly. The best way however is probably to run one of the RestAssured tests that cover the functionality, for example
The failure would look something like this in the output:
Note that the time stamp described in the API error as "outdated" appears strikingly identical to the actual
lastUpdateTimein the output of the GET API right above.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: