dromse / obsidian-gamified-tasks

Gamify your task management with rewards system, craft your tasks by tags.
MIT License
29 stars 1 forks source link

[Bug]: Unwanted parsing and stringification count at editing task #12

Closed dromse closed 2 months ago

dromse commented 3 months ago

What happened?

When grind manger is open and I want to write count to my task in open note, it starts to parse and broke task a little.

Steps to reproduce

Plugin Version

1.0.6

Obsidian Version

1.5.12

What platform are you seeing the problem on? (Can be multiple)

Linux, Android

Relevant log output

No response

Additional questions

dromse commented 3 months ago

It requires to research why task stringification happens at all. But it's not big bug, just annoying sometimes.

dromse commented 2 months ago

I discover that bug appear in recurring mode: https://github.com/dromse/obsidian-grind-manager/blob/35388b11f5e098f59f8556febecd1cb342ac1620/src/hooks/useTasks/index.ts#L113-L128

Problem:updateTask executes permanently regardless of needs to reset recurring task. Because of it, when we add #every tag and start to edit task in our note it triggers vault modification, which triggers filter update, which triggers resetting recurring task, which trigger updateTask constantly 😅. Therefore it starts to parse middlewares and stratifying it back by order: https://github.com/dromse/obsidian-grind-manager/blob/35388b11f5e098f59f8556febecd1cb342ac1620/src/hooks/useTasks/consts.ts#L91-L99

Steps to solve a problem: Move updateTask inside if statement to trigger only on reset tasks.