lumoe / obsidian-rollover-daily-todos

An obsidian plugin that rolls over todo items from the previous daily note
MIT License
271 stars 67 forks source link

When creating a journal for the first time, rollover occurs, but then it is automatically deleted #55

Closed ku-zhen closed 1 year ago

ku-zhen commented 2 years ago

describe:

When I use the "Periodic Notes" plug-in to create a journal based on the template, rollover occurs , but it will be automatically deleted.

shortcuts:

https://user-images.githubusercontent.com/61906420/188256472-ef17dedf-de17-49b2-a5f5-3c194ad1946f.mp4

lumoe commented 1 year ago

Hi @wuzhen97, can you please give me a more detailed explanation on your issue?

tim-hilt commented 1 year ago

@lumoe I think this can be closed as stale.

gypsyav commented 1 year ago

I have this same issue.

When I create a new daily note the todos from the previous day will rollover and move to the new daily note but then they are immediately deleted. I have used the built in file recovery plugin to confirm this, it has an entry for the new daily note that includes the rolled over todos.

This happens no matter how I create the new daily note; whether I use the Quick Add plugin, click the button on the command ribbon, or click today's date on the calendar from the Calendar plugin.

Rolling over the todos manually works without issue.

I'm not sure this matters but I frequently have daily notes created for the future because I use them to keep track of my upcoming agenda. I know the plugin won't work for future dates and that I have to invoke it manually when I get to those days, the issue I'm running into is when I create a note for today. Perhaps the plugin sees the future dates and tries to roll over the tasks?

My settings: Periodic Notes Format: YYYY/MM - MMM/YYYY-MM-DD ddd Template: 000-Metadata/10-Templates/Daly Note - Template.md Note Folder: Daily Notes

Rollover Daily Todos Template Heading: ## Carried Over Tasks Delete todos from previous day: true Remove emply todos in rollover: true Rollover children of todos: true

lumoe commented 1 year ago

@gypsyav Are you using the Templater plugin?

gypsyav commented 1 year ago

@gypsyav Are you using the Templater plugin?

Yes, I am. I use Templater to get today's date for the completed tasks section. I have one button created by the buttons plugin, some custom CSS styling to add columns, and a few Tasks plugin code blocks.

The rollover is triggered and does occur, as I have an entry for the current note listed in file recovery, but it immediately deletes all todos once they are rolled over.

This is my daily note template:

🗒️ Notes


Projects

button-newcoloringpage

[!column|no-t]

[!info|no-t c-red]

Backlog

not done
tags include project
tags do not include in_progress
hide recurrence rule
hide task count

[!info|no-t c-red]

In Progress

not done
(tags include in_progress) OR (status.type is IN_PROGRESS)
hide recurrence rule
hide task count

Carried Over Tasks


New Tasks


Completed Tasks

done
done on <% tp.date.now("YYYY-MM-DD", 0, tp.file.title, "YYYY-MM-DD") %>
hide recurrence rule
hide priority
hide done date
heading does not include agenda 

Agenda

tim-hilt commented 1 year ago

Then it might be a duplicate of #63

EDIT: hold up - for your template, it should theoretically work as you are not using templated headings. I think that there is a race condition between templater and our plugin. Maybe adding a small delay before rolling over automatically fixes the issue.

gypsyav commented 1 year ago

I can confirm it's an incompatibility with Templater's "Trigger Template on New File Creation" setting. The rolled over Todo's are deleted if this setting is turned on, whether there is templater code in the note or not.

This is what I tried and the results: Templater, trigger template on new file creation both enabled, templater code in note: Todos are deleted Templater, trigger template on new file creation both enabled, no templater code in note: Todos are deleted

Templater enabled, trigger template on new file creation disabled, templater code in note: Todos roll over properly Templater enabled, trigger template on new file creation disabled, no templater code in note: Todos roll over properly Templater disabled, templater code in note: Todos roll over properly Templater disabled, no templater code in note: Todos roll over properly

Hope this helps

tim-hilt commented 1 year ago

Thanks for your testing efforts and the writeup! It helps to localize your issue, but I don’t know a solution yet.

ianscottknight commented 1 year ago

I am having this issue as well. It is really annoying that I can't even hit undo and get the deleted tasks back. I end up needing to go retrieve them from my Github backup.

lumoe commented 1 year ago

Hi there,

I've just pushed a new release that introduces the option to disable the automatic rollover when creating the daily file.

For those utilizing the Templater plugin, ensure you turn off the automatic rollover feature within the Daily Rollover Settings tab. You can then manually roll over the to-dos via the provided command.

Currently, this approach ensures optimal compatibility and avoids potential conflicts with the Templater plugin.