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

API: Fixes #6862 set todo related fields when adding or changing a todo. Take 2 #7395

Merged
merged 4 commits into from
Jan 11, 2023

Conversation

Wartijn
Copy link
Contributor

@Wartijn Wartijn commented Dec 2, 2022

This is an alternative approach to #6886 with checks added to Note.save() instead of in the api.

@laurent22
Copy link
Owner

The test is failing: https://github.com/laurent22/joplin/actions/runs/3601238236/jobs/6090068290#step:12:787

Do you know that you can run the tests locally?

@Wartijn
Copy link
Contributor Author

Wartijn commented Dec 6, 2022

Yeah, I'm aware of that. I had all tests succeeding, but messed something up. My bad.

Comment on lines 694 to 697
if ('is_todo' in o && o.is_todo === 0) {
o.todo_due = 0;
o.todo_completed = 0;
}
Copy link
Owner

Choose a reason for hiding this comment

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

I'm worried about the unintended effects of this. I don't see any reason why todo_completed or todo_due shouldn't be left as they are when is_todo is reset. What if for some weird reason some code somewhere is relying on these properties still being set?

It just feels like leaving them as they are won't cause any problems (calling code can check "is_todo" to know if they should care about todo_due and todo_completed or not). While removing them might.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I've removed this and its related logic

@laurent22
Copy link
Owner

Ok let's merge, thanks!

@laurent22 laurent22 merged commit 4e942af into laurent22:dev Jan 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Due date is ignored when creating a todo via data API
2 participants