TechbeeAT / jtxBoard

jtx Board allows you to manage your Journals (like meeting minutes), Notes and Tasks in one Android app. The app is compatible with the iCal standard (RFC5545) and is integrated with DAVx5 to allow the synchronisation of entries through CalDAV.
https://jtx.techbee.at/
GNU General Public License v3.0
352 stars 10 forks source link

[BUG] Task duplication when changing collections #1392

Closed johannesmono closed 3 months ago

johannesmono commented 4 months ago

Describe the bug When adding a task and changing the collection, the current state of the tasks get saved to the previously selected collection. This also happens with an empty task.

To Reproduce

  1. Click the add task button and, optionally, fill out some data;
  2. change the collection, optionally finish data entry;
  3. save the task; and
  4. the created task appears as expected. Additionally a task, either empty or with "some data", appears in the previously selected collection.

Expected behavior No additional task is created.

Device and version

lore-emu commented 4 months ago

Having the same issue. This only seems to happen when switching from a remote collection to any other collection (local or remote).

patrickunterwegs commented 4 months ago

Thanks @johannesmono & @lore-emu , I have reproduced the issue and reviewed the code but it is not yet obvious, I need to continue debugging the issue. I'm just super busy those days, so please be patient.

patrickunterwegs commented 3 months ago

Sorry that it took a bit, I found the issue, it's really strange that this suddenly appeared as the part of the code didn't change. Still a small change was needed to make it work properly again, so probably it was a change in a library that caused it... I'll add the fix in the current beta which will be released soon.

lore-emu commented 3 months ago

The bug seems to still be happening on the version that was just released (both on 2.7.7.ose and on 2.7.7.gplay). Is that expected?

patrickunterwegs commented 3 months ago

Hi, sorry, I checked it and it was solved for me, I will reopen this ticket and check again.

patrickunterwegs commented 3 months ago

Hi @johannesmono , sorry that this took I while, it was really a tough one. The problem was that the current entry was saved and moved in different coroutines. If the saving was completed after the moving, then the saving overwrote the logical deletion... But as those coroutines have their own priorities, it was pretty random which one was done first. That's why it was so hard to reproduce it.

However, I hope with the change it's fixed for good!