cabal-club / cable

A lightweight peer-to-peer chat protocol.
https://cabal.chat
75 stars 4 forks source link

post header: move timestamp to be header field 5 #12

Closed cblgh closed 1 year ago

cblgh commented 1 year ago

was spending the morning getting reacquainted with the spec and a facet of the post types stood out to me. timestamp is present in all posts, but the position it has in a post depends on the message type. e.g. for post/text it is field 7, after channel_size + channel, while for post/delete it is field 5, after the post header's always present 4 fields.

since it seems reasonable that any type of post will contain timestamp information, i think we should make it part of the post header as header field 5. imo this could make it easier for implementors, since its position doesn't arbitrarily shift depending on the particular post type—consistency 👌

hackergrrl commented 1 year ago

This makes sense to me. Worst case for posts that don't use timestamp is one wasted byte.