Insomnia: [Bug] After displaying the 'Cut-Copy-Paste' menu from response text can't get rid of it

Created on 16 May 2017  路  21Comments  路  Source: Kong/insomnia

Overview

  • Insomnia Version: 5.0.20, 5.1.0
  • Operating System: Windows 10 Pro
  • Summary: Minor bug described in the following steps and video (video is marked 'unlisted')

Video

https://youtu.be/wwYGGJMQrwA

How To Reproduce

  1. Create new request
  2. Perform a request which returns a response with some text
  3. select some response text
  4. right-click > copy
  5. keep left-clicking and right-clicking everywhere in the window but can not get rid of cut-copy-paste menu, it keeps popping up
help wanted omacos owindows

Most helpful comment

OMG finally, I think I got this 馃悰! Check out PR #254 for the fix 馃槃

All 21 comments

Great report @kasradzenika!!

Just an FYI: _Unable to replicate on MacOS El Capitan (10.11.6)_

I just tried this on Mac, Windows 10, and Elementary OS (Linux) and also couldn't reproduce. I _have_ heard this from at least one other person via email, though.

Same here on Win7 x64, Insomnia 5.0.20

@marcioadr88 not sure which comment you are responding to. Can you clarify whether or not you _can_ or _can not_ reproduce?

I'm sorry, I can reproduce the bug mentioned by @kasradzenika.

I am getting same issue in windows 10 PRO, its mostly happens after copy or paste through context menu.

Does someone who can reproduce this want to try fixing it? electron-context-menu is the module used to create/manage these menus and is instantiated in window-utils.js.

I have a few ideas for what might be wrong:

  1. It's being instantiated at the wrong point in time
  2. It's somehow being instantiated more than once

Same issue on OSX, after hitting esc key a huge number of times it finally releases the Cut, Copy & Past menu

I was just able to reproduce this by closing (not quitting) and reopening the window.

Is this closed out in a pending release? obviously still occurring here under #253

@TakesTheBiscuit woops, I didn't realize you stated v5.1.0 in your other submission. Going to re-open this for now.

Can you reliably reproduce this? I was able to fix at least one cause of this bug but there could be others.

I am able to reproduce in the same way as the youtube clip in the OP by @kasradzenika

-- edit --
If i double click into 'source' or 'timeline' (mainly that tabbed view on the right side) then i can get this to reproduce pretty reliably, double click something, right click to copy, context appears, now left click anywhere on your mac, any desktop and you'll get the context appearing.

Again, as per above smashing the ESC key say 20 times is enough to cancel it off

It seems like it's capturing the right click event multiple times, perhaps it needs some sort of closure or escape mechanism to track when right click has been pressed rather than firing multiple times -- it feels like a 'bounce' if that makes sense

@TakesTheBiscuit unfortunately, I can't reproduce it by following the same steps as in the video.

I only have my Mac laptop's trackpad to test in on, though. Maybe it's related to using a mouse? Do you have a trackpad to try it on?

Are you able to reproduce it immediately after a fresh launch of the app?

To confirm the 100% reproducible as my above post is a bit scatty:
Trackpad AND apple mouse same behaviour:

  • Double or triple or quad click to highlight a word in 'source' pane. (CLIKCLICKCLICK)
  • Right click on highlighted word
  • Left click Copy
  • Left click anywhere on insomnia or another desktop (anywhere) and context menu appears (even outside the app)

Quit insomnia

Re-open

Issue goes away.

Run a POST request

Issues not coming back.

I have quit and reopened insomnia several times today -- quitting seems to be a 'temp' fix.

I could reproduce the bug on MacOS like this:

  • trigger context menu
  • move cursor outside the app

I do believe this issue is related to moving outside the boundaries of the window and / or context menu target

http://prntscr.com/fbzvb8

I think I am able to reproduce it. For me, it only starts happening after switching requests.

  1. copy/paste
  2. switch to different request
  3. copy/paste

I'll see if I can fix it now. Thanks for the help @ValeriaVG and @TakesTheBiscuit

Fyi i also get a really odd little visual glitch

Right click context
Click Copy
Word that was highlighted appears in bright white text ghosting over the top of the original for about 10ms (just long enough to see it) just off to the right of the mouse pointer.

Might sound really stupid (as i haven't dug into any of the source yet) but why can't the OS use native copy and paste dialogues??

@TakesTheBiscuit I have noticed that too, but it only seems to occur when the _duplicate context menu_ bug is happening.

I'm pretty sure it can't use native OS dialogs because it is not a native (Appkit) text label. Insomnia uses Electron, which means Chromium is rendering the text itself instead of delegating that to the native OS UI components.

By default, Electron does not include any context menus, so you need to implement it yourself. I chose to use the popular electron-context-menu library for this.

After some inspection, it seems like the problem might be caused when React re-uses an element that had previously been removed from the DOM.

I hate disagreeing, but the 'ghost' bug appears for me even when the context menu is behaving itself.

This bug isn't urgent anyway, smashing escape is fine for now.

Thanks for looking

No worries. Just trying to get to the bottom of this. Is this what you were describing? It seems to stay visible until the context menu disappears.

image

OMG finally, I think I got this 馃悰! Check out PR #254 for the fix 馃槃

Was this page helpful?
0 / 5 - 0 ratings