Skip to content

fix(recurring): preserve due-threshold gap in non-strict recurrence#889

Open
wanhoff wants to merge 1 commit into
ransome1:mainfrom
wanhoff:fix/recurring-threshold-gap-886
Open

fix(recurring): preserve due-threshold gap in non-strict recurrence#889
wanhoff wants to merge 1 commit into
ransome1:mainfrom
wanhoff:fix/recurring-threshold-gap-886

Conversation

@wanhoff

@wanhoff wanhoff commented Jun 1, 2026

Copy link
Copy Markdown

Fixed problem with threshold on non strict recurring tasks

Worked to my best knowledge, but had limited ability to test. I have no sleek development environment on my computer.

@Lezurex Lezurex left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for reporting and fixing this.
Regarding the tests: I can live regardless of whether we keep it or remove it, just a minor detail.

@ransome1 Could you let the checks run? I can't approve them myself unfortunately.

Comment on lines +257 to +268
it("non-strict recurrence with 3-week interval preserves due/threshold gap (issue #886)", () => {
// due:2021-06-22, t:2021-06-15 → gap = 7 days
// completion date = 2021-06-01, rec:3w → new due = 2021-06-22
// thresholdBase = 2021-06-22 − 7d = 2021-06-15
// Bug: without fix thresholdBase + 3w = 2021-07-06 (interval applied twice)
// Fix: newThresholdDate = thresholdBase = 2021-06-15 (gap preserved)
createRecurringTodo("Task due:2021-06-22 t:2021-06-15 rec:3w", "3w");
const todo = capturedTodo();
expect(ext(todo, "due")).toBe("2021-06-22");
expect(ext(todo, "t")).toBe("2021-06-15");
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this testcase is redundant, as it covers the same logic as the already existing (and, thanks to you, now fixed) testcase did. Maybe remove this one but keep the reference to the issue 886 and move it to the testcase above.

@Lezurex Lezurex moved this from Backlog to In Progress in sleek 2.x Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants