Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'When done' causing wrong done date #2867

Closed
3 of 7 tasks
Azurewren opened this issue May 31, 2024 · 9 comments · Fixed by #2919
Closed
3 of 7 tasks

'When done' causing wrong done date #2867

Azurewren opened this issue May 31, 2024 · 9 comments · Fixed by #2919
Assignees
Labels
scope: recurrence Anything to do with recurring/repeating tasks status: in progress At least a partial implementation exists, either work-in-progress or some implementation ideas type: bug Something isn't working

Comments

@Azurewren
Copy link

Azurewren commented May 31, 2024

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

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

When I check the below task as done by clicking the check field, it should add today's done date (2024-05-31) and create the recurring task.

- [ ] 🦷 Dentist Check up Appointment 🔁 every 6 months when done ⏳ 2024-05-31

which would turn into:

- [x] 🦷 Dentist Check up Appointment 🔁 every 6 months when done ⏳ 2024-05-31 ✅ 2024-05-31
- [ ] 🦷 Dentist Check up Appointment 🔁 every 6 months when done ➕ 2024-05-31 ⏳ 2024-11-30

Current behaviour

When checked, the task adds yesterday as it's completion date instead.

- [x] 🦷 Dentist Check up Appointment 🔁 every 6 months when done ⏳ 2024-05-31 ✅ 2024-05-30
- [ ] 🦷 Dentist Check up Appointment 🔁 every 6 months when done ➕ 2024-05-31 ⏳ 2024-11-30

I have tried it without the 'when done' words in the recurrence rule and it works correctly.

Steps to reproduce

  1. I have been able to reproduce this in sandbox vault with only Tasks installed

Maintainer's note: See #2867 (comment) for reproduction steps.

Which Operating Systems are you using?

  • Android
  • iPhone/iPad
  • Linux
  • macOS
  • Windows

Obsidian Version

1.6.1 (Insider Release), Installer version 1.5.3

Tasks Plugin Version

7.3.0

Checks

  • I have tried it with all other plugins disabled and the error still occurs

Possible solution

No response

@Azurewren Azurewren added the type: bug Something isn't working label May 31, 2024
@claremacrae
Copy link
Collaborator

What time zone was the computer/device set to?

What time of day did you observe the problem?

@claremacrae claremacrae added question Further information is requested scope: recurrence Anything to do with recurring/repeating tasks labels May 31, 2024
@claremacrae
Copy link
Collaborator

First thought: I am wondering whether this might be the underlying cause:

Perhaps some calculation involved in the ‘when done’ code is unintentionally editing a date value.

A test would need to written to demonstrate the problem behaviour - hence asking for time and time zone info.

@Azurewren
Copy link
Author

What time zone was the computer/device set to?

What time of day did you observe the problem?

I am in +0800 timezone (Perth/Australia) and it was about 2pm in the afternoon.

Trying it in a sandbox vault today (2024-06-01, ~10.30am, same timezone above) and apparently it has decided to work correctly.

I wonder if there is a problematic connection between the Recurrence Date of the newly created task and the Completion date of the old task?

@claremacrae claremacrae removed the question Further information is requested label Jun 2, 2024
@claremacrae
Copy link
Collaborator

Steps to reproduce

  1. I have been able to reproduce this in sandbox vault with only Tasks installed

For future reference, it really helps with development if there are actual steps listed to reproduce the bug, instead of having to gather information from other parts of the ticket....

@claremacrae claremacrae changed the title 'When done' causing wrong completion date 'When done' causing wrong done date Jun 26, 2024
@claremacrae
Copy link
Collaborator

Steps to reproduce

  1. Install and enable the Tasks plugin (tested with Tasks 7.5.0)
  2. Edit the Tasks settings:
    • Enable 'Next recurrence appears on the line below'
  3. Paste the following line in to any Markdown note:
- [ ] #task 🦷 Dentist Check up Appointment ⏳ 2024-05-31 🔁 every 6 months when done
  1. Put the cursor in that line and run Tasks: Create or edit task
    • Change the status to Done
    • Paste 2024-05-31 in to the Done date field
    • Click Apply

Expected result:

  • #task 🦷 Dentist Check up Appointment 🔁 every 6 months when done ⏳ 2024-05-31 ✅ 2024-05-31
  • #task 🦷 Dentist Check up Appointment 🔁 every 6 months when done ⏳ 2024-11-30

The Done date should be ✅ 2024-05-31, which is the supplied value.

Actual result:

  • #task 🦷 Dentist Check up Appointment 🔁 every 6 months when done ⏳ 2024-05-31 ✅ 2024-05-30
  • #task 🦷 Dentist Check up Appointment 🔁 every 6 months when done ⏳ 2024-11-30

The Done date is a day earlier than the specified value.

Note:

Repeating with this line gives the correct result:

- [ ] #task 🦷 Dentist Check up Appointment ⏳ 2024-05-31 🔁 every 6 months

Removing the when done gives the correct result in this case.

@claremacrae
Copy link
Collaborator

Thanks, I did wonder... It seems to be the only time-zone that features regularly...

It doesn't depend on timezone after all...

I can reproduce it in UTC and Current UK (BST) time zones.

I am now pretty sure the cause is an instance of this:

@claremacrae claremacrae added the status: in progress At least a partial implementation exists, either work-in-progress or some implementation ideas label Jun 26, 2024
@claremacrae claremacrae self-assigned this Jun 26, 2024
claremacrae added a commit that referenced this issue Jun 27, 2024
@claremacrae
Copy link
Collaborator

Hi @Azurewren, huge thanks for reporting this!

It will be fixed in the next release....

@claremacrae
Copy link
Collaborator

Just released in Tasks 7.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: recurrence Anything to do with recurring/repeating tasks status: in progress At least a partial implementation exists, either work-in-progress or some implementation ideas type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants