octo.nvim icon indicating copy to clipboard operation
octo.nvim copied to clipboard

Multiple PR comments created

Open yuankaiyu opened this issue 2 years ago • 11 comments

Issue Description

Type: bug report

Describe what happened (or what feature you want)

I started a review, add comments. Instead of producing one comment, for example "I am reviewing this PR", it produces multiple comments: I am I am reviewing I am reviewing this PR

I'm not sure if this is due to auto-save or something else. I tried disabled my auto-save plugin and the issue still exists. But even if I have auto-save, should the same comment be updated instead of adding new ones?

Describe what you expected to happen

One comment get produced.

How to reproduce it (as minimally and precisely as possible)

  1. Start a PR comment
  2. Write something, save buffer
  3. Write something more, save buffer

Tell us your environment

Arch Linux github enterprise if that matters.

Anything else we need to know?

yuankaiyu avatar Aug 30 '22 16:08 yuankaiyu

I'm also seeing the same issues in my PRs. I am also using autosave. My autosave plugin is 907th/vim-auto-save Mac OS

delabere avatar Jan 13 '23 18:01 delabere

Also seeing this issue and I do not have auto-save on.

Environment: MacOS

RizaHKhan avatar Jan 15 '23 02:01 RizaHKhan

Sorry for taking so long into looking into this issue. I have just verified the issue and will fix it ASAP

pwntester avatar Jan 27 '23 20:01 pwntester

And just like that, Im not able to reproduce it anymore 🤷🏼 Have you notice any patterns when this happens (eg: first commit only or after editing the title or body)?

pwntester avatar Jan 27 '23 20:01 pwntester

Hi I am seeing this happening still. Sometimes I see this: I am I am reviewing I am reviewing this PR

But sometimes it is: I am reviewing this PR I am reviewing this PR I am reviewing this PR

It is always 3 comments exactly when the issue occurs

Thanks!

delabere avatar Mar 06 '23 13:03 delabere

I just tested this out a little more and I can confirm that this happens even when I don't go back to edit the comment. I just use

  • :Octo review start
  • :Octo comment add
  • Write my comment
  • navigate out of the comment buffer
  • see 3x comment in my pending review on GitHub

delabere avatar Mar 06 '23 14:03 delabere

I am getting this same behavior

jloesch30 avatar Mar 27 '23 19:03 jloesch30

I'm also observing this behavior. Same reproduction steps as https://github.com/pwntester/octo.nvim/issues/323#issuecomment-1456193875. Although I'm only seeing a single duplicate. Not sure if it's worth mentioning but I'm using Github Enterprise.

kid-icarus avatar Apr 04 '23 02:04 kid-icarus

Any progress on this?

jloesch30 avatar Feb 22 '24 15:02 jloesch30

I'm also experiencing this. When I create a comment using :Octo comment add, it seems to be okay. But when I use the keybindings <space>ca, it creates 3 comments

ckangnz avatar Mar 18 '24 21:03 ckangnz

I was also seeing duplicate comments so I did some debugging and noticed that some of the methods on the ui.writers and model.octo-buffer modules (namely writers.write_comment and OctoBuffer:save) were getting called twice. In my packer.lua config file i noticed i had

  use({
    'pwntester/octo.nvim',
    requires = {
      'nvim-lua/plenary.nvim',
      'nvim-telescope/telescope.nvim',
      'nvim-tree/nvim-web-devicons',
    },
    config = function()
      require("octo").setup()
    end
  })

while also having an after/plugin/octo.lua file where I actually did my require('octo').setup({ ... }) configuration for octo.

After I commented out the setup call in my packer config and resyncing, no more dupe calls! Hope this might help - I really didn't want dupe comments to be the reason I couldn't use this plugin.

daneguevara avatar Jun 16 '24 03:06 daneguevara