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

Support for read-only lists #931

Closed
abaker opened this issue Mar 9, 2020 · 10 comments
Closed

Support for read-only lists #931

abaker opened this issue Mar 9, 2020 · 10 comments

Comments

@abaker
Copy link
Member

abaker commented Mar 9, 2020

No description provided.

@gtbuchanan
Copy link

gtbuchanan commented Feb 19, 2021

This is a problem for the DAVx5 sync too and I would consider it a bug rather than enhancement. When syncing a read-only calendar from Nextcloud in DAVx5 the task list is also included (I don't see a way to only sync the calendar). I am notified to complete tasks from a read-only task list even though I can't actually make changes to them. If I mark a task as complete to get rid of the notification, DAVx5 gives me a perpetual 404 error since the task app made changes to a read-only list.

It seems currently the options are to wait for the owner of the read-only task list to complete the task themself or disable sync of the read-only calendar/task list in DAVx5. Neither is ideal.

Related to #890 since selective sync would be a nice workaround for this problem. However, it would be better to just not be notified and not be able to edit tasks from a read-only list so you could still see the tasks if you wanted to.

EDIT: I guess I wouldn't consider it a bug here since I just found this on DAVx5

Currently, there’s no read-only support for task lists. (source)

I'd imagine that means there isn't a way for you to know if the task list is read-only from DAVx5. I'll see if there is an upstream issue to handle read-only task lists the same way as read-only address books.

Android doesn’t have native support for read-only address books. To emulate this feature, DAVx⁵ reverts local changes at every synchronization. You can still edit your contacts in the Contacts app, but all changes will be reverted when the next synchronization is run.

@abaker
Copy link
Member Author

abaker commented Feb 23, 2021

It looks like list_access_level in the OpenTask content provider is meant for this purpose.

I just started looking into implementing read-only support for native CalDAV sync

@devvv4ever
Copy link

Hi Alex,

we occasionally get this reported from DAVx⁵-tasks.org users. Do you need anything from us (DAVx⁵) in this matter?

@abaker
Copy link
Member Author

abaker commented Oct 10, 2022

@devvv4ever hey - not sure! It has been a while since I thought about this. Hopefully you just have to set list_access_level to indicate a read only list? Unfortunately the value of this column isn't defined in OpenTasks. For list sharing stuff I am checking DAV:read-write and looking for 1 for read-write and 2 for read-only, maybe those are the values?

Tasks.org doesn't actually enforce read-only, but if DAVx5 provides that info then I will

@rfc2822
Copy link

rfc2822 commented Oct 10, 2022

@abaker Yes, I think we should define values for read-write and read-only in the contract (and send a PR for https://github.com/dmfs/opentasks/blob/master/opentasks-contract/src/main/java/org/dmfs/tasks/contract/TaskContract.java). Then we can use the values to define which list is read-only and sync / show the UI accordingly.

I suggest to use the same values as https://developer.android.com/reference/android/provider/CalendarContract.CalendarColumns?hl=en#CALENDAR_ACCESS_LEVEL. (jtx Board uses a simple read-only flag: https://gitlab.com/techbeeat1/jtx/-/blob/542ab5b673deee51cba72062a2cdb9f9ec8ec2ba/app/src/main/java/at/techbee/jtx/contract/JtxContract.kt#L1175)

Would you mind defining those values or shall we do that?

@Slartibartfast27
Copy link

Slartibartfast27 commented Oct 31, 2022

Hi all,
a fix for this would be very much appreciated by me.
I think it would be great, if also others could safely use read-only calenders without getting confused or ignore permanent errors.

To whom it may concern, my setup is the following:

  • nextcloud as backend
  • DAVx⁵ for sync
  • 2 accounts on nextcloud (1 for me, 1 for my partner) with 3 calenders in total:
Nextcloud account Calendar On my mobile On my partner's mobile
Mine my_calendar Read-Write Read-Only
Mine shared_calendar Read-Write Read-Write
Partner partner_calendar Read-Only Read-Write

This leads basically to permanent errors in the Android notification bar on both (mine and my partner's) mobile, telling that the repective read-only calender has sync errors.

Side effect:
As we always remove these errors from the notification bar (multiple times per day), "real important" errors, which may occur in the future, might be missed out.

Please let me know, if I can help on this issue, e.g. by testing beta versions, ...

P.S.: It took me many hours to figure out the source of the problem and to write a big report to the very supportive team of DAVx⁵.

@rfc2822
Copy link

rfc2822 commented Nov 24, 2022

On DAVx5 side we have now defined the access levels with these values:
https://github.com/bitfireAT/ical4android/blob/f1969808ad24eae1bb73b1cba29c10c5c2a7c653/opentasks-contract/src/main/java/org/dmfs/tasks/contract/TaskContract.java#L386-L401

These values are set as ACCESS_LEVEL for the task list, according to whether they're read/write or read-only.

Is it possible to take values into account in tasks.org?

@abaker
Copy link
Member Author

abaker commented Nov 24, 2022

Awesome yeah I will work on this next

@abaker
Copy link
Member Author

abaker commented Nov 30, 2022

Added in 71f22dd

@abaker abaker closed this as completed Nov 30, 2022
@rfc2822
Copy link

rfc2822 commented Nov 30, 2022

Awesome, thanks :)

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

No branches or pull requests

6 participants