Skip to content

RangeError when clearing authorship when line 1 has line attributes #5128

@rhansen

Description

@rhansen

Describe the bug

Clicking the "clear authorship" button throws a RangeError if the first line in the pad has line attributes:

RangeError: selection starts before line start -- {
  errorId: '5DKIM2Ru2LXCJJhLRegR',
  type: 'Uncaught exception',
  msg: 'RangeError: selection starts before line start',
  url: 'http://localhost:9001/p/testing',
  source: 'http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function',
  linenumber: 9390,
  userAgent: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0',
  stack: '_findRowRange@http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function:9390:43\n' +
    'setAttributesOnRange@http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function:9362:39\n' +
    'performDocumentApplyAttributesToCharRange@http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function:1599:30\n' +
    'registerDefaultCommands/<@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:2436:15\n' +
    'registerAceCommand/</<@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:2161:19\n' +
    'wrapper@http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function:646:27\n' +
    'wrapper@http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function:652:9\n' +
    'inCallStack@http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function:365:16\n' +
    'Ace2Inner/editorInfo.ace_callWithAce@http://localhost:9001/static/js/require-kernel.js?v=a88ec0d9 line 226 > Function:657:25\n' +
    'Ace2Editor/this[fnName]<@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:3069:29\n' +
    'action@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:3030:31\n' +
    'pendingInit/<@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:3031:24\n' +
    'registerAceCommand/<@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:2160:13\n' +
    'triggerCommand@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:2167:27\n' +
    'init/</<@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:2103:16\n' +
    'ep_etherpad-lite/static/js/pad_editbar.js/ToolbarItem.prototype.bind/<@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/pad.js?callback=require.define&v=a88ec0d9:2035:15\n' +
    'dispatch@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define&v=a88ec0d9:5478:27\n' +
    'add/elemData.handle@http://localhost:9001/javascripts/lib/ep_etherpad-lite/static/js/ace2_common.js?callback=require.define&v=a88ec0d9:5286:28\n'
}

To Reproduce
Steps to reproduce the behavior:

  1. Create a new pad
  2. Make the first line a bulleted list
  3. Click "clear authorship"
  4. See error

Server (please complete the following information):

  • Etherpad version: Current tip of develop (commit ed6fa94)
  • OS: Ubuntu 20.04
  • Node.js version (node --version): v14.17.2
  • npm version (npm --version): 6.14.13

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser: Firefox
  • Version: 90

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions