* [Galene] Heads up: incompatible changes to protocol
@ 2022-12-18 19:09 Juliusz Chroboczek
0 siblings, 0 replies; only message in thread
From: Juliusz Chroboczek @ 2022-12-18 19:09 UTC (permalink / raw)
This is just to warn people that Galene's protocol will bump its version
within the next weeks. The current status is as follows:
- the server in the master branch speaks protocol 1;
- the servers in the branch "stateful-token" speaks protocol 2;
- the Android client speaks both protocols.
I am not planning to implement any compatibility code on the server side;
on the other hand, I will maintain compatibility with protocol 1 on the
client side for at least a couple versions.
Changes in protocol 2
Dates are now encoded as strings in RFC 3339 format rather than numbers;
numbers can be used to specify relative dates ("so many milliseconds from
now"), which avoids issues with incorrect client-side clocks.
Error messages may now contain a machine-readable, stable identifier in
the "error" field in addition to the human readable string in the "value"
field. This makes it possible for the client to react to server-side
messages without having to parse the (human-readable) error message.
Some errors have become non-fatal, they indicate that an action has not
been taken without dropping the connection. Together with the previous
change, this makes it possible for a client to gracefully recover from an
error, most notably if a feature is not implemented by the server.
There is one new group action and one new user action, used for stateful
tokens (similar to Zoom invites). This part of the protocol is still in
What do you need to do?
## If you're a user
If you're only using the web client, there's nothing to do. If you're
using the Android client, you should upgrade to a version from 16 December
Upgrade to a version of the protocol.js library dated 16 December or later.
The type of the "onchat" and "onusermessage" has changed, the "time" field
is now a "Date" object instead of an integer. You may convert it to an
integer by using the "getTime" method.
## If you're speaking the protocol directly
Ensure that you send "[2,1]" in the version field in the handshake message
to the server, indicating that you speak both versions. Accept server
handshakes with either version "" or "".
When parsing dates in "chat", "chathistory" and "usermessage" messages,
make sure that you accept both integer dates (in protocol 1) and strings
simply use the "Date" constructor, in Python, you may use the
"datetime.fromisoformat" method, and in Go, use "time.RFC3339".
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-18 19:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-18 19:09 [Galene] Heads up: incompatible changes to protocol Juliusz Chroboczek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox