dtinit / data-transfer-project

The Data Transfer Project makes it easy for platforms to build interoperable user data portability features. We are establishing a common framework, including data models and protocols, to enable direct transfer of data both into and out of participating online service providers.
https://dtinit.org/docs/dtp-what-is-it
Apache License 2.0
3.55k stars 486 forks source link

bugfix: use correct time; fix brittle unit test #1336

Closed jzacsh closed 4 months ago

jzacsh commented 4 months ago

this is fixing a single time-mishandling issue that uncovered two orthogonal problems:

[a]: https://developers.google.com/photos/library/reference/rest/v1/mediaItems#mediametadata lists creationTime as:

string (Timestamp format)

Time when the media item was first created (not when it was uploaded to Google Photos).

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

[b]: local unit test failure looked like this for me (I'm in midwest US):

org.opentest4j.AssertionFailedError:
    expected: <Mon Oct 02 22:33:38 UTC 2023>
    but was: <Mon Oct 02 22:33:38 CDT 2023>