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

[Bug]: recurring logic gives wrong dates #93

Closed
dima-stefantsov opened this issue Jun 20, 2022 · 9 comments
Closed

[Bug]: recurring logic gives wrong dates #93

dima-stefantsov opened this issue Jun 20, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@dima-stefantsov
Copy link

dima-stefantsov commented Jun 20, 2022

Describe the bug

when I make recurring task "every month on the 5th", when completing it with Reminder popup, I get a new task on the 6th, not the 5th

when completing it natively with Tasks, date is right. I've looked in sources, and looks like you are making your own new-date calculation. Which is wrong. (by the way that code suggested not just date, but time is supported too, but I failed to incorporate due time in recurring tasks)

Expected Behavior

Since recurring functional only available when using Tasks, I am really expecting Reminder to just rely on Tasks code to implement the "mark as done".

I expect to trust my tasks system, not having to double-check it every time. Some recurrence cases give just 6th instead of 5th, some give date tomorrow instead of week ahead, this is not good.

Steps to reproduce

a female that took over Tasks maintaining made me describe it twice, and then closed it without helping. Maybe you will help

a pretty clear description with screenshots and arrows
obsidian-tasks-group/obsidian-tasks#787

a complete plug-and-play repository with case reproduced
obsidian-tasks-group/obsidian-tasks#792

I'm giving it a shot for the 3rd time, maybe you will actually be interested in fixing this bug, unlike my previous experience

  1. make a task with due date in the past
    - [ ] qwe 🔁 every month on the 5th 📅 2022-06-20
  2. wait for Reminder popup
  3. Mark as Done
  4. see new task is created for the 6th
- [ ] qwe 🔁 every month on the 5th 📅 2022-07-06
- [x] qwe 🔁 every month on the 5th 📅 2022-06-20 ✅ 2022-06-21

Operating system

Windows

@dima-stefantsov dima-stefantsov added the bug Something isn't working label Jun 20, 2022
@dima-stefantsov
Copy link
Author

This one is serious though

- [ ] reminder popup birthday fail 🔁 every year 📅 2023-06-21
- [x] reminder popup birthday fail 🔁 every year 📅 2022-06-18 ✅ 2022-06-21

- [ ] tasks native birthday 🔁 every year 📅 2023-06-18
- [x] tasks native birthday 🔁 every year 📅 2022-06-18 ✅ 2022-06-21

Same with "remind later", it will change birthday to a wrong date permanently. Currently Reminder is dangerous to use with recurring dates.

@dima-stefantsov
Copy link
Author

for users reading, a quick CSS fix for Reminder popup:

/* fix reminder actions */
.modal .reminder-actions {
    display: none;
}

image

then use default Tasks action
image

@uphy
Copy link
Owner

uphy commented Jun 21, 2022

PR is welcome.

by the way that code suggested not just date, but time is supported too, but I failed to incorporate due time in recurring tasks

Use .
https://uphy.github.io/obsidian-reminder/guide/interop-tasks.html#tasks-plugin-s-task-format

@uphy
Copy link
Owner

uphy commented Jun 21, 2022

Related code:

return rrule.after(dtStart.toDate(), false);

The issue was reproduced with the following code but I don't know why it is occured.

    test('modify() - default - every month', async () => {
        await testModify({
            now: "2021-09-13",
            customEmoji: false,
            inputMarkdown: `- [ ] Task 🔁 every month on the 5th 📅 2021-09-12`,
            expectedMarkdown: `- [ ] Task 🔁 every month on the 5th 📅 2021-10-05
- [x] Task 🔁 every month on the 5th 📅 2021-09-12 ✅ 2021-09-13`
        });
    });

https://github.com/uphy/obsidian-reminder/blob/82030551fbce60b0120e28b644da1d474f079419/src/model/format/reminder-kanban-plugin.test.ts

@dima-stefantsov
Copy link
Author

PR is welcome.

by the way that code suggested not just date, but time is supported too, but I failed to incorporate due time in recurring tasks

Use . https://uphy.github.io/obsidian-reminder/guide/interop-tasks.html#tasks-plugin-s-task-format

Oh indeed I remember testing that. When I enable this "distinguish" thing, most of my tasks which only have due date, no time, are not recognized anymore, so this won't work for me.

As for PRs, I live by clean code, and what I see in https://github.com/obsidianmd/obsidian-sample-plugin is pure madness. It reminds me of a rust hello-world example https://github.com/mTvare6/hello-world.rs
Just to add a button to show an alert there are some npm magic, lint, manifests, dependencies, static typing, compilation (for the js with a killer feature of no compilation, yeah thanks), etc.

I'll try looking into obsidian coding, plan is to remove 90% code, and release is as a simple "Tasks Agenda" plugin. If I cound drop static typing that would be best.

@claremacrae
Copy link

claremacrae commented Jun 26, 2022

a female that took over Tasks maintaining made me describe it twice, and then closed it without helping. Maybe you will help

I'm the "female" dima-stefantsov referred to above. Sad to see the several hours of my own time I spent on that issue being dismissed as "not helping".

Hi @uphy - nevertheless, If you can find the time to read my comments in obsidian-tasks-group/obsidian-tasks#792, you'll see that I said that fixing the recurrence code in Reminders is outside the scope of Tasks, which is why I closed the issue - BUT I explicitly offered to work with you, if you wish, to see how we can make both our plugins play well with each other.

Ideally I would like to find a way so that other plugins that use Tasks' Recurrence rules can find a way to use the logic in Tasks to do the recurrence calculation.

Are you interested in pairing together, initially on this issue, and later perhaps on better integration of these two plugins?

Also FYI: there's a PR in Tasks that I would really like to accept, that would make Tasks support Reminders emojis - obsidian-tasks-group/obsidian-tasks#432. I would also need to make Tasks' recurrence code increment the reminder date in the new task, which will be easy.

But I'm nervous about rolling out support for Reminders in Tasks whilst anyone using the Reminders alert to complete a task would find the recurrence broken - hence being keen to help you with this issue, if I can.

@jasonekratz
Copy link

jasonekratz commented Aug 1, 2023

As for PRs, I live by clean code, and what I see in https://github.com/obsidianmd/obsidian-sample-plugin is pure madness. It reminds me of a rust hello-world example https://github.com/mTvare6/hello-world.rs Just to add a button to show an alert there are some npm magic, lint, manifests, dependencies, static typing, compilation (for the js with a killer feature of no compilation, yeah thanks), etc.

I'll try looking into obsidian coding, plan is to remove 90% code, and release is as a simple "Tasks Agenda" plugin. If I cound drop static typing that would be best.

This is about a year old now but came across it researching the Tasks plugin and just have to say I actually laughed reading it.

@claremacrae you might need to update the Tasks doc that refs this because it notes August of 2022 this is still an issue but it was resolved in Nov?

@claremacrae
Copy link

@claremacrae you might need to update the Tasks doc that refs this because it notes August of 2022 this is still an issue but it was resolved in Nov?

Thanks for the suggestion. If you have time to add an issue in Tasks as a reminder for this, it would be greatly appreciated.

@samuk10
Copy link

samuk10 commented Oct 6, 2024

thats so confusing reminder oper should edit add a hour to the reminder or something.
For example this reminder is poping everytime on loop:
- [ ] test 📅 2024-10-06
when I click the popup set remind in 10 minutes for example, it should be set to:
- [ ] test 📅 2024-10-06 11:00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants