undomodule: disallow undoing "clear authorship colors"

Clearing the authorship colors of a document with at least two authors, and then
undoing that action caused a disconnect from the pad.
This change disallows undoing clearing authorship colors in order to prevent
the problem from affecting users, and adds the relative test coverage.

This is a change of behaviour, and is documented in the changelog.

Fixes #2802 (sidestepping it).
This commit is contained in:
John McLear 2020-04-07 00:39:43 +02:00 committed by muxator
parent ffc718e8c0
commit babf67175c
8 changed files with 90 additions and 4 deletions

View file

@ -932,7 +932,7 @@ async function handleClientReady(client, message)
await Promise.all(authors.map(authorId => {
return authorManager.getAuthor(authorId).then(author => {
if (!author) {
messageLogger.error("There is no author for authorId:", authorId);
messageLogger.error("There is no author for authorId: ", authorId, ". This is possibly related to https://github.com/ether/etherpad-lite/issues/2802");
} else {
historicalAuthorData[authorId] = { name: author.name, colorId: author.colorId }; // Filter author attribs (e.g. don't send author's pads to all clients)
}