gatewayapps / kamino

Github issue cloning tool
GNU General Public License v3.0
85 stars 25 forks source link

[BUG] Cloned issues have their comments "scrambled" #180

Closed julianzz98 closed 2 years ago

julianzz98 commented 2 years ago

Describe the bug When cloning a GitHub issue to another repository, the comments of the original issue are sometimes scrambled in the cloned ticket.

To Reproduce Steps to reproduce the behavior:

  1. Go to your repository, choose a issue with maybe some more comments (e.g. 10)
  2. Click on clone to "your repository"
  3. Check how the comments are sorted in the cloned ticket

Expected behavior The comments are supposed to be in the right order.

Desktop

Additional context I am still unsure if there are any clues, but maybe it has to do with the size of the comment. But this would suggest in the first place, that smaller comments are copied first. In this case it seems more like that bigger comments are copied first, smaller ones later.

johnmurphy01 commented 2 years ago

Thanks for the report! My guess is that maybe the comments do not come in from the GitHub api in the right order. Possibly we will have to sort them ourselves or figure out the right parameter to pass to the api to sort them.

thomas694 commented 2 years ago

The GitHub API is working correctly. The order is randomly, mainly depending on network latency, because the promises are executed concurrently already at their time of creation. I created a PR to fix it.