surrealdb.js icon indicating copy to clipboard operation
surrealdb.js copied to clipboard

Compatibility check on connect

Open netcodedev opened this issue 1 year ago • 5 comments

Switching from beta 8 to beta 9 caused a lot of trouble which made me think that it might be nice if the library had some type of compatibility check when connecting to the server.

netcodedev avatar Apr 12 '23 16:04 netcodedev

Hi @netcodedev, while I like your suggestion, keep in mind that surrealdb is still in beta! There was a slight hickup because of a change in the websocket protocol. I patched it first thing this week after easter and we put out the v0.6.0 release of the library Tuesday evening.

Once a stable 1.0.0 release is out the protocol will stay backwards compatible until a new major release. Hope that helps!

Edit: would also like to add: I don't think there is actually an endpoint to check the version of surrealdb as of now

kearfy avatar Apr 13 '23 10:04 kearfy

Hi @kearfy Thank you for your quick reply. While I still mostly agree and of course know that surrealdb is still in beta I hope you may still keep this suggestion in mind. As you already mentioned the protocol will stay backwards compatible, but only until a new major release. But this is exactly the situation where things might break and imo it would slightly improve DX if there was some kind of notice that an outdated library version might cause trouble when connecting to an updated instance of surrealdb.

Anyways thank you for your work on this great project 💕

netcodedev avatar Apr 13 '23 10:04 netcodedev

We will definitely keep it in mind, if a method get's created for this in the protocol we can always reconsider!

kearfy avatar Apr 13 '23 10:04 kearfy

Seems like an API for checking the version is already implemented after all, I'll get this implemented soon for a check probably between 1.0.0-beta.8 and 2.0.0

AKA; it might still break during the development before 1.0.0, but should be solid afterwards!

kearfy avatar Apr 13 '23 11:04 kearfy

Great to hear!

netcodedev avatar Apr 13 '23 11:04 netcodedev