johannesjo / super-productivity

Super Productivity is an advanced todo list app with integrated Timeboxing and time tracking capabilities. It also comes with integrations for Jira, Gitlab, GitHub and Open Project.
http://super-productivity.com
MIT License
11.39k stars 885 forks source link

IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 41 is larger than the node's length (27). #3104

Closed rzelnik closed 5 months ago

rzelnik commented 6 months ago

Steps to Reproduce

  1. I tried to add multi-line subtasks from a text file. Example:
    set color of titles and names in menu to
    color #434343;

    Error Log (Desktop only)

Console Output

Meta Info

META: SP8.0.1 Electron – sk – Linux x86_64 – Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) superProductivity/8.0.1 Chrome/120.0.6099.227 Electron/28.2.0 Safari/537.36

Stacktrace

Error: Failed to execute 'setStart' on 'Range': The offset 41 is larger than the node's length (27).
    at n._insertAtCursorChromium (file:///snap/superproductivity/1878/resources/app.asar/dist/main.2271e764c39109d8.js:1:1873387)
    at n._insertAtCursor (file:///snap/superproductivity/1878/resources/app.asar/dist/main.2271e764c39109d8.js:1:1872555)
    at e.onpaste [as __zone_symbol__ON_PROPERTYpaste] (file:///snap/superproductivity/1878/resources/app.asar/dist/main.2271e764c39109d8.js:1:1871907)
    at HTMLDivElement.pt (file:///snap/superproductivity/1878/resources/app.asar/dist/polyfills.8db5726c6ae16cfe.js:1:11666)
    at U.invokeTask (file:///snap/superproductivity/1878/resources/app.asar/dist/polyfills.8db5726c6ae16cfe.js:1:7290)
    at Object.onInvokeTask (file:///snap/superproductivity/1878/resources/app.asar/dist/main.2271e764c39109d8.js:1:4187193)
    at U.invokeTask (file:///snap/superproductivity/1878/resources/app.asar/dist/polyfills.8db5726c6ae16cfe.js:1:7211)
    at it.runTask (file:///snap/superproductivity/1878/resources/app.asar/dist/polyfills.8db5726c6ae16cfe.js:1:2646)
    at B.invokeTask [as invoke] (file:///snap/superproductivity/1878/resources/app.asar/dist/polyfills.8db5726c6ae16cfe.js:1:8349)
    at tt (file:///snap/superproductivity/1878/resources/app.asar/dist/polyfills.8db5726c6ae16cfe.js:1:21088)

Actions Before Error

1711374095190: [Persistence] Save to DB (3) 
1711374096185: [Task] Add time spent 
1711374096191: [Project] Update Work End 
1711374096194: [Tag] Update Work End for Tag 
1711374096202: [Persistence] Save to DB (3) 
1711374097512: [Task] Add time spent 
1711374097523: [Project] Update Work End 
1711374097525: [Tag] Update Work End for Tag 
1711374097529: [Persistence] Save to DB (3) 
1711374098184: [Task] Add time spent 
1711374098186: [Project] Update Work End 
1711374098188: [Tag] Update Work End for Tag 
1711374098192: [Persistence] Save to DB (3) 
1711374099184: [Task] Add time spent 
1711374099187: [Project] Update Work End 
1711374099188: [Tag] Update Work End for Tag 
1711374099193: [Persistence] Save to DB (3) 
1711374100677: [FocusMode] Set focus session elapsed time 
1711374100871: [SP_ALL] Load(import) all data 
1711374100878: [SP_ALL] All Data was loaded 
1711374100907: [WorkContext] Set Active Work Context 
1711374100925: [Task] SetSelectedTask 
1711374101043: [Bookmark] Load Bookmark State 
1711374101045: [Project] Load Project related Data Success 
1711374101053: [Improvement] Clear Hidden Improvements 
1711374101055: [Improvement] Delete multiple Improvements 
1711374129038: [Task] Update Task 
1711374129052: [Persistence] Save to DB 
1711374138025: [Task] Add SubTask 
1711374138028: [Persistence] Save to DB
github-actions[bot] commented 6 months ago

Thank you very much for opening up this issue! I am currently a bit overwhelmed by the many requests that arrive each week, so please forgive me, if I fail to respond personally. I am still very likely to at least skim read your request and I'll probably try to fix all (real) bugs if possible and I will likely review every single PR being made (please, give me a heads up if you intent to do so) and I will try to work on popular requests (please upvote via thumbs up on the original issue) whenever possible, but trying to respond to every single issue over the last years has been kind of draining and I need to adjust my approach for this project to remain fun for me and to make any progress with actually coding new stuff. Thanks for your understanding!

Jagdfalke commented 6 months ago

I could reproduce this issue with the current desktop version 8.0.1. Pasting the example multi-line text instantly crashes the app.

It does not occur when either the semicolon or the hashtag (or both) are missing from the pasted text.