Want to talk about soil? Join us for Open Call every Tuesday until Mar. 30 and our kick-off call on this topic on Feb. 2! Click here for details on how to join!

Public Lab Research note

GSOC 2019 wrapup

by vidit | August 26, 2019 12:07 26 Aug 12:07 | #20676 | #20676

GSoC 2019 (Synchronous Image Placement)


To make a synchronous image placement feature (in https://github.com/publiclab/mapknitter) just like google docs. The aim was to make the users collaboratively work on the same map with live changes reflecting on their respective browsers.

Mentor Support

All my mentors Jeff, Aman, Siddharth were very helpful during the entire summer of code period. In the earlier phases I needed a lot of ideas and brainstorming sessions to get my project going. The mentors were always there when I needed any help. Also, this project would not have been possible without @alaxallves 's help. Not only his rails 5 pr but he also helped me with many bug fixes, new ideas, the foreman gem concept and tons of other things as well!! I enjoyed the team work we did to make this project a success. Still some bits and pieces left in this feature although the deployable part is already merged into development branch which soon be released on unstable and finally on production. Can't wait to see that.


Integration of Action Cable and addition of concurrent_editing_channel

My project was dependent on rails 5 or above, so I started building a PR on top of the rails 5 pull request. My first step was to integrate rail's actioncable configuration. Most of the code had to be in a single pull request. Also, created a few channels at the backend (given by actioncable) to handle all the business logic and a few channels at the javascript side to catch and throw events from each browser.

The pr involved the following steps which most probably sums up the entire project:-

  • Used rails' action-cable to create a concurrent_editing_channel.rb which has all the backend logic regarding the channel's connection with various users and broadcasts the various image related changes on this very channel. A basic action setup cable has also been done with files like cable.js, app/assets/javascripts/channels/concurrent_editing.js, etc. These are responsible for handling the broadcasts on the browser.
  • A few changes in Map.js file to update the map on each user's browser as it receives the updated data.
  • Basic connection logic in connection.rb
  • Used the action-cable-testing gem to write tests for actioncable and related features.
  • A few test fixture fixes.

Pull Request: https://github.com/publiclab/mapknitter/pull/805

A few add-ons

The above PR didn't cater for addition and deletion of an image. Added that in this pull request.

Pull Request: https://github.com/publiclab/mapknitter/pull/957


Action Cable testing gem is an awesome gem which gives us some great features for action cable and channel testing. We incorporated this gem in the mapknitter project and wrote tests for the same.

Related files:-



A working prototype of the product


Parts still to be worked:-

Although the part already merged into development branch is deployable but still we need to give user permissions on map like when to turn the live-editing on and so on. Secondly, we need to show the last edit is done by which user (we'll probably do that with the image revisions).

Work going on in:


Documentation and support:-

The most important thing I felt while coding this project was the documentation, since, a lot of additional code was added to the codebase so to explain the action cable flow (a bit complex) with the help of comments and a readme. We can work to improve the language in that readme.



  • Jeffrey Warren
  • Aman jain
  • Sidharth


Certainly it has been a great summer of coding and learning for us. Thanks for being part of my project too @vidit , it was a great experience! Let's keep up the nice work.

Reply to this comment...

Login to comment.