Skip to content

WIP: Socket.io v3 - #4916

Closed
HMarzban wants to merge 21 commits into
ether:developfrom
HMarzban:feat/socket3
Closed

HMarzban wants to merge 21 commits into
ether:developfrom
HMarzban:feat/socket3

Conversation

@HMarzban

@HMarzban HMarzban commented Mar 3, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@JohnMcLear

Copy link
Copy Markdown
Member

Excited to watch the tests run 👯‍♀️

@lgtm-com

lgtm-com Bot commented Mar 3, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 2d08f62 into 0aad3b7 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@JohnMcLear JohnMcLear left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Btw, you can use "draft" pull requests for WIP things :)

Comment thread src/node/handler/PadMessageHandler.js Outdated
Comment thread src/package.json Outdated
Comment thread src/static/js/collab_client.js Outdated
Comment thread src/templates/pad.html Outdated
Comment thread src/templates/pad.html
</script>

<script type="text/javascript" src="../socket.io/socket.io.js?v=<%=settings.randomVersionString%>"></script>
<script type="text/javascript" src="../socket.io/socket.io.js"></script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should not be here :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately I had to remove the random version tag by force, otherwise the socket.io client script would not load!

Comment thread src/tests/backend/common.js Outdated
Comment thread src/tests/backend/specs/socketio.js Outdated
Comment thread src/tests/backend/specs/socketio.js Outdated
Comment thread src/tests/backend/specs/socketio.js
@HMarzban

HMarzban commented Mar 3, 2021

Copy link
Copy Markdown
Contributor Author

If setting.loadTest: true, in most cases the test will fail! ( webaccess issue)
The userCanModify and checkAccess functions in /hooks/express/webaccess.js file, need to modify!

Also, websocket, chat, etc. tests passed successfully! But on the client side, when the user makes new changes, the other client will not receive new changes! (This is the main issue right now)

@lgtm-com

lgtm-com Bot commented Mar 3, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging e1d8b41 into 0aad3b7 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@HMarzban

HMarzban commented Mar 3, 2021

Copy link
Copy Markdown
Contributor Author

From now on, we have to set the transports option on the client and server to io.connect (opt)!
(This branch; src/node/hooks/express/socketio.js:73)

In this case we must have to put settings.socketTransportProtocols in clientVars for "pad.html" (and where necessary) when it's render in the back-end.

@JohnMcLear

Copy link
Copy Markdown
Member

If setting.loadTest: true, in most cases the test will fail! ( webaccess issue)
The userCanModify and checkAccess functions in /hooks/express/webaccess.js file, need to modify!

Also, websocket, chat, etc. tests passed successfully! But on the client side, when the user makes new changes, the other client will not receive new changes! (This is the main issue right now)

This is because the tests mostly don't cover real time collaboration, this is something I'm working on at the moment :)

@lgtm-com

lgtm-com Bot commented Mar 4, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 7fc14d7 into 912f0f1 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@HMarzban

HMarzban commented Mar 4, 2021 •

Copy link
Copy Markdown
Contributor Author

Well, let me drop the mic, the real time collaboration issue was resolved. work like magic ⚔🧝‍♂️

If setting.loadTest: true, in most cases the test will fail! ( webaccess issue)
The userCanModify and checkAccess functions in /hooks/express/webaccess.js file, need to modify!
Also, websocket, chat, etc. tests passed successfully! But on the client side, when the user makes new changes, the other client will not receive new changes! (This is the main issue right now)

This is because the tests mostly don't cover real time collaboration, this is something I'm working on at the moment :)

@lgtm-com

lgtm-com Bot commented Mar 4, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 2f4ef59 into 912f0f1 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@lgtm-com

lgtm-com Bot commented Mar 4, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 5b4c1d9 into 912f0f1 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@lgtm-com

lgtm-com Bot commented Mar 5, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging b39e041 into 4ca989a - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@lgtm-com

lgtm-com Bot commented Mar 5, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 5396be1 into 4ca989a - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

This might be reverted, depending on what happens.
@lgtm-com

lgtm-com Bot commented Mar 6, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging 6af8564 into 4044860 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@HMarzban

HMarzban commented Apr 8, 2021

Copy link
Copy Markdown
Contributor Author

I was reading this changeset recently:
https://socket.io/blog/monthly-update-3/#Socket-IO-v4

If we do this migration, The road is paved for us for further upgrades

@lgtm-com

lgtm-com Bot commented Apr 8, 2021

Copy link
Copy Markdown

This pull request introduces 2 alerts when merging 2e29f23 into a796811 - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class
  • 1 for Unneeded defensive code

@HMarzban

HMarzban commented Apr 8, 2021

Copy link
Copy Markdown
Contributor Author

@webzwo0i Sorry to be late for comments, I was in vacation.

@lgtm-com

lgtm-com Bot commented Apr 8, 2021

Copy link
Copy Markdown

This pull request introduces 1 alert when merging f516d32 into a796811 - view on LGTM.com

new alerts:

  • 1 for Unneeded defensive code

@stale

stale Bot commented Jun 7, 2021

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix Wont Fix these things, no hate. label Jun 7, 2021
@stale stale Bot closed this Jun 14, 2021
@HMarzban

Copy link
Copy Markdown
Contributor Author

Hey guys, have you thought about this PR! I have already fixed all the problems related to this upgrade! do you have a socket upgrade plan or is it necessary anymore?
@JohnMcLear
@webzwo0i

@rhansen

rhansen commented Sep 28, 2021

Copy link
Copy Markdown
Member

Before we can merge this we need to figure out a way to support plugins that expect socket.io 2.x. For example: https://github.com/ether/ep_webrtc/blob/7e5941f4a21ab869a8448ecb771c844643f3ef94/index.js#L46-L48

@rhansen rhansen reopened this Sep 28, 2021
@stale stale Bot removed the wontfix Wont Fix these things, no hate. label Sep 28, 2021
@HMarzban

Copy link
Copy Markdown
Contributor Author

It's okay, I can help you! I change this function like below and it works like a charm!

const handleRTCMessage = (socket, client, payload) => {
  // if(!socketIo) return false
  const userId = payload.from;
  const padId = payload.padId;
  const to = payload.to;

  const msg = {
    type: 'COLLABROOM',
    data: {
      type: 'RTC_MESSAGE',
      payload: {
        from: userId,
        to,
        data: payload.data,
      },
    },
  };
  socketIo.to(padId).emit('RTC_MESSAGE', msg);
};

@rhansen

rhansen commented Sep 30, 2021

Copy link
Copy Markdown
Member

My point is that we need to audit all plugins to determine which ones depend on v2-specific behavior, then update them to work both with and without this PR. Alternatively, change this PR so that the plugins that depend on v2-specific behavior somehow continue to work unchanged.

@stale

stale Bot commented Nov 29, 2021

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix Wont Fix these things, no hate. label Nov 29, 2021
@stale stale Bot closed this Dec 7, 2021
@SamTV12345 SamTV12345 removed the wontfix Wont Fix these things, no hate. label Jan 13, 2024
@SamTV12345

Copy link
Copy Markdown
Member

@HMarzban I know it's been some time since you worked on this pull request. During the last 2.5 years has changed and I am currently the only maintainer of Etherpad. I am looking for help with the upgrade to socket.io v4. So if you find some time it would be awesome if you could help me with the upgrade.
With the help of @JohnMcLear I managed to revive Etherpad, made lots of changes to Etherpad and introduced Typescript to ueberdb. If you prepare a pull request you can be sure that it will be merged. I normally answer in at most one day.

So TDLR: It would be awesome if you could help me with the socket io v4 upgrade.

@SamTV12345 SamTV12345 reopened this Jan 13, 2024
@HMarzban

Copy link
Copy Markdown
Contributor Author

Hi, @SamTV12345

Thank you for reaching out and for keeping Etherpad thriving! It's great to hear about the progress and the introduction of TypeScript to ueberdb.

I'm excited to help with the socket.io v4 upgrade.
(It was a quick, challenging experience last time, but I did it and it worked!)

However, I'm currently swamped with tasks and will be busy until the 2nd of February. But right after that, I'm all in!
I'm looking forward to diving back into the wavy, turbulent ocean of Etherpad code and exploring the best paths for the upgrade.
(I appreciate your patience.)

@SamTV12345

Copy link
Copy Markdown
Member

Hi, @SamTV12345

Thank you for reaching out and for keeping Etherpad thriving! It's great to hear about the progress and the introduction of TypeScript to ueberdb.

I'm excited to help with the socket.io v4 upgrade. (It was a quick, challenging experience last time, but I did it and it worked!)

However, I'm currently swamped with tasks and will be busy until the 2nd of February. But right after that, I'm all in! I'm looking forward to diving back into the wavy, turbulent ocean of Etherpad code and exploring the best paths for the upgrade. (I appreciate your patience.)

Thanks for the help. This is very much appreciated. Yeah the Etherpad code with its hundreds of public methods is a bit overwhelming at least for me. So any help is awesome. Sure it is not a problem if you are currently busy. So until February and thanks for reporting back.

@SamTV12345

Copy link
Copy Markdown
Member

I guess we can finally close this <3

@SamTV12345 SamTV12345 closed this Feb 29, 2024
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.

5 participants