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

Version the communication protocol and prevent connection when client and server had breaking comms changes #17

Open
whisperity opened this issue Dec 30, 2022 · 0 comments
Labels
Kind: Enhancement 🔮 New feature or request Target: Communication protocol 💬⚠️ A part of the core library which deals with client-server messaging Target: Core 💥 Core architectural support library

Comments

@whisperity
Copy link
Owner

whisperity commented Dec 30, 2022

A lot of currently pending issues (#2, #5, #12, #14) will require changes to the communication protocol which would be backwards-incompatible. This would be the perfect moment to introduce, into the comms, a stable way of the server and the client discussing the versions of the protocol used. There should be a soft warning in case the server and the client are not the same binaries (string comparing Version::whatever), and a hard error preventing communication if the API had breaking changes.

The API version should be versioned in a single global location in the code. A single unsigned number is enough... and we will hopefully keep updating it each time the communication layer changes.

An alternative solution would be creating a hash, at compile-time, from the most important and critical parts of the communication library. However, that would be too brittle and sensitive to refactoring changes in the source code itself that are irrelevant to the actual API at hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Enhancement 🔮 New feature or request Target: Communication protocol 💬⚠️ A part of the core library which deals with client-server messaging Target: Core 💥 Core architectural support library
Projects
None yet
Development

No branches or pull requests

1 participant