Discussion:
GSOC 2014: Update : Interactive LyX (version-ing)
Sushant Raikar
2014-06-23 16:43:02 UTC
Permalink
Link to Patch:

https://gist.github.com/HotSushi/1b8b5086405be091ee86

Introducing Version : This patch introduces version-ing in document.

Date: 23-June-2014

Previous Patch: vehicle.patch (Updated to provide features below)

Author: Sushant Raikar

Note: Ignore all printf's, they are added temporarily for debugging
purpose, and will be removed once the patch is finalized.

Working:
If there is a laggy connection, the documents at the 2 ends may not always
be in the same state. So a LFUN, by the time it reaches the other end, may
have to be dispatched on a different state of document, hence leading to
ambiguity. In order to handle this, a document is given a version. And each
LFUN is targeted at a specific version of document.

A history table is maintained which tracks cursor change after any LFUN
dispatch. When a remote LFUN is received, it is adjusted based on the
history (to predict where the cursor should be in the latest revision).
Naturally,if one cursor position is behind another 'editing' cursor
position, it is unchanged. If it is in front, then it has to be adjusted.

Another important point to note is that, the LFUNs for cursor
movements(move-right, move-left) are not sent to remote, only the important
editing LFUNs (ex character insert, delete, table insert etc) are sent
along with the cursor position where they are dispatched. This approach
provides several advantages:
- unnecessary version change
- less network traffic
- immune to different window sizes (LFUNs for mouse_click,home, end, pageup
etc. will work)

Features:
* local cursor moves based on remote dispatch (unlike in previous patch
where local cursor was staying stationary)
* History queue added, each LFUN sent over dispatches on the targeted
version of the document (consistency)
* adjusting of cursor based on history queue (neglect changes due to self)
* 2 DocIterator's can be subtracted and added back.
* each client is identified by a client_id

Shortcomings:
* no version synchronization. When client connects their buffer is in
'version 0'. All incoming LFUNs are adjusted from version 0.
How to handle, at certain time the two ends should synchronize, and the
cursor will have to be adjusted from version i, instead of 0. (less looping)

* doesn't handle when editing takes place at same cursor location at both
ends.
How to handle, each client is prioritized, higher priority client stays in
its location, lower priority client moves.
Tommaso Cucinotta
2014-06-24 08:14:02 UTC
Permalink
Hi Sushant,

thanks for the status report. As recently you also got a LyX gsoc repo (gsoc/sushant), did you also commit and push the patch(es) below to that repo?

T.
Post by Sushant Raikar
https://gist.github.com/HotSushi/1b8b5086405be091ee86
Introducing Version : This patch introduces version-ing in document.
Date: 23-June-2014
Previous Patch: vehicle.patch (Updated to provide features below)
Author: Sushant Raikar
Note: Ignore all printf's, they are added temporarily for debugging purpose, and will be removed once the patch is finalized.
If there is a laggy connection, the documents at the 2 ends may not always be in the same state. So a LFUN, by the time it reaches the other end, may have to be dispatched on a different state of document, hence leading to ambiguity. In order to handle this, a document is given a version. And each LFUN is targeted at a specific version of document.
A history table is maintained which tracks cursor change after any LFUN dispatch. When a remote LFUN is received, it is adjusted based on the history (to predict where the cursor should be in the latest revision). Naturally,if one cursor position is behind another 'editing' cursor position, it is unchanged. If it is in front, then it has to be adjusted.
- unnecessary version change
- less network traffic
- immune to different window sizes (LFUNs for mouse_click,home, end, pageup etc. will work)
* local cursor moves based on remote dispatch (unlike in previous patch where local cursor was staying stationary)
* History queue added, each LFUN sent over dispatches on the targeted version of the document (consistency)
* adjusting of cursor based on history queue (neglect changes due to self)
* 2 DocIterator's can be subtracted and added back.
* each client is identified by a client_id
* no version synchronization. When client connects their buffer is in 'version 0'. All incoming LFUNs are adjusted from version 0.
How to handle, at certain time the two ends should synchronize, and the cursor will have to be adjusted from version i, instead of 0. (less looping)
* doesn't handle when editing takes place at same cursor location at both ends.
How to handle, each client is prioritized, higher priority client stays in its location, lower priority client moves.
Tommaso Cucinotta
2014-06-24 08:16:43 UTC
Permalink
Post by Tommaso Cucinotta
Hi Sushant,
thanks for the status report. As recently you also got a LyX gsoc repo (gsoc/sushant), did you also commit and push the patch(es) below to that repo?
Forgot to add: this is the git log output, so it would be good to know what the relationship is among these pushed patches, and the ones you mentioned on your HotSushi github repo.

Thanks,

T.

commit e0c907a9
Author: Sushant Raikar <***@gmail.com>
Date: Tue Jun 3 11:48:18 2014 +0530

LFUN Holder added

commit 1e1c6104
Author: Sushant Raikar <***@gmail.com>
Date: Mon Jun 2 11:30:50 2014 +0530

answer was so simple

commit 6a16a92b
Author: Sushant Raikar <***@gmail.com>
Date: Sat May 31 10:26:56 2014 +0530

works for simple text

commit 3eba3d4d
Author: Sushant Raikar <***@gmail.com>
Date: Wed May 21 09:42:56 2014 +0530

added files

commit 37b7cad3
Author: Sushant Raikar <***@gmail.com>
Date: Mon May 5 14:46:27 2014 +0530

finally workinggit add src/frontends/qt4/GuiView.cpp

commit d2af2584
Author: Sushant Raikar <***@gmail.com>
Date: Fri May 2 12:51:55 2014 +0530

patch v3

commit 173fe9dc
Author: Sushant Raikar <***@gmail.com>
Date: Fri May 2 12:42:54 2014 +0530

patch v2

commit 4c71fd2b
Author: Sushant Raikar <***@gmail.com>
Date: Fri May 2 12:17:48 2014 +0530

Copied contents of Tommaso's Patch

Loading...