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

feat: rewrite collab server connecting #4881

Merged
merged 8 commits into from Mar 6, 2022
Merged

Conversation

maielo
Copy link
Contributor

@maielo maielo commented Mar 6, 2022

  • Switched to a new collab server

  • Connecting to a collab server is done in two steps now:

    1. get collab server connection details by querying portal.excalidraw.com
    2. connect to the server using the data from step (1)

    This allows us to switch servers etc. more-or-less immediately without having to push things and waiting for all clients to update to latest ServiceWorker (which in many cases takes months or even more).

  • disabled polling socketIO transport (all the browser we support have support for WS)

  • removed preconnecting to our WS server. The optim is not worth the downsides (increasing load on our servers). If needed, we can optimize differently.

@vercel
Copy link

vercel bot commented Mar 6, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

excalidraw – ./

🔍 Inspect: https://vercel.com/excalidraw/excalidraw/2er1P3TS9KSfzm6oKygvRJQiFg6E
✅ Preview: https://excalidraw-git-maielo-getsocketserver-excalidraw.vercel.app

excalidraw-package-example – ./src/packages/excalidraw

🔍 Inspect: https://vercel.com/excalidraw/excalidraw-package-example/FfwtjRYqPHv3zPvYQEtPcGyTwsNj
✅ Preview: https://excalidraw-package-example-git-maielo-getsock-6efa27-excalidraw.vercel.app

@dwelle dwelle changed the title remove preconnect to socket server feat: rewrite collab server connecting Mar 6, 2022
# Conflicts:
#	src/excalidraw-app/collab/CollabWrapper.tsx
@dwelle dwelle merged commit 5ca4f5b into master Mar 6, 2022
@dwelle dwelle deleted the maielo/get_socket_server branch March 6, 2022 21:43
@@ -30,7 +30,25 @@ const generateRoomId = async () => {
return bytesToHexString(buffer);
};

export const SOCKET_SERVER = process.env.REACT_APP_SOCKET_SERVER_URL;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to break everyone that currently uses excalidraw from source with their own specific server. Could we keep supporting both? If REACT_APP_SOCKET_SERVER_URL is set then return it otherwise use REACT_APP_PORTAL_URL instead?

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.

None yet

3 participants