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

Upgrade Socket.IO to v4 #660

Merged
merged 4 commits into from
Jan 3, 2024
Merged

Upgrade Socket.IO to v4 #660

merged 4 commits into from
Jan 3, 2024

Conversation

davidmz
Copy link
Member

@davidmz davidmz commented Dec 23, 2023

Changed

  • FreeFeed server now uses Socket.IO v4 for realtime messaging. The previous versions of Socket.IO clients (v2 and v3) are also supported.

@davidmz davidmz requested a review from indeyets December 23, 2023 19:21
@indeyets
Copy link
Contributor

@davidmz Is there any chance we can test for compatibility with legacy socket.io client here? You replaced client library as well, so tests rely on modern client, which is suboptimal

@davidmz
Copy link
Member Author

davidmz commented Dec 28, 2023

Well, I can try using both clients in tests and run them twice, with v2 and v4 clients. If we guarantee v2 support, it's something we should do, but that would slow down the tests a lot, of course.

But actually, I upgraded the server first and ran all the tests with the old client. And only then I updated the client in the tests.

@indeyets
Copy link
Contributor

Will npm/yarn allow us to have 2 versions at the same time?

I think we MUST have v2 client now, but we should not guarantee compatibility with v3/v4 immediately. It can be in experimental status initially.

Then at some point we will start to support v4 officially and deprecate v2. then we can release a major version which breaks compatibility

@davidmz
Copy link
Member Author

davidmz commented Dec 28, 2023

Yes, AFAIK, it is possible in Yarn using aliases.

Let's try it and see effect on test times.

@davidmz
Copy link
Member Author

davidmz commented Dec 28, 2023

Really, I thought it would be difficult to duplicate all the tests. But we don't have so many real-time operations: we have subscribe/unsubscribe, authorization, and something else. And receiving messages. All of this can be tested separately, in a small test.

We can leave the main tests on v2, and test compatibility with v4 separately and minimally.

@indeyets indeyets merged commit 4116c5c into stable Jan 3, 2024
12 checks passed
@indeyets indeyets deleted the upgrade-socketio branch January 3, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants