Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronous editing documentation #933

Open
wants to merge 2 commits into
base: synch-editing-tests
Choose a base branch
from

Conversation

ViditChitkara
Copy link
Member

part of #804

@ViditChitkara
Copy link
Member Author

Added some documentation related to the new synchronous editing feature we are introducing. @jywarren @jainaman224

@jywarren
Copy link
Member

jywarren commented Aug 14, 2019 via email

1. The _action-cable-testing_ gem is used for the feature's testing. It has some really
cool testing functionality which was required for our use case.

2. Currently we have separate tests written for connection related features and channel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation should not have words like currently as in future, it will give false negative impressions.
Try to read the document from the view of newbie of MK after 2 years of publishing this doc. Documents are least maintained so we need to be extra careful.


2. The broadcasted data is finally caught by the _received_ function of _app/javascripts/channels/concurrent_editing.js_

3. Finally the _received_ function calls the _synchronizeData_ function to update
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similary finally should be changed or removed

@@ -15,6 +15,10 @@ App.concurrent_editing = App.cable.subscriptions.create("ConcurrentEditingChanne
},

speak: function(changes) {
/* Called when an image is updated from Map.js ('saveImage' function).
* This function calls concurrent_editing_channel.rb's 'sync' method
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't write This.
Reason a new developer writes comments between 18 and 19 LOC then this will become outdated and ambiguous.

@@ -388,6 +388,9 @@ MapKnitter.Map = MapKnitter.Class.extend({
if (this.editing._mode !== "lock") { e.stopPropagation(); }
},

/* Called by the concurrent_editing.js channel's 'received' function (app/assets/javascripts/channels/concurrent_editing.js).
* It recieves a list of updated warpables,i.e. list of images with updated corner points. The aim of writing this function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write name of function instead of pronouns. Change `It'

@@ -275,6 +275,7 @@ def add_tag(tagname, user)
end

def fetch_map_data
# fetches a list of updated warpables along with their corners in a json format.
data = warpables
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uppercase F in fetches

@SidharthBansal
Copy link
Member

I have added a few minor changes to the documentation. It is awesome and perfect already. Just we require to be careful about future prs so written some comments. Please address and squash them in other pr. Close this pr afterwards.
Thanks Vidit for fantastic doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants