kothariji / SyntaxMeets

Syntaxmeets. Create rooms 🏠 Call your friends πŸ‘¬πŸΌ Sip Chai, β˜• Chat, Create, and CodeπŸ‘¨β€πŸ’». A coding platform to code simultaneously πŸš€ with your friends and design your algorithms on SyntaxPad.πŸ’«βœ¨
https://syntaxmeets.vercel.app
MIT License
168 stars 59 forks source link

πŸš€[Feat]: code and illustrations are lost once you refresh #69

Closed simran2607 closed 3 years ago

simran2607 commented 3 years ago

Is your feature request related to a problem? Please describe.

Once you refresh you lose all the code/illustrations and you can't continue from where you left. And you have to join as new member with no old code/illustrations.

Are you willing to contribute to this issue? [Yes/No] Yes

kothariji commented 3 years ago

Hi @simran2607 , great to see you back πŸ™Œ. Thank you so much for taking out time to create this issue πŸš€

Yes, Please go forward to work on this issue, I am assigning this issue to you πŸ”₯.

Also localStorage( ) can play a vital role in this. Do check it out πŸ™Œ

AyushShri commented 3 years ago

Hey @simran2607 , Glad to know you are working on this issue. It would be really great if you solve this issue. Also as the issue sounds interesting to me, I would really like to know the implementation methodology that you have in mind for solving this issue. Please let us know the same! Happy Contributing!

simran2607 commented 3 years ago

Hey @simran2607 , Glad to know you are working on this issue. It would be really great if you solve this issue. Also as the issue sounds interesting to me, I would really like to know the implementation methodology that you have in mind for solving this issue. Please let us know the same! Happy Contributing!

Hey there! implementation involved : an array at server side which stores all the rooms created. Frontend fetches that array. When user refreshes the page, if the room is present, user is reconnected to its room through socket("joinroom",data) where data is users name and roomId (stored in local-storage) and code is generated from previous users.

Happy contributing!

AyushShri commented 3 years ago

Hey @simran2607 , after quickly going through your strategy, I have few doubts about your methodology-

simran2607 commented 3 years ago

If a user join then his name and room-id are stored in his local storage. And if reconnects his name and room-id will be used to connect him again as a new user. The user won't be redirected to home page ... And will be connected back . In this process, authentication is not needed

And link will not be able to join any user whose local storage doesn't contain his name and room-id. And room-ids are generated automatically, so unless u have it u can't join it.