gabor-boros / minutes

Sync worklogs between multiple time trackers, invoicing, and bookkeeping software.
https://gabor-boros.github.io/minutes/
MIT License
27 stars 2 forks source link

[BUG] Do not upload entries parallelly for the same task #12

Closed gabor-boros closed 3 years ago

gabor-boros commented 3 years ago

Describe the bug

Some tools (like Tempo / older version of Tempo) may get confused when multiple entries are uploaded for the same task. The reason, in the case of Tempo, is that tries to calculate the remaining estimate for the task automatically, hence the calculation can go wrong and the remaining estimate will be set to a higher number than it should be.

Example:

Task TSK-123 has 3 entries with 1, 2, and 3 hours logged on them. When the entries are uploaded by the corresponding goroutines, Tempo will try to calculate the remaining time for TSK-123 at upload. If the calculation is done simultaneously for 2 out of the 3 entries, the remaining estimate on TSK-123 will not match the reality.

To Reproduce

  1. Upload ~3-5 entries for the same task at "once"
  2. Check the remaining estimates in Tempo

Expected behavior

Entries for the same task are uploaded after each other, therefore not causing any race conditions on the server-side. A possible solution could be using linked lists for tasks and during upload, one goroutine would be responsible for one chain.

Screenshots

N/A

System information:

List of flags used:

Not relevant

Additional context

N/A

gabor-boros commented 3 years ago

It turns out that it is related to Tempo. In case this issue comes up later, the regrouping could be implemented as part of the related PR could be moved to Worklog.