Skip to content

Write every timestamp through one converter - #93

Merged
estebanzimanyi merged 1 commit into
masterfrom
fix/one-timestamp-converter
Nov 19, 2026
Merged

estebanzimanyi merged 1 commit into
masterfrom
fix/one-timestamp-converter

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Every timestamp MobilityAPI writes goes through one converter, rfc3339 in timestamp.go, in one form: the T separator, fractional seconds when present, and the offset in hours and minutes as the backend stated it (rfc3339Layout), so a UTC instant is +00:00.

The routes it replaces

route wrote a UTC instant as
rfc3339 (timestamp.go): extents, a feature's time, Content-Datetime Z
rfc3339Tz (main.go): the hour-only offsets inside the MF-JSON MobilityDB writes, and the Server-Sent Events +00:00
the timeStamp of a TemporalProperties document (time.RFC3339) Z
the bounds of a Part 4 time window (unixRFC3339), and of a count window, the records' times as received Z

The change

  • rfc3339 writes rfc3339Layout. rfc3339In applies it to every timestamp a JSON document holds; ogcify and the Server-Sent Events stream call it.
  • The time series and trajectory readers call rfc3339; the response time and the window bounds are written in rfc3339Layout, a count window's bounds through rfc3339.
  • rfc3339Tz and its regular expression are removed; its cases are TestATSTimestampsInADocument, against rfc3339In, with a Z instant and a space-separated one added.
  • TestATSTimestampIsRFC3339 and the window-bound expectations of TestMeosWindowBounds and TestMeosTumblingWindow state +00:00.
  • The samples: the 9 timestamps written Z are written +00:00, so all 34 of them carry one form.

Two converters wrote timestamps: rfc3339 in timestamp.go parsed a value
the backend returned and wrote it with Go's RFC 3339 layout, a UTC
instant as Z; rfc3339Tz in main.go completed the hour-only offsets inside
the MF-JSON MobilityDB writes, a UTC instant as +00:00. The response time
of a TemporalProperties document and the bounds of a Part 4 window were
written by a third and a fourth route, as Z, the bounds of a count window
being the records' times as received.

rfc3339 is the one converter, writing an instant with its offset in hours
and minutes as the backend stated it, rfc3339Layout. rfc3339In applies it
to every timestamp a JSON document holds, which ogcify and the Server-Sent
Events stream call; the time series and trajectory readers, the response
time and the window bounds use rfc3339 or rfc3339Layout. rfc3339Tz and its
regular expression are gone, and its test cases are rfc3339In's.

Every timestamp of the samples is written +00:00.
@estebanzimanyi
estebanzimanyi merged commit 91d8e50 into master Nov 19, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the fix/one-timestamp-converter branch November 19, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant