pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.43k stars 138 forks source link

Multiple PR comments created #323

Open yuankaiyu opened 2 years ago

yuankaiyu commented 2 years ago

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?

delabere commented 1 year ago

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

RizaHKhan commented 1 year ago

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

Environment: MacOS

pwntester commented 1 year ago

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

pwntester commented 1 year ago

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)?

delabere commented 1 year ago

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 commented 1 year ago

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

jloesch30 commented 1 year ago

I am getting this same behavior

kid-icarus commented 1 year ago

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.

jloesch30 commented 8 months ago

Any progress on this?

ckangnz commented 8 months ago

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

daneguevara commented 5 months ago

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.