Mohitur669 / Realtime-Collaborative-Code-Editor

A real-time code editor built with Node.js, React.js and Socket.io which provides a range of powerful features like instant synchronization of code changes. Every team member has access to the most up-to-date version of the code. Automatic syntax highlighting (currently JavaScript only) optimize code readability, themes allow personalization.
GNU General Public License v3.0
43 stars 12 forks source link

toast-notification-count issue #1

Closed Mohitur669 closed 1 year ago

Mohitur669 commented 1 year ago

Known Bugs

Note: The number of toast notification increases more and more if more users join and leaves the room.

Note: If you find any other bugs, please let me know. I will try to fix it as soon as possible :) In case you want to fix it yourself, feel free to make a pull request.

Mohitur669 commented 1 year ago
  1. To solve the toast notification count remove the React strict app component, just normally pass the component in the index.js
  2. After solving that issue an undefined object is showing up on the connected users' screen if a user leaves. To solve this create a check for undefined users like this,
    socketRef.current.on(ACTIONS.DISCONNECTED, ({ socketId, username }) => {
    if(username){
        toast.success(`${username} left the room`);
        setClients((prevClients) => {
            return prevClients.filter(client => client.socketId !== socketId);
        });
    }
    });
Mohitur669 commented 1 year ago

The issues are fixed after applying the above patches.

dilpreetkaur03 commented 1 year ago

Code is not running? Socket connection failed. Try again is there what to do

Mohitur669 commented 1 year ago

Code is not running? Socket connection failed. Try again is there what to do

This is the latest working code provided on github. You need to follow the steps given in readme. Don't you forgot to run server and client. P.S: This whole code is tested only locally.

monishsoorya31 commented 7 months ago

After creating and joining the room, sometimes later a popup says "Socket connection failed" and the room closes automatically, how can I resolve the problem?

Mohitur669 commented 7 months ago

After creating and joining the room, sometimes later a popup says "Socket connection failed" and the room closes automatically, how can I resolve the problem?

Are you testing this in localhost?

monishsoorya31 commented 7 months ago

yes I'm testing in local host

Mohitur669 commented 7 months ago

use npm instead of yarn

monishsoorya31 commented 7 months ago

thanks I'll try

monishsoorya31 commented 7 months ago
Screenshot 2024-03-09 at 5 26 20 PM
monishsoorya31 commented 7 months ago

same error occured

Mohitur669 commented 7 months ago

same error occured

The problem is occurring because you have to run node server.js and npm start into different terminals. Both should be running at the same time.

monishsoorya31 commented 7 months ago

i have tried bro but still same problem

Mohitur669 commented 7 months ago

sent you a connection req in LinkedIn .. message a google meeting link there

monishsoorya31 commented 7 months ago

https://meet.google.com/pko-einq-dvv

rajatsharma979 commented 1 week ago

How did you implemented synchronization of code? Did you use OT libraries like ShareDB, OT.js?