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

Toggling a task with done date overwrites the done date when toggling task via clicking on the checkbox #3136

Open
2 of 7 tasks
ilandikov opened this issue Oct 21, 2024 · 2 comments
Labels
scope: data integrity Problems that may cause loss or corruption of user data type: bug Something isn't working

Comments

@ilandikov
Copy link
Collaborator

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

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

Steps to reproduce

  • let's assume that today is 2024 Oct 20th.
  • set global filter to #task
  • add the following task line: - [ ] #task with done date in the past, but not completed yet ✅ 1970-01-01
  • in reading mode or in dynamic mode click on the task's checkbox to complete it

Expected Behavior

  • the task will be completed keeping the done date that was in the line before completion

Current behaviour

  • the done date is overwritten with today's date

Which Operating Systems are you using?

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

Obsidian Version

1.7.4

Tasks Plugin Version

7.11.1+ (d732bbb)

Checks

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

Possible solution

This happens in case when in the edit task modal I input the done date to a date previous that today and forget to change the status to done.

@ilandikov ilandikov added the type: bug Something isn't working label Oct 21, 2024
@claremacrae claremacrae changed the title Toggling a task with done date overwrites the done date Toggling a task with done date overwrites the done date when toggling task via clicking on the checkbox Oct 21, 2024
@claremacrae claremacrae added the scope: data integrity Problems that may cause loss or corruption of user data label Oct 21, 2024
@claremacrae
Copy link
Collaborator

claremacrae commented Oct 21, 2024

I think we need start being smarter about all these consistency checks.

  • So far we've implemented a bunch of consistency checks in the Edit Task modal.
  • This introduces the need for consistency checks in the toggle-checkbox code.
  • And later there will likely be reports of inconsistencies in the toggle command...
  • And in the documentation, we have a page on Find tasks with potentially invalid data - meaning that users need to set up their own searches for invalid data - and remember to update their searches every time we add support for a new field.
  • Also, there is currently no way to report to users, when parsing all tasks in the vault, that they have any task lines with problems, such as tasks with invalid dates.

I think it's time to consider stopping fixing these piecemeal, and instead introducing an abstraction for errors and warnings on task date data - and then making the commands, modal and similar, use that abstraction.

So that when we add a new check, all the locations benefit from this simultaneously.

@ilandikov
Copy link
Collaborator Author

I think this is a great idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: data integrity Problems that may cause loss or corruption of user data type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants