{"action":"created","issue":{"url":"https://api.github.com/repos/ether/etherpad-lite/issues/2700","labels_url":"https://api.github.com/repos/ether/etherpad-lite/issues/2700/labels{/name}","comments_url":"https://api.github.com/repos/ether/etherpad-lite/issues/2700/comments","events_url":"https://api.github.com/repos/ether/etherpad-lite/issues/2700/events","html_url":"https://github.com/ether/etherpad-lite/issues/2700","id":89957711,"number":2700,"title":"mismatch error setting raw text in setDocAText","user":{"login":"LaKing","id":2204838,"avatar_url":"https://avatars.githubusercontent.com/u/2204838?v=3","gravatar_id":"","url":"https://api.github.com/users/LaKing","html_url":"https://github.com/LaKing","followers_url":"https://api.github.com/users/LaKing/followers","following_url":"https://api.github.com/users/LaKing/following{/other_user}","gists_url":"https://api.github.com/users/LaKing/gists{/gist_id}","starred_url":"https://api.github.com/users/LaKing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaKing/subscriptions","organizations_url":"https://api.github.com/users/LaKing/orgs","repos_url":"https://api.github.com/users/LaKing/repos","events_url":"https://api.github.com/users/LaKing/events{/privacy}","received_events_url":"https://api.github.com/users/LaKing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-21T20:35:41Z","updated_at":"2015-06-22T09:57:37Z","closed_at":null,"body":"While updating codepad and checking compatibility a bug came up with the recent etherpad version.\r\nIt causes a client-freeze with an endless loading ...\r\n\r\nHere is some sample code:\r\n```javascript\r\nvar padManager = require(\"ep_etherpad-lite/node/db/PadManager\");\r\nvar padMessageHandler = require(\"ep_etherpad-lite/node/handler/PadMessageHandler\");\r\n\r\nexports.padCreate = function(hook, context) {\r\ncontext.pad.setText(\"TEST\");\r\npadManager.getPad(context.pad.id, null, function(err, value) {\r\n    if (err) throw err;\r\n\tpadMessageHandler.updatePadClients(value, function() {});\r\n    });\r\n};\r\n```\r\n\r\nThe error message leads to ace2_inner.js line ~770. \r\n```javascript\r\n    if (rep.alltext != atext.text)\r\n    {\r\n      dmesg(htmlPrettyEscape(rep.alltext));\r\n      dmesg(htmlPrettyEscape(atext.text));\r\n      throw new Error(\"mismatch error setting raw text in setDocAText\");\r\n    }\r\n```\r\nWith the test data above rep.alltext is TES and a newline character, and atext.text is TEST. As it seems, the last character always disappears and a newline character always appears.\r\nThe pad content is just TES\r\n \r\nIs this a bug, Could we fix this?  Or is my method for setting pad text at pad creation incorrect?\r\n"},"comment":{"url":"https://api.github.com/repos/ether/etherpad-lite/issues/comments/114055000","html_url":"https://github.com/ether/etherpad-lite/issues/2700#issuecomment-114055000","issue_url":"https://api.github.com/repos/ether/etherpad-lite/issues/2700","id":114055000,"user":{"login":"JohnMcLear","id":220864,"avatar_url":"https://avatars.githubusercontent.com/u/220864?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnMcLear","html_url":"https://github.com/JohnMcLear","followers_url":"https://api.github.com/users/JohnMcLear/followers","following_url":"https://api.github.com/users/JohnMcLear/following{/other_user}","gists_url":"https://api.github.com/users/JohnMcLear/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnMcLear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnMcLear/subscriptions","organizations_url":"https://api.github.com/users/JohnMcLear/orgs","repos_url":"https://api.github.com/users/JohnMcLear/repos","events_url":"https://api.github.com/users/JohnMcLear/events{/privacy}","received_events_url":"https://api.github.com/users/JohnMcLear/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T09:57:37Z","updated_at":"2015-06-22T09:57:37Z","body":"You said this bug exists in the latest version, did you do regression testing?"}}