dromse / obsidian-gamified-tasks

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

when history list is empty, recurring feature works buggy. #1

Closed dromse closed 3 months ago

dromse commented 3 months ago

When history list is empty, recurring feature works buggy

Environment

Description

History list must be empty. When recurring task is done, it resets and still persist in tasks list, when second done it become done correctly.

dromse commented 3 months ago

28d16a0 fixed counter resets, but bug with common task is still persist.
I understand that problem is filter function goes before history list updates,
but I cannot understand currently how to fix that. I need to make more deep review with this problem.

dromse commented 3 months ago

Now I found useSyncExternalStore hook from React API, cannot understand how to implement it, but it seems to be helpful for fixing this issue, at first sight.

dromse commented 3 months ago

I think it will be more better solution if I rewrite functionality of parsings to work in plain TS and use custom hooks only for loading lists. I think using parsing and updating value through hooks is too overwhelming.

dromse commented 3 months ago

396d4170e21c9bca1de1a217ddb3116b35b622be I've added live reloading on vault modification. It fixed the issue with history old state, history is used to check if a recurring task is need to show today or not. Also I've rewritten handling of recurring tasks. It resets them before filtering instead of resetting them during it.