obsidian-tasks-group / obsidian-tasks

Task management for the Obsidian knowledge base.
https://publish.obsidian.md/tasks/
MIT License
2.35k stars 224 forks source link

Completing a daily recurring task creates task set to same day [the day before Australian clocks switch to daylight savings] #2309

Open sofie-bird opened 11 months ago

sofie-bird commented 11 months ago

Please check that this issue hasn't been reported before.

Expected Behavior

On tasks that repeat every day, completing the task should create a new task with the started / scheduled / due date incremented by 1.

Current behaviour

On tasks that repeat every day, and are scheduled for the current day, completing the task creates a new task with the same started / scheduled / due date.

This only occurs if the scheduled (or due or started) date is set to today (if it's set in the future or the past, expected behaviour occurs). It only occurs when the recurring setting is "every day". ("every 2 days", "every week" etc produce expected behaviour).

I have reproduced this on two separate vaults in Windows and iPad (obsidian 1.4.8) that run different plugins, as well as a brand new vault running only Tasks plugin.

Steps to reproduce

  1. In an Obsidian note, with Tasks in the default plugin configuration (ie no settings changed after install), create a task that recurrs every day and is scheduled for today. For example, if the date is the 30th of September:
- [ ] test πŸ” every day ⏳ 2023-09-30
  1. Click the checkbox to complete the task The task is completed and a new task appears above it with the same scheduled date.
- [ ] test πŸ” every day ⏳ 2023-09-30
- [x] test πŸ” every day ⏳ 2023-09-30  βœ… 2023-09-30

Which Operating Systems are you using?

Obsidian Version

1.4.14

Tasks Plugin Version

4.8.1

Checks

Possible solution

No response

claremacrae commented 11 months ago

Hi @sofie-bird, thanks for using Tasks, and for a very clear bug report.

FYI, I've tweaked the formatting of your report, so that the task lines can be copied and pasted in to markdown docs.

Can't reproduce the problem

I'm really puzzled by this, as I complete tasks like this, on their scheduled date all the time.

So I just tried the following steps:

  1. Create a brand new vault
  2. Install and Enable Tasks
  3. Create a new note
  4. Paste in this following line, with Shift held down
- [ ] test πŸ” every day ⏳ 2023-09-30
  1. Switch to Reading mode
  2. Toggle the task

Today's date is 2023-09-30

I get the correct result:

- [ ] test πŸ” every day ⏳ 2023-10-01
- [x] test πŸ” every day ⏳ 2023-09-30 βœ… 2023-09-30

Related issue reports

I've just re-read the following report...

It sounds like it might be similar to yours.

However, they were never able to reproduce it and we ended up closing it unresolved.

What is different about our setup?

To summarise:

So, whilst it does look like there is an issue, if I cannot reproduce it, there is nothing I can do to fix it.

So all I think of is to try to figure out what, if anything, is different in your new vaults from mine.

  1. What timezone are you in, if I may ask? I'm in:

British Summer Time UK (GMT+1)

  1. Check that the emoji have been read correctly.

The thing is, the recurring field is recognised, so I don't think this is the problem, as Tasks reads data from right to left, stopping when it reaches unrecognised text.

But what happens when you edit the original task? Can you please confirm that you see the same as this:

image

That screenshot confirms that both the emojis and their values were read correctly by Tasks.

sofie-bird commented 11 months ago

Thanks for the prompt response.

I can confirm the task appears correctly (as in your screenshot) in the task editor -- I tested tasks created both manually and using the editor, both had the issue. It is correctly reading the emojis.

My timezone is AEST (UTC +10) Possibly relevant as you're asking about timezones: tomorrow I switch into AEDT (UTC + 11) because we go into daylight savings. Might that explain why this suddenly turned up for me and can't be easily reproduced elsewhere? Perhaps I should re-test the issue tomorrow after my timezone has changed.

Edit - having read that original ticket, I note it's the same timezone, and the date of the issue (Oct 1 2022) was the day before we switched into daylight savings.

claremacrae commented 11 months ago

Edit - having read that original ticket, I note it's the same timezone, and the date of the issue (Oct 1 2022) was the day before we switched into daylight savings.

Good spot...

Since that last ticket was written, (I believe) I now understand how to set timezones in the Tasks automated tests.

So assuming that you confirm it's OK tomorrow, then when I have time, I can add some tests to confirm the problem.

I've no idea how much work it will be to fix it, so can't promise when a fix might be released...

claremacrae commented 11 months ago

I've updated the title of both issues to indicate what you've worked out, @sofie-bird ... thanks.

sofie-bird commented 11 months ago

I tested this morning and I have found that:

So it seems like the current system time is not a factor, something about calculating the date across the timezone-change when entering daylight savings (eg 3am becomes 4am) is causing the issue.

No worries on the timeline of the fix, conveniently I have a plugin right here to set myself a reminder for why some tasks might play up October 5 next year :D

claremacrae commented 11 months ago

Hi Sophie,

That's brilliant - super helpful. Thanks for your understanding, too...

brianmay commented 11 months ago

Confirm that I have the same problem here. As @sofie-bird said, the current system time doesn't appear to be important. In my case, I set both the due date and scheduled dates, and it is the due date that seems to be important.

claremacrae commented 11 months ago

Thanks Brian. Yes, for recurring tasks it’s the Due date that has the highest priority in deciding the next date.