{"action":"created","issue":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/994","repository_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine","labels_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/994/labels{/name}","comments_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/994/comments","events_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/994/events","html_url":"https://github.com/ckeditor/ckeditor5-engine/issues/994","id":240646872,"number":994,"title":"OT: NoOperation and \"no delta\" should be used carefully.","user":{"login":"scofalik","id":1502228,"avatar_url":"https://avatars1.githubusercontent.com/u/1502228?v=4","gravatar_id":"","url":"https://api.github.com/users/scofalik","html_url":"https://github.com/scofalik","followers_url":"https://api.github.com/users/scofalik/followers","following_url":"https://api.github.com/users/scofalik/following{/other_user}","gists_url":"https://api.github.com/users/scofalik/gists{/gist_id}","starred_url":"https://api.github.com/users/scofalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scofalik/subscriptions","organizations_url":"https://api.github.com/users/scofalik/orgs","repos_url":"https://api.github.com/users/scofalik/repos","events_url":"https://api.github.com/users/scofalik/events{/privacy}","received_events_url":"https://api.github.com/users/scofalik/received_events","type":"User","site_admin":false},"labels":[{"id":282736704,"url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/labels/module:model","name":"module:model","color":"fef2c0","default":false},{"id":164253810,"url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/labels/type:bug","name":"type:bug","color":"dd4444","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-05T13:15:14Z","updated_at":"2018-05-15T09:29:12Z","closed_at":"2018-05-15T09:29:12Z","author_association":"CONTRIBUTOR","body":"(Follow-up to: https://github.com/ckeditor/ckeditor5-engine/pull/977)\r\n\r\nLong story short: `NoOperation` (and no delta, that is a `Delta` that has just one or more `NoOperation`s) are dangerous when it comes to OT. We should never change transformed operation to `NoOperation` and transformed delta to \"no delta\".\r\n\r\nSince, at the entry point (`model.Document#transformDeltas`), it is assumed that \"incoming\" deltas are always stronger (whether they come from undo or collaborative editing), we need to check all algorithms if they may return `NoOperation` / \"no delta\" when `context.isStrong == true`.\r\n\r\nThen, we have to check if it is safe to have `NoOperation` as a result at all during operation. From what I've been thinking about it, it should be safe, but maybe there are some complicated cases when it is harmful.\r\n\r\nAlso we need to check whether it is safe to have some deltas with `NoOperation` instead of `MoveOperation`.\r\n\r\n----------------\r\n\r\nHere is an explanation why this change is important. You may read it to have a better understanding of the issue. Consider two following case that might happen in collaborative editing:\r\n\r\n1. User A changes node's attribute `bold` to `true`. Then they change it to `false`.\r\n2. At the same time User B changes node's attribute to `bold`.\r\n3. User B's operation goes to User A and is transformed by \"change `bold` to `true`\". Since both operations are same, User B's operation might be changes to `NoOperation`. But then we lose all the context. In next operation, User A \"reverts\" his change, but User B's operation is already a `NoOperation` and we have no way to get it back to \"change `bold` to `true`\".\r\n\r\nIt's plain that we cannot change transformed operation to `NoOperation` because we are losing information this way. Above example is simple but there might be other cases that went unnoticed."},"comment":{"url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/comments/389103892","html_url":"https://github.com/ckeditor/ckeditor5-engine/issues/994#issuecomment-389103892","issue_url":"https://api.github.com/repos/ckeditor/ckeditor5-engine/issues/994","id":389103892,"user":{"login":"scofalik","id":1502228,"avatar_url":"https://avatars1.githubusercontent.com/u/1502228?v=4","gravatar_id":"","url":"https://api.github.com/users/scofalik","html_url":"https://github.com/scofalik","followers_url":"https://api.github.com/users/scofalik/followers","following_url":"https://api.github.com/users/scofalik/following{/other_user}","gists_url":"https://api.github.com/users/scofalik/gists{/gist_id}","starred_url":"https://api.github.com/users/scofalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scofalik/subscriptions","organizations_url":"https://api.github.com/users/scofalik/orgs","repos_url":"https://api.github.com/users/scofalik/repos","events_url":"https://api.github.com/users/scofalik/events{/privacy}","received_events_url":"https://api.github.com/users/scofalik/received_events","type":"User","site_admin":false},"created_at":"2018-05-15T09:29:11Z","updated_at":"2018-05-15T09:29:11Z","author_association":"CONTRIBUTOR","body":"I think this was already more or less done and I don't recall us having this issue anymore. Also, deltas will be changed to operations soon and this will probably lead to some slight refactor in OT algorithms. I will remember about it then."}}
{"actor":{"display_login":"scofalik"}}