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

Guidance requested: Recurring task import behavior #3458

Closed
capocasa opened this issue May 15, 2024 · 4 comments
Closed

Guidance requested: Recurring task import behavior #3458

capocasa opened this issue May 15, 2024 · 4 comments

Comments

@capocasa
Copy link

I am working to improve a library to convert caldav task data and store it in taskwarrior in jspricke/python-icstask#6 . (icstask powers radicale_remind which provides two-way publishing taskwarrior tasks and remind events for use on phones/office software... it's amazing)

I ran into an issue using import to update an existing recurring task.

$ echo '{"description":"my task description","due":"20240731T220000Z","entry":"20240515T092213Z","modified":"20240515T090501Z","status":"pending","uuid":"a964698f-43f3-4690-b807-76eac2943990"}' | task import rc.recurrence.confirmation=no -

You cannot remove the recurrence from a recurring task.

Is there a way to use the import command to update a recurring task while letting taskwarrior know it is just to update the information and possibly propagate according to configuration, not change recurrence status?

Thanks!!

@djmitche
Copy link
Collaborator

I don't think task import is a great choice for modifying tasks -- it's intended for, well, importing. When it finds a matching uuid, it basically creates a task mod invocation that modifies the task to match the imported one. And, if that means the task goes from having a recur property to not having one, you see the given error.

If you'd like to use import, then perhaps the right approach is to first export the task, edit the result, and re-import.

The other option is to actually interface with the data directly, using taskchampion, rather than through the task CLI. But, that's a bit more complicated and currently only available from Rust.

@capocasa
Copy link
Author

capocasa commented May 18, 2024

Thank you very much!

I will discuss with @jspricke how to move forward so I can produce a patch.

If you don't mind we can leave this open in case any detailed questions come up.

The Rust API sounds interesting- would it be more or less straight forward for a contributor to expose as a C library?

@djmitche
Copy link
Collaborator

Yes, interfacing with Rust from C is possible, but requires "glue" for types like strings, and adhering to Rust's safety requirements. https://github.com/GothenburgBitFactory/taskwarrior/tree/develop/src/tc/lib/src is an attempt to do such a thing.

@djmitche
Copy link
Collaborator

Note also the Python bindings being built in GothenburgBitFactory/taskchampion#385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants