Commit graph

37 commits

Author SHA1 Message Date
muxator
dc7e49f89d Remove trailing whitespaces
Hoping to minimize future diffs. Not touching vendorized libraries.
2019-04-16 00:34:29 +02:00
Francois Cassin
2bd698343a Protects against a null atext in cloneAText 2015-11-10 16:21:43 +01:00
Xavid
5e64c292a4 When using setText(), replace the entire existing text of the pad,
rather than replacing all except the last letter.
2015-05-05 14:18:27 -04:00
webzwo0i
c9a5167b41 throw in applyToText and not in applyToAText 2015-02-16 06:27:18 +01:00
webzwo0i
83e1bf0dc4 add semicolons 2015-02-16 03:33:57 +01:00
webzwo0i
440f74b2c1 we do not have the text/padid, but at least we can print the changeset 2015-02-15 15:47:45 +01:00
webzwo0i
b9dd983f81 print the actual text... 2015-02-15 15:27:27 +01:00
webzwo0i
c6ef7f4867 string concat, not multiple arguments... 2015-02-15 15:26:07 +01:00
webzwo0i
1f6a9afae4 better error message 2015-02-15 15:23:43 +01:00
webzwo0i
e7f01fa498 remove unnecessary code; because we have checks in every op now we don't
need this anymore
2015-02-15 15:12:24 +01:00
webzwo0i
ac2c7e9679 add newline counting for - and + op 2015-02-15 15:09:38 +01:00
webzwo0i
b4d4b16b1f off by 1 2015-02-15 14:56:20 +01:00
webzwo0i
4313bd27f8 add a comment to make clear that the string in stringIterator
does not change; only curIndex is increased. Newlines are counted
between curIndex and the end of string.
2015-02-15 13:25:57 +01:00
webzwo0i
c191a8716e totally wrong, introduced by myself in
3354b9406b
the first part is always false so the second part which is always true
in case a cs deleted some lines was never triggered...sigh
2015-02-14 16:41:50 +01:00
webzwo0i
3354b9406b op is ok, if it doesnt include newlines. op is ok, if op.lines is equal to newlines in op.chars 2014-12-27 19:30:02 +01:00
webzwo0i
51c14d9947 check if op.lines is in sync with atext-newlines
Conflicts:
	src/static/js/Changeset.js
2014-12-27 19:28:56 +01:00
webzwo0i
251a75346d make stringIterator aware of newlines 2014-12-27 19:25:14 +01:00
webzwo0i
07a6702363 Revert "be more strict in checkRep"
This reverts commit 22803da42f.
2014-12-27 17:56:20 +01:00
webzwo0i
22803da42f be more strict in checkRep 2014-12-04 16:12:13 +01:00
webzwo0i
10c2f72720 dont remove more lines than exist in the whole text 2014-12-04 16:01:39 +01:00
Dmitry Uvarov
0e6019344e fix for infinite loop on bad changeset 2014-02-20 14:08:49 +04:00
webzwo0i
021db28a02 [Changeset] a?lines_length was not used within inverse function 2013-12-08 17:27:48 +01:00
Luc Didry
3d8452b143 Replace tabs indentation with spaces indentation
Some files are obviously external libraries, I didn't touch them
2013-12-05 08:41:29 +01:00
Marcel Klehr
22e9e5fdcd Merge pull request #1926 from ether/fix/no-connect-to-corrupt-pad
Fix a whole range of bugs related to corrupted changesets
2013-10-10 11:07:37 -07:00
Marcel Klehr
46511d6144 Polish the error messages of the easysync lib 2013-10-10 20:02:13 +02:00
Marcel Klehr
ccf4683558 Easysync: Throw an error if an unknown attrib is referneced 2013-10-10 16:38:16 +02:00
Brian Emerick
e7d8f124ad Issue #1625: Fix to client-side-induced changeset spamming.
THE BUG - HIGH LEVEL:
- When client A sends out an attribute change, client B applies that change to itself but
  also thinks that it made the change itself, which is incorrect. This means that when client B
  next makes a change, he will send out that he made the attrib change that A actually made.
- Ex: Have 2 clients on the same pad. Have A apply bold on some text. Next, have B type a character.
  B will broadcast that it both added a character AND applied bold, when in reality it did NOT
  apply bold at all, that change was done by the other client and this client incorrectly adopted it as its own.
- This root bug behavior results in clients continuing to think that they each made the other client's change,
  thus resulting in an infinite loop of changeset spamming that bogs down clients and harms server stability.

THE BUG - IN DEPTH:
- The root issue is in the way that Changesets are combined in Changeset.follow(). Specifically, in the case of a
  changeset with ONLY new attrib changes (no text changes) being merged with an identity changeset (has no ops).
- In this case, Changeset.follow() copies the ops of the new CS and fully overrides the other CS.
- applyChangesToBase invokes Changeset.follow to determine the final client document CS state after applying the new CS.
  If the final client document CS state is NOT the identity CS, then the client broadcasts that it made a change.
- When client A changes just attribs, client B's applyChangesToBase calls Changeset.follow() and passes client A's
  changeset (attrib change) and Client B's current changeset state (identity).
- As per the noted bug, Changeset.follow() returns client A's changeset as a result, causing client B to adopt
  client A's changeset as its own document state. Thus, client A ends up thinking it has made client B's changes.

THE FIX:
- Changeset.follow() should NOT copy the ops of the new CS passed in if those changes are only attrib changes.
  This allows applyChangesToBase to properly set the client's CS back to the identity after applying an
  external attrib change, instead of incorrectly adopting the external client's changes.
2013-04-24 15:18:25 -07:00
John McLear
4989f56673 undo avoid changeset spam as it breaks functionality 2013-04-15 14:36:25 +01:00
John McLear
bf93500214 some polish for a turd 2013-04-08 19:50:52 +01:00
John McLear
946289c221 temp patch for 1652 2013-04-08 19:46:45 +01:00
Peter 'Pita' Martischka
dcfb1b2ea4 Added missing functions to create pad diffs 2013-01-27 15:40:37 +00:00
Matthias Bartelmeß
3a0015c357 remove unused _opt in favor of code size/readability 2012-07-08 11:51:04 +02:00
Matthias Bartelmeß
8eb43a3ebf replaceing AttributePoolFactory by AttributePool 2012-03-18 09:05:46 +01:00
Chad Weider
ddda347f7a Merge branch 'require-paths' into plugin
Conflicts:
	node/server.js
	src/static/js/Changeset.js
	src/static/js/ace.js
	src/static/js/ace2_common.js
	src/static/js/ace2_inner.js
	src/static/js/broadcast.js
	src/static/js/changesettracker.js
	src/static/js/chat.js
	src/static/js/collab_client.js
	src/static/js/contentcollector.js
	src/static/js/domline.js
	src/static/js/linestylefilter.js
	src/static/js/pad.js
	src/static/js/pad_connectionstatus.js
	src/static/js/pad_docbar.js
	src/static/js/pad_editbar.js
	src/static/js/pad_editor.js
	src/static/js/pad_impexp.js
	src/static/js/pad_modals.js
	src/static/js/pad_savedrevs.js
	src/static/js/pad_userlist.js
	src/static/js/pad_utils.js
	src/static/js/timeslider.js
	src/static/js/undomodule.js
	src/static/pad.html
	src/static/timeslider.html
2012-03-10 15:08:09 -08:00
Egil Moeller
ce5d2d8685 Merge branch 'pita'
Resolved conflicts:
	.gitignore
	src/static/js/ace.js
	src/static/js/ace2_inner.js
	src/static/js/broadcast.js
	src/static/js/domline.js
	src/static/pad.html
	src/static/timeslider.html

Ignored conflicts (please merge manually later):
	node/server.js
	src/node/utils/Minify.js
2012-03-02 22:00:20 +01:00
Egil Moeller
763361a7c9 First stab at getting client side require(plugin/..) to work from within etherpad 2012-02-26 17:48:17 +01:00
Egil Moeller
1239ce7f28 The Big Renaming - etherpad is now an NPM module 2012-02-26 13:07:51 +01:00
Renamed from static/js/Changeset.js (Browse further)