grey-software / toonin

Technology that allows you to tune in to your friends and family in realtime using peer-to-peer sharing.
https://toonin.grey.software
MIT License
67 stars 6 forks source link

Distributed Streaming System #146

Closed Lakshya2610 closed 4 years ago

Lakshya2610 commented 4 years ago

144 #142 #141 #140

Refer to the issues above to get an idea of how the system works. Main Features,

Fixes #71

I've added a checkbox on the extension to toggle this system for a room and have marked it "Experimental". This system needs a lot of testing to understand the different kind of scenarios that could occur. It works as of now with the limited testing I was able to do. But since the goal of this system is to scale, we need to test this with high no. of clients to understand pros and cons of this system

Next Steps for this:

Lakshya2610 commented 4 years ago

Forgot to mention, Since there are a lot of changes on every end of the app, I've made sure that all 3 parts of the app work just fine with older version of of one another as long as you don't use the new features (Trying to create a room with distributed streaming with older backend code would cause the backend to crash. But this isn't a big deal because the new version of backend works with older version of extension/client, so we can update the backend right away)

Lakshya2610 commented 4 years ago

If you want to test the disconnect functionality, the easiest way would be to change the max client per node size to 1 on the backend and connect a few devices/tabs. This would essentially create a linked list. Then try removing a node in between to test how the system handles a node leaving. Just a heads-up, when a node leaves, all of its children nodes (and their children nodes) experience a tiny stutter in playback due to the gap in re-connection process. It's pretty minimal most of the time but it's there.

Lakshya2610 commented 4 years ago

The reconnection process for a failure hasn't been tested yet. I just implemented it. I'm not sure how to simulate WebRTC connection failures

Lakshya2610 commented 4 years ago

Codacy has raised many issues related to generic object injection. It's blocking the PR merge at the moment. We can think of a way to fix it or wait until we move our code over to Typescript, which would take care of it automatically.

https://web.archive.org/web/20150430062816/https://blog.liftsecurity.io/2015/01/15/the-dangers-of-square-bracket-notation

One way we could do it in standard JavaScript is to create a class to hold the list of rooms instead of using an Object.

ArsalaBangash commented 4 years ago

Codacy has raised many issues related to generic object injection. It's blocking the PR merge at the moment. We can think of a way to fix it or wait until we move our code over to Typescript, which would take care of it automatically. https://web.archive.org/web/20150430062816/https://blog.liftsecurity.io/2015/01/15/the-dangers-of-square-bracket-notation

One way we could do it in standard JavaScript is to create a class to hold the list of rooms instead of using an Object.

I think that would be best then. It's a slight pain but it'd greatly improve our code quality score and make the transition to Typescript more graceful.

ArsalaBangash commented 4 years ago

I think we've done a good job addressing a bunch of code quality issues. There's still quite a bit of generic object injection we have to address, so I've opened up a separate issue for it. For now, I'll merge this PR with admin privelages.