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

task add recur:daily due:10 wait:6 foobar causes task list to hang indefinitely #3444

Open
jemorriso opened this issue May 6, 2024 · 6 comments
Labels
topic:recurrence type:bug Something isn't working

Comments

@jemorriso
Copy link

To report a bug...

  • What command(s) did you run?

task add recur:daily due:10 wait:6 foobar

  • What did you expect to happen?

The goal was to add a daily task that recurs at 10am.

  • What actually happened?

task list hangs and thousands of tasks are created while it hangs.

Screenshot 2024-05-06 at 3 27 22 PM
  • Paste the output of the task diag command.
task 3.0.2
   Platform: Darwin

Compiler
    Version: Apple LLVM 15.0.0 (clang-1500.3.9.4)
       Caps: +stdc +stdc_hosted +LP64 +c8 +i32 +l64 +vp64 +time_t64
 Compliance: C++17

Build Features
      CMake: 3.29.2
    libuuid: libuuid + uuid_unparse_lower
 Build type: Release

Configuration
       File: /Users/jerry/.taskrc (found), 1469 bytes, mode 100644
       Data: /Users/jerry/.task (found), dir, mode 40755
    Locking: Enabled
         GC: Enabled
    $EDITOR: nvim
Hooks
     System: Enabled
   Location: /Users/jerry/.task/hooks
             (-none-)

Tests
   Terminal: 252x117
       Dups: Scanned 8450 tasks for duplicate UUIDs:
             No duplicates found
 Broken ref: Scanned 8450 tasks for broken references:
             No broken references found

Running task delete will go through the tasks one by one and delete them but it takes forever if there are thousands of them. What would the effect be of deleting the rows in the tasks table? I didn't try this because I see there are other tables referencing that data, but could that be a 'last resort' way of recovering?

Thanks!

@djmitche
Copy link
Collaborator

djmitche commented May 7, 2024

Hm, that sounds like a bug in the recurrence! I've never used bare integers for due or wait - do those always parse as hours of the day?

As for recovering from this -- deleting the tasks without deleting the corresponding operations will leave your DB inconsistent, which will cause issues later. One option may be task export, filtering with a text editor, and task import?

@jemorriso
Copy link
Author

Hi, so if you run task add foobar due:10, it will fail silently, and then when you do task list you get "'10' is not a valid date in the '' format".

So I think for some reason this error is causing the recurrence to attempt to add the task over and over again. I did try a task export but all it did was print an open bracket to the json file.

I was able to get out of this by doing task undo a number of times until task list doesn't hang.

@jemorriso
Copy link
Author

Also, using the bare integer was just a newbie error, I did task add recur:daily due:10:00 wait:6:00 foobar and everything worked fine

@djmitche
Copy link
Collaborator

djmitche commented May 9, 2024

Hm, sounds like we have a validation issue on date/time properties, then, where we accept bare integers but then later complain about them.

@mukesh4iitb
Copy link

I have an extended question on this and looking forward to your opinion on this.

I am trying to schedule a task for habit, which should follow the following:
1- It should schedule daily with a due date 11:59 PM
2- When the due date is over, it should not been shown. However, it should be included in not completed while analyzing burndown chart.

I have tried several methods but the problem, the task repeated with -negative due date. Since, it is for habit, when due date is gone, it should be gone. No, need to show due date with negative due date.

Could you all please share your opinion, how to accomplish this task??

thanks

@felixschurk
Copy link
Contributor

Hei,
I am not sure about the second part of your requirements, however for the first one you could use the until property, see Using Dates Effectively.
So you could use a command like this

task add \
 recur:daily \
 due:23:59 \
 wait:6:00 \
 until:due \
 foobar

I just do not know how it will pop up in the burndown chart. As far as I know, deleted tasks are not shown in there.

@djmitche djmitche added type:bug Something isn't working topic:recurrence labels May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:recurrence type:bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

4 participants