[Bug] Caldav Priority not properly syncing with tasks.org mobile app #866

Open
opened 1 month ago by tadly · 9 comments
tadly commented 1 month ago

The tasks.org mobile app allowes for 4 Priorities to be set (Gray, Blue, Yellow, Red)
While I assume that a caldav lib is used within vikunja I'll reference the official caldav doc anyways

I'm not exactly sure what the tasks.org priorities translate to given the doc but here is what happens inside vikanju:

Tasks.org Vikunja
Gray "Unset"
Blue Shows empty string
Yellow "DO NOW"
Red "Low"

With nextcloud and the nextcloud tasks app, the priority can be set to anything from 0-9 (following the caldav spec).
The tasks.org android app probably has ranges defined to map those numbers to a corresponding color (I'm just guessing though)

Given that there are currently 6 priorities within Vikunja, I'm not sure how to best handle this.

Adapting the 4 options of tasks.org or the full on 10 (0-9) following the spec are the two obvious options.
Something else Nextcloud does is they allow you to toggle between "Unset" (Priority 0) and "High" (Priority 1) to improve usability.
This could be adapted and even improved upone by allowing the user to "cycle" though f.e. 4 priorities with one button where each press increases the priority until it cycles back to unset. Unset -> Low -> Medium -> High -> Unset
A advanced view or input would than allow to enter a explicit number.

If the 6 priorities are set in stone already a different solution should be thought of but I can't think of anything good from the top of my head right now.

Finally, thanks for this project. I've been looking for exactly this for years and ended up hosting nextcloud only for the sake of the tasks app (hard overkill)

The tasks.org mobile app allowes for 4 Priorities to be set (Gray, Blue, Yellow, Red) While I assume that a caldav lib is used within vikunja I'll reference the [official caldav doc](https://icalendar.org/iCalendar-RFC-5545/3-8-1-9-priority.html) anyways I'm not exactly sure what the tasks.org priorities translate to given the doc but here is what happens inside vikanju: | Tasks.org | Vikunja | | --- | --- | | Gray | "Unset" | | Blue | Shows empty string | | Yellow | "DO NOW" | | Red | "Low" | With nextcloud and the nextcloud tasks app, the priority can be set to anything from 0-9 (following the caldav spec). The tasks.org android app probably has ranges defined to map those numbers to a corresponding color (I'm just guessing though) Given that there are currently 6 priorities within Vikunja, I'm not sure how to best handle this. Adapting the 4 options of tasks.org or the full on 10 (0-9) following the spec are the two obvious options. Something else Nextcloud does is they allow you to toggle between "Unset" (Priority 0) and "High" (Priority 1) to improve usability. This could be adapted and even improved upone by allowing the user to "cycle" though f.e. 4 priorities with one button where each press increases the priority until it cycles back to unset. _Unset -> Low -> Medium -> High -> Unset_ A _advanced_ view or input would than allow to enter a explicit number. If the 6 priorities are set in stone already a different solution should be thought of but I can't think of anything good from the top of my head right now. Finally, thanks for this project. I've been looking for exactly this for years and ended up hosting nextcloud only for the sake of the tasks app (hard overkill)
konrad added the
kind/feature
label 1 month ago
Owner

I think in the long term it would make most sense to use all 10 levels of priorities. For a "quick fix" I think something like this should work:

Vikunja Priority Caldav Priority As Per Spec
Unset 0
DO NOW 1
Urgent 2
High 3
Medium 4
Low 5
Low 6
Low 7
Low 8
Low 9

As the spec from your link says:

A value of 1 is the highest priority. A value of 2 is the second highest priority. Subsequent numbers specify a decreasing ordinal priority. A value of 9 is the lowest priority.

Maybe this could do with more "spacing" between them:

Vikunja Priority Caldav Priority As Per Spec
Unset 0
DO NOW 1
Urgent 2
Urgent 3
High 4
High 5
Medium 6
Medium 7
Low 8
Low 9
I think in the long term it would make most sense to use all 10 levels of priorities. For a "quick fix" I think something like this should work: | Vikunja Priority | Caldav Priority As Per Spec | | -------- | -------- | | Unset | 0 | | DO NOW | 1 | | Urgent | 2 | | High | 3 | | Medium | 4 | | Low | 5 | | Low | 6 | | Low | 7 | | Low | 8 | | Low | 9 | As the spec from your link says: > A value of 1 is the highest priority. A value of 2 is the second highest priority. Subsequent numbers specify a decreasing ordinal priority. A value of 9 is the lowest priority. Maybe this could do with more "spacing" between them: | Vikunja Priority | Caldav Priority As Per Spec | | -------- | -------- | | Unset | 0 | | DO NOW | 1 | | Urgent | 2 | | Urgent | 3 | | High | 4 | | High | 5 | | Medium | 6 | | Medium | 7 | | Low | 8 | | Low | 9 |
Poster

I have now crosschecked nextcloud with tasks.org and this is how it works over there:

Nextcloud Nextcloud Lable Tasks.org
0 No priority assigend Gray
1 High Red
2 High Red
3 High Red
4 High Red
5 Medium Yellow
6 Low Blue
7 Low Blue
8 Low Blue
9 Low Blue

The colors shown withing nextcloud are also the same as the ones by tasks.org.

Also, the other way arround, this is what tasks.org sets as priority when selecting one of the 4 colors (doesn't really matter but for completeness sake):

Tasks.org Nextcloud/Caldav
Gray 0
Blue 9
Yellow 5
Red 1
I have now crosschecked nextcloud with tasks.org and this is how it works over there: | Nextcloud | Nextcloud Lable | Tasks.org | | --- | --- | --- | | 0 | No priority assigend | Gray | | 1 | High | Red | | 2 | High | Red | | 3 | High | Red | | 4 | High | Red | | 5 | Medium | Yellow | | 6 | Low | Blue | | 7 | Low | Blue | | 8 | Low | Blue | | 9 | Low | Blue | The colors shown withing nextcloud are also the same as the ones by tasks.org. Also, the other way arround, this is what tasks.org sets as priority when selecting one of the 4 colors (doesn't really matter but for completeness sake): | Tasks.org | Nextcloud/Caldav | | --- | --- | | Gray | 0 | | Blue | 9 | | Yellow | 5 | | Red | 1 |
Owner

Then I think the second priority from my comment earlier would make most sense.

Then I think the second priority from my comment earlier would make most sense.
Poster

Not sure I agree as this would cause "yellow" within tasks.org (which is the middle priority) to show up as "High" within Vikunja.

Wouldn't it make more sense to either just copy the mapping like nextcloud has it or even go as far as to only have exactly 4 corresponding to tasks.org (0, 9, 5, 1).

Not sure if some people would want more fine grain controll over their priorities though.

Not sure I agree as this would cause "yellow" within tasks.org (which is the middle priority) to show up as "High" within Vikunja. Wouldn't it make more sense to either just copy the mapping like nextcloud has it or even go as far as to only have exactly 4 corresponding to tasks.org (0, 9, 5, 1). Not sure if some people would want more fine grain controll over their priorities though.
Owner

If the goal is to map the "medium" priority to the medium priority in Vikunja, maybe something like this would work?

Vikunja Priority Caldav Priority As Per Spec
Unset 0
DO NOW 1
Urgent 2
High 3
High 4
Medium 5
Low 6
Low 7
Low 8
Low 9

The problem is I'd like to avoid changing the priorities as they are currently in Vikunja because that would be a breaking change. Nextcloud has only 3 priorities whereas Vikunja has 5, so copying the mapping from Nextcloud wouldn't work. Remember caldav sync is two-way, so if you change the priority in the Vikunja to something like "DO NOW" it would not show up in caldav.

If the goal is to map the "medium" priority to the medium priority in Vikunja, maybe something like this would work? | Vikunja Priority | Caldav Priority As Per Spec | | -------- | -------- | | Unset | 0 | | DO NOW | 1 | | Urgent | 2 | | High | 3 | | High | 4 | | Medium | 5 | | Low | 6 | | Low | 7 | | Low | 8 | | Low | 9 | The problem is I'd like to avoid changing the priorities as they are currently in Vikunja because that would be a breaking change. Nextcloud has only 3 priorities whereas Vikunja has 5, so copying the mapping from Nextcloud wouldn't work. Remember caldav sync is two-way, so if you change the priority in the Vikunja to something like "DO NOW" it would not show up in caldav.
Poster

Ah, I wasn't aware that there would be breaking changes in Vikunja.

To be honest, I dislike the fakt that there are only 4 priorities to choose from within tasks.org but it's otherwise a solid app.
IMO one the the highest quality open source apps I know which is why Vikunja, as a "client" for the desktop, would work so well as there isn't anything else that's usable. :)

Back to the problem at hand though.
Your suggestion seems quite sane.
This would mean that the frontend would have the following 5 options right?

Vikunja Caldav
Unset 0
DO NOW 1
High 2
Medium 5
Low 9
Ah, I wasn't aware that there would be breaking changes in Vikunja. To be honest, I dislike the fakt that there are only 4 priorities to choose from within tasks.org but it's otherwise a solid app. IMO one the the highest quality open source apps I know which is why Vikunja, as a "client" for the desktop, would work so well as there isn't anything else that's usable. :) Back to the problem at hand though. Your suggestion seems quite sane. This would mean that the frontend would have the following 5 options right? | Vikunja | Caldav | | --- | --- | | Unset| 0 | | DO NOW | 1| | High | 2 | | Medium | 5 | | Low | 9 |
Owner

This would mean that the frontend would have the following 5 options right?

Yes, plus one more for Vikunja's "Urgent" priority and "padding" for the ones in between (though that would only matter when saving the priority through caldav).

> This would mean that the frontend would have the following 5 options right? Yes, plus one more for Vikunja's "Urgent" priority and "padding" for the ones in between (though that would only matter when saving the priority through caldav).
Poster

I tried looking at the source but I have 0 go experience and really am not sure how to help with this :/

Is this where the mapping has to happen?

I tried looking at the source but I have 0 go experience and really am not sure how to help with this :/ Is [this](https://kolaente.dev/vikunja/api/src/branch/main/pkg/caldav/caldav.go#L219) where the mapping has to happen?
Owner

Yup, and then when parsing the updated task from the caldav cliente here.

The whole caldav implementation is wayy too messy and definitly needs some cleanup.

Yup, and then when parsing the updated task from the caldav cliente [here](https://kolaente.dev/vikunja/api/src/branch/main/pkg/routes/caldav/parsing.go#L83-L88). The whole caldav implementation is wayy too messy and definitly needs some cleanup.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.