[Sugar-devel] Collaboration support for sugar web activities

Daniel Narvaez dwnarvaez at gmail.com
Fri Jan 10 19:34:26 EST 2014

Hi Emil,

first of all, I think having collaboration in sugar-web would be more than
awesome, and I like the idea of using TogetherJS. The main question to me
seems that of the interaction with the existing telepathy stuff.

I must say I'm not very familiar with it, but it's known to not be
reliable. And putting another out-of-process communication layer on top of
dbus feels bad.

So I'm wondering if it would be better to develop this as a separate
collaboration framework, initially targeted at web activities only. I don't
know the mesh view code very well but it seems like that would be the only
place where the two systems would need to interact and merging the two data
sources is, although annoying, probably not rocket science. That would also
allow us to reuse the TogetherJS server.

The only real downside I see is that it doesn't cover the
off-the-school-server case. Though does the current protocol really cover
it, given how unstable it is? I wonder if a low-tech solution would cover
the case more reliably even if not as transparently. Say, the teacher or
one of the students runs the server and the rest connects to it.

On 10 January 2014 21:10, Emil Dudev <emildudev at gmail.com> wrote:

> After a lot of debugging of javascript, I'm finally able to show a small
> preview of what TogetherJS will look like.
> The branches will be at the bottom.
> For testing purposes I've chosen the Get Things Done web activity.
> The first thing I added to GTD was colors, so entries by different users
> can be distinguished. This is probably not the best way, but it's simple.
> When you open the activity, you'll notice a new icon at the top. When you
> click on the icon, TogetherJS will start. You will notice it's panel at the
> right side of the screen. There you should have access to the chat and some
> user options (I've disabled the audio chat).
> After TogetherJS has started, you can go to the network view and invite a
> user. Because this feature is not fully implemented, only the creator will
> be able to invite other users. Also, there will be little to no indication
> of an accepted invite.
> When the other user accepts the invite, GTD will start and TogetherJS will
> start automatically, too. Since it's still in development, Mozilla's public
> hub server is used, and it may take a while for the connection to start.
> With me it takes about 10-15 seconds before the session starts.
> After that, the users can begin collaborating. They can see their pointers
> (I've disabled click indication). The list should be synced. TogetherJS's
> chat is available the entire time.
> Since GTD is simple, it was easy to setup list syncing. The code can be an
> example.
> I've noticed some bugs in my syncing code, but it's nothing big and you
> can still see TogetherJS's capabilities.
> About the code:
> I've implemented only the bare minimum to get my tests working. Full
> support of sugar's invites is needed (indication of accepted invite, list
> of users on the shared activity...).
> The code is full of different kind of notes (mostly TODO ones). This is
> just on this stage.
> About the javascript code: I've added a file collaboration.js, which
> should be the interface between an activity and TogetherJS. The file I've
> created is... not good enough. Probably it would be best to integrate it
> with a Storage element, like it is done in dictstore. I have no idea how
> such an API would look like.
> As noted above, currently Mozilla's hub server is used. I have plans to
> redirect this through telepathy, but I'll probably work on that next week.
> A long email with lots of information. I've probably forgot to mention
> something. If there is something, I'll add it later.
> Changes:
> sugar-toolkit-gtk3:
> https://github.com/edudev/sugar-toolkit-gtk3/tree/collaboration
> sugar: https://github.com/edudev/sugar/tree/collaboration
> gtd-activity: https://github.com/edudev/gtd-activity/tree/collaboration
> togetherjs (This is not needed, it's just to show the changes I've made):
> https://github.com/edudev/togetherjs/tree/sugar
> Regards,
> Emil Dudev
> On Tue, Jan 7, 2014 at 9:52 AM, Emil Dudev <emildudev at gmail.com> wrote:
>> Hello,
>> Thanks to Manuel Quiñones, I was able to check out in detail a Mozilla
>> project - https://togetherjs.org
>> TogetherJS is a javascript library for... well, collaboration.
>> It consists of a client side and a server side.
>> The server side acts only as a bridge between clients and it repeats
>> the messages it recieves. It's nothing complicated, nothing
>> interesting, I'll ignore that for now.
>> Once in a TogetherJS session, users can communicate with each other
>> (there is a chat offered by TogetherJS). User's pointers are also
>> shared (if desired). There also other features like audio chat and
>> video syncing, which are somewhat experimental (by what I understood
>> from the docs).
>> More importantly, except these features, the library comes with an
>> API, which will allow web activity authors to sync different objects
>> from the page. Everything is controlled by javascript.
>> I've already started on integrating TogetherJS with sugar.
>> In order for two users to be in the same session, they must share one
>> togetherjs ID. I've based this ID sharing on telepathy - like the
>> current activity invites are sent.
>> After having the same ID, the session is then supported by the upper
>> mentioned server. Mozilla has offered such a server for public use,
>> but I do not think that sugar should be using it. I think that it
>> would be best if this is handled via telepathy, just like the current
>> activities communicate. As mentioned above, the server has no special
>> role other than receiving messages and sending them to all
>> participating clients.
>> An alternative would be to host such a server for sugar's needs (the
>> server is a single nodejs script). I do not like this way, as it would
>> cause web activities to depend on an Internet connection.
>> I hope that by the end of the week I can show a web activity having
>> collaboration support based on TogetherJS.
>> Regards,
>> Emil Dudev
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel

Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20140111/50806197/attachment.html>

More information about the Sugar-devel mailing list