Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTFS Realtime Stop Time Updates Timestamp type #537

Open
lolpro11 opened this issue Feb 7, 2025 · 4 comments
Open

GTFS Realtime Stop Time Updates Timestamp type #537

lolpro11 opened this issue Feb 7, 2025 · 4 comments

Comments

@lolpro11
Copy link

lolpro11 commented Feb 7, 2025

Introduce yourself

No response

Ask a question

The message StopTimeEvent has a time field that is int64. Is there any use for this? If not, can we transition into a uint64 spec for the time field? This would be more uniform across all other timestamp fields in the GTFS Realtime Spec.

Other timestamp fields in GTFS-RT, all as uint64

@IvanVolosyuk
Copy link

I'm pretty sure it will be a breaking change due to encoding differences of sint64 and int64 in protobuf wire format.

@lolpro11
Copy link
Author

lolpro11 commented Feb 8, 2025

I'm pretty sure it will be a breaking change due to encoding differences of sint64 and int64 in protobuf wire format.

I understand, but I don't think there is anyone using this format using negative timestamps. That is the question I am asking: is there anyone using GTFS-RT with message StopTimeEvent having a negative timestamp? Also, what uses would int64 have vs uint64?

@skinkie
Copy link
Contributor

skinkie commented Feb 8, 2025

I think it comes from the fact that a unix timestamp is an signed 64bit value, because it may describe the period before 1970. Now I would completely agree that it does not make sense that the designer of GTFS-RT would ever consider describing realtime data before 1970 a thing. That having said, I don't even think protobuf is remotely smart enough to do useful things with respect to limitations in the serialisation. Otherwise minimum and maximum values in other fields would have created more optimal serialisations.

@IvanVolosyuk
Copy link

IvanVolosyuk commented Feb 9, 2025

I'm pretty sure it will be a breaking change due to encoding differences of sint64 and int64 in protobuf wire format.

I understand, but I don't think there is anyone using this format using negative timestamps. That is the question I am asking: is there anyone using GTFS-RT with message StopTimeEvent having a negative timestamp? Also, what uses would int64 have vs uint64?

Well, I guess I confused sint64 and int64 in protobuf. Both use varint encoding and changing from sint64 to uint64 will produce different results due to zigzag encoding, thus that would be a breaking change. Changing from int64 to uint64 should be mostly harmless on wire format. It might break compilation of programs using those changed definition though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants