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
334 stars 9 forks source link

[BUG] Synchronization error - completion of VTODO via widget #1430

Closed CRGer closed 1 month ago

CRGer commented 2 months ago

Describe the bug I marked a task as completed in the widget - the app was not open. Even after that, I didn't open the app for several hours. After approx. 4 hours, I opened the app and edited/created further tasks in the app. These were correctly synchronized to the CalDav server. The task previously marked as completed in the widget was still present on the server as unfinished, but in the app it was marked as completed (as intended). On the server, I could see in the raw data that the VTODO had not been changed for some time, and no synchronization attempt for this VTODO was visible in the server logs. Even a re-initiated synchronization did not change this inconsistent state. Only a new edit (marked as unfinished in the app and then as finished again) of this VTODO led to successful synchronization and a consistent state.

To Reproduce I was unable to reproduce this behavior. (Edit: Due to time reasons, see comment below.)

Expected behavior The VTODO is correctly synchronized.

Screenshots n.a.

Device and version

CRGer commented 2 months ago

Of course, I would like to reproduce the error again to make it easier to identify the cause. However, this takes time, as I am not allowed to open the app for several hours.

Before that, I've got one question: Is it possible to activate debug logs in the app for this?

Another note (as it might be relevant): I have also switched networks several times in the 4 hours.

patrickunterwegs commented 2 months ago

Hi @CRGer , I will have a look at the code if maybe the content observer is not notified correctly in that case. Basically jtx Board notifies this content observer, the rest is then done by the system and DAVx5. So it's a bit hard to say where things get stuck. I haven't added any debug logs, but anyway the more relevant information would be in the DAVx5 logs. But let me review the widget code first.

patrickunterwegs commented 2 months ago

Hi @CRGer ! I have made an upgrade of the widget library and I'll add it to the upcoming beta. As they have made a few improvements, I hope they also made some improvements on the refresh-mechanisms. The code basically looks good, the widget should always get refreshed when an entry gets changed by the sync. However, I have also seen in the emulator that things get stuck for no reason sometimes (which was also hard to reproduce). So I hope that this new widget library version will fix a few things. I'll close this ticket here. It would be great if you could observe this issue further once you have the new version and give some feedback!

CRGer commented 2 months ago

Sure, I'll definitely observe this and report if necessary. Thank you very much, @patrickunterwegs ! Also, in general for this app/your work, it filled a huge gap in my OpenSource Landscape!

CRGer commented 2 months ago

I'm sorry, @patrickunterwegs, but I think I have some bad news. I just got an idea and can now reliably reproduce the error. It seems to be a problem with reccuring tasks.

Steps to repdroduce:

  1. Create a recurring task and a normal one
  2. Mark both tasks as completed via the widget.
  3. Both tasks are now shown as completed in the widget and in the app
  4. Trigger synchronization
  5. Only the normal task has been synchronized correctly on the server, the recurring task has not been updated on the server.

(The bug is also reproducible if you omit the normal task. Only served to illustrate whether the sync itself works)

I tried this three times with different recurring task, and it was reproducible every time... it was not necessary to close the app or wait some time, as initially thought by me.

patrickunterwegs commented 2 months ago

Thanks @CRGer , I'll check it out!

patrickunterwegs commented 1 month ago

Hi @CRGer , thanks again for the issue report and your detailed description how to reproduce the issue! I have found the root-cause (and hopefully it's really only this one) and fixed it =) I will add it in the current beta and upcoming version 2.7.9! It would be great if you could also give a short feedback once you have the option to check the new version! =)