1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-08 07:22:04 +00:00

Pass option to encode range

To ensure backwards compat with clients not refreshing, pass a flag to enable
encoding.  This way, old client won't receive encoded ranges, but also won't
have decoding logic. The flag can then be removed once all clients are up to
date
This commit is contained in:
Alasdair Smith 2017-09-21 14:23:39 +01:00
parent b33929fa83
commit e2bb6dcecb

View file

@ -252,7 +252,7 @@ define [
_joinDoc: (callback = (error) ->) ->
if @doc?
@ide.socket.emit 'joinDoc', @doc_id, @doc.getVersion(), (error, docLines, version, updates, ranges) =>
@ide.socket.emit 'joinDoc', @doc_id, { encodeRanges: true }, @doc.getVersion(), (error, docLines, version, updates, ranges) =>
return callback(error) if error?
@joined = true
@doc.catchUp( updates )
@ -260,7 +260,7 @@ define [
@_catchUpRanges( changes, comments )
callback()
else
@ide.socket.emit 'joinDoc', @doc_id, (error, docLines, version, updates, ranges) =>
@ide.socket.emit 'joinDoc', @doc_id, { encodeRanges: true }, (error, docLines, version, updates, ranges) =>
return callback(error) if error?
@joined = true
@doc = new ShareJsDoc @doc_id, docLines, version, @ide.socket