ivan-lednev / obsidian-task-archiver

Archive completed tasks in your Obsidian vault (plus other org-mode-like features)
MIT License
109 stars 12 forks source link

RANGE ERROR #58

Closed tumber43 closed 1 year ago

tumber43 commented 1 year ago

When I run the plugin to move the completed tasks to a header on the same page or a different note altogether... it removes the tasks but they do not move to the header or the new note, they appear to simply be deleted. I'm definitely triggering the move and not the delete command. I do receive an error: "RangeError Invalid position -1 in document" with a length parameter listed. It is a complex Task note with a recurring task and about a page and a half long. Thoughts?

I experimented with simplifying the Task note, but the only way I could get the error to go away was to remove all existing tasks and then create brand new tasks. When I did that and triggered the Archive Tasks, it moved the completed tasks to the Header section properly and did not throw the error. The test Tasks were simple and didn't have indented subtasks or recurrence. Is that the issue?

Weirdly, there is nothing in the Console when the error occurs.

tumber43 commented 1 year ago

Heeeey, suddenly started working. :) Not sure what changed. Maybe the old tasks were formed incorrectly and I worked out the bad ones.