mrvladus / Errands

Todo application for those who prefer simplicity.
MIT License
274 stars 65 forks source link

[BUG] nextcloud Sync fails for one specific task list only #235

Closed Julian4711 closed 2 months ago

Julian4711 commented 3 months ago

Describe the bug Hi, I am having a problem synchronising or loading a specific to-do list from my Nextcloud instance. In general the sync works, but with this one list it fails. Here is what the log says about this list:

[INFO] Sync: Sync tasks with remote
[DEBUG] Sync: Getting tasks for aufgaben
[DEBUG] Sync: Delete orphaned task: 1572684427854887556
[ERROR] Sync: Can't get tasks from remote. NotFoundError at '1572684427854887556 not found on server', reason no reason
[DEBUG] Sync: Copy list from remote aufgaben
[DEBUG] Data: Create 'aufgaben' list

The list contains 5 tasks. There are no child or parent tasks for any of them. I don't know what the log message could be referring to. In fact, every single one of these tasks has an empty "RELATED-TO" entry. I have already deleted the Errands SQLite DB and re-imported it completely. Unfortunately, it makes no difference. What else could I do?

To Reproduce Steps to reproduce the behavior:

  1. Delete the Errands SQLite DB at ~/.var/app/io.github.mrvladus.List/data/errands/
  2. Start Errands
  3. Wait for Sync to be finished and DB to be created again
  4. Compare with Nextcloud: All lists except one are imported. The log shows the above error.

Expected behavior All lists are imported correctly as they appear on nextcloud.

OS info:

mrvladus commented 3 months ago

It may be happening if one of the tasks has parent set, but parent task is not exists. Nextcloud sometimes bugs with this, you can try to move tasks on nextcloud from their parents to be toplevel and then try to sync again.

olivercalder commented 3 months ago

I had the same problem. A rogue "Oranges" task from my grocery list, which I created on my phone (jtx Board) before it had synced the fact that the grocery list parent task was moved to a different task list. The Endeavour app was able to sync tasks from my nextcloud server (and showed the "Oranges" task in the "All" section, allowing me to delete it once I realized that was the problem), so I thought it was a bug in Errands at first. The Nextcloud web UI also didn't show the orphaned "Oranges" task, so using Endeavour to fix the tasks was really the only solution I found, followed by a full purge of completed and deleted tasks via the Nextcloud web UI.

mrvladus commented 2 months ago

I've made so Errands now will detect orphaned tasks and remove their parent data, so they will become top-level tasks. Now you don't have to use different apps for this problem :)

Julian4711 commented 2 months ago

great news. when will it arrive in flathub? I sometimes peek at all the improvements you do in the dev branch. Would really like to see them in action ;)

mrvladus commented 2 months ago

@Julian4711 I just need to fix some Drag'n'Drop bugs and I will release it.

mrvladus commented 2 months ago

Added in 46.0 release.