mrvladus / Errands

Todo application for those who prefer simplicity.
MIT License
319 stars 68 forks source link

Error on some task lists from Nextcloud #164

Closed opal06 closed 10 months ago

opal06 commented 10 months ago

First of all, thank you very much for this program. It really fills a gap for me!

Unfortunately, I am facing a sync bug when fetching some task lists from my Nextcloud instance. Errands connects to Nextcloud and fetches some lists without problems, but for two lists ("juni" and "personal" in the logs) shows no entries, although the list is not empty. From the logs (see below), it seems like it cannot find certain resources on the server. Now, these tasks exist and can be synced with e.g. the Tasks.org/DAVx5 app on my Android phone. I am not sure if this is coincidental or not, but these lists are the ones where I use more of Nextcloud Task's features like subtasks and the priority property as well as partial completion tracking. I was wondering if Errands has not yet implemented some of these things and therefore struggles to process the lists.

Here are the logs of my last start. I have redacted user names and the domain of the instance for privacy reasons, but that should not be relevant to the issue at hand. The lists with issues are "juni" and "personal". All others are synced as expected.

[DEBUG] Starting Errands 45.1.6
[DEBUG] Initialize GSettings
[DEBUG] Creating actions
[DEBUG] Loading tasks for 'personal'
[DEBUG] Loading tasks for 'mails'
[INFO] Add task: 3859318165545962153
[INFO] Task: Set completed to 'True'
[INFO] Add task: 8988d8fb-1098-4c5b-8245-05256268afca
[INFO] Task: Set completed to 'True'
[INFO] Add task: f739944c-3330-4374-b7fd-a217e952d228
[INFO] Task: Set completed to 'True'
[INFO] Add task: e446bc87-630a-48df-a24f-0865e2e7b986
[INFO] Task: Set completed to 'True'
[INFO] Add task: 79c9e116-3888-4ccc-94d5-dc9232365438
[INFO] Task: Set completed to 'True'
[INFO] Add task: 020175ce-460c-491f-91fc-5ef8c0f6babe
[INFO] Task: Set completed to 'True'
[INFO] Add task: 1192991786592808117
[INFO] Task: Set completed to 'True'
[INFO] Add task: d852e318-4e01-4177-991f-2e2bee84ea9c
[INFO] Task: Set completed to 'True'
[INFO] Add task: be4dd6f6-ef8a-409b-a5fa-59e9026b2b6f
[INFO] Task: Set completed to 'True'
[INFO] Add task: 949496cf-28d0-4c2b-b396-0974d246c4bb
[INFO] Task: Set completed to 'True'
[INFO] Add task: b7c0e1a7-9154-4021-9672-4b6d82e1b857
[INFO] Task: Set completed to 'True'
[INFO] Add task: c814cc54675894ea65de5e1113af632c782c7f81
[INFO] Task: Set completed to 'True'
[INFO] Add task: 35c200a7-c170-4557-ad01-fabc9f448554
[INFO] Task: Set completed to 'True'
[INFO] Add task: 02741167-0caa-4eb7-8bdd-0378f6f62f94
[INFO] Task: Set completed to 'True'
[INFO] Add task: 91702a80-6a3f-471b-b5c6-e0b8b78335f1
[INFO] Task: Set completed to 'True'
[INFO] Add task: b89d5173-8257-43c4-b9e0-f41a3093e493
[INFO] Task: Set completed to 'True'
[INFO] Add task: c840a9ce-f381-4164-85c2-37864c60f593
[INFO] Task: Set completed to 'True'
[DEBUG] Loading tasks for 'telefonate'
[INFO] Add task: 409509806131363585
[INFO] Task: Set completed to 'True'
[INFO] Add task: fdd5491d-4cc0-42a2-812b-486c077757c2
[INFO] Task: Set completed to 'True'
[INFO] Add task: 6c6a1cba-68c8-4ece-80be-6cd8dece71fd
[DEBUG] Loading tasks for 'juni'
[DEBUG] Loading tasks for 'zuknftige-projekte'
[INFO] Add task: c72ab5b6-2845-491c-900e-29c5ef542dbc
[INFO] Task: Set completed to 'True'
[INFO] Add task: 5e4e7d1b-15fc-40b7-afd2-0fca62d15cf3
[INFO] Task: Set completed to 'True'
[DEBUG] Loading tasks for 'personal_shared_by_<redacted>'
[DEBUG] Lists: Switch list
[DEBUG] Lists: Switch list
[INFO] Sync: Initialize sync provider
[INFO] Sync: Initialize 'Nextcloud' sync provider
[DEBUG] Sync: Checking credentials
[DEBUG] Sync: Checking URL
[DEBUG] Sync: URL is set to https://<nextcloud-instance>/remote.php/dav/
[DEBUG] Sync: Attempting connection
[INFO] Sync: Connected to Nextcloud server at 'https://<nextcloud-instance>/remote.php/dav/'
[INFO] Sync: Sync tasks with remote
[DEBUG] Sync: Getting tasks for personal
[DEBUG] Sync: Delete orphaned task: [vText('b'6542c8e5-4115-4ebe-aee0-96fda23b1503''), vText('b'a5879de6-e99b-4388-979d-a8868c7bf8a8''), vText('b'890bbc20-fed3-401c-8838-18e47377e13c''), vText('b'7c6bbc36-29fa-4e45-91b4-2137f270fe2f'')]
[ERROR] Sync: Can't get tasks from remote. NotFoundError at '[vText('b'6542c8e5-4115-4ebe-aee0-96fda23b1503''), vText('b'a5879de6-e99b-4388-979d-a8868c7bf8a8''), vText('b'890bbc20-fed3-401c-8838-18e47377e13c''), vText('b'7c6bbc36-29fa-4e45-91b4-2137f270fe2f'')] not found on server', reason no reason
[DEBUG] Sync: Getting tasks for mails
[DEBUG] Sync: Getting tasks for telefonate
[DEBUG] Sync: Getting tasks for juni
[DEBUG] Sync: Delete orphaned task: 3912e442-afc7-4360-a1d8-60735430f8e0
[ERROR] Sync: Can't get tasks from remote. NotFoundError at '3912e442-afc7-4360-a1d8-60735430f8e0 not found on server', reason no reason
[DEBUG] Sync: Getting tasks for zuknftige-projekte
[DEBUG] Sync: Getting tasks for personal_shared_by_<redacted>
[DEBUG] Lists: Update UI...
[DEBUG] Task list personal: Update UI
[DEBUG] Task list mails: Update UI
[DEBUG] Task list telefonate: Update UI
[DEBUG] Task list juni: Update UI
[DEBUG] Task list zuknftige-projekte: Update UI
[DEBUG] Task list personal_shared_by_<redacted>: Update UI
[DEBUG] Lists: Switch list
[DEBUG] Lists: Switch list
[DEBUG] Lists: Switch list
[DEBUG] Lists: Switch list
mrvladus commented 10 months ago

Judging by the logs, in this problematic lists tasks have parent task, but parent is not exists in the list (they are orphaned and because of that - deleted). Errands can read all properties of the task like priority and completion percent. Can you write an example how to replicate this task list? Maybe try to create new list with same tasks and properties and look how it behaves.

mrvladus commented 10 months ago

In the meantime I'll make sure that orphaned tasks is not deleted and just remove their parent property

opal06 commented 10 months ago

I have not been able to reproduce the issues on a new task list when trying different things like deleting a task with unfinished subtasks or deleting some subtasks etc. But I have been able to fix the issue on the "personal" list (have not tried the other one yet) by having Nextcloud delete all finished tasks. I think it is likely that one of these old tasks was corrupted and once it was removed, Errands was able to sync without issue. So it mainly seems to be an issue with the source, but adding a workaround that prevents one corrupted task from not syncing the whole list seems to be a good idea. Thank you for your support and feel free to close the issue.

mrvladus commented 10 months ago

Thank you for reporting the issue! I already added fix for this 22c5ca3.