insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Request URL removed when request is duplicated (via keyboard shortcut)

Open LunaticoCR opened this issue 2 years ago • 7 comments

Expected Behavior

I have created a request that is working fine and now I want to try something different with it, instead of modifying this one I duplicate it and modify the duplicate one with whatever other use case I want to target. Both the original and the copy should work as expected.

Actual Behavior

The copy works just like the original did, it's exactly the same as expected. But the original request has now lost the URL, as in the url field is now empty. So I now have to go to the duplicate and copy the url and past it in the original.

Reproduction Steps

  1. Create a request with the usual stuff, url, some headers, perhaps a body if necessary, etc
  2. Duplicate the above request
  3. Observe the duplicate contains all the fields from the original
  4. Inspect the original request and notice it's missing it's url

Is there an existing issue for this?

Additional Information

Duplicate used to work just fine, it's a regression introduced a few weeks ago.

Insomnia Version

2022.3.0

What operating system are you using?

macOS

Operating System Version

macOS Monterey 12.3.1

Installation method

Download from insomnia.rest

Last Known Working Insomnia version

Unsure

LunaticoCR avatar May 10 '22 09:05 LunaticoCR

Hi @LunaticoCR, thank you for reporting this!

I'm not able to reproduce following your exact steps, neither when dealing with brand new requests on a Design Document nor a Request Collection.

Screen Shot 2022-05-10 at 12 39 17 Screen Shot 2022-05-10 at 12 39 22

The closest issue I remember being similar to this was https://github.com/Kong/insomnia/issues/3453 (which as a pending PR https://github.com/Kong/insomnia/pull/3804), but I'm not sure it's exactly the same you describe.

Are you able to share a collection or screenshots/video recording of this happening to you?

filfreire avatar May 10 '22 11:05 filfreire

Hi @filfreire thanks for looking into this! I see what you mean, I also couldn't reproduce it on a new collection. So maybe there's something in my collection that triggers this issue? It's a really big collection with several environments and plenty of variables. Unfortunately it has loads of sensitive information so I can't share it. However I've copied one of the folders that doesn't have any sensitive information over to a new workspace and then exported that, I then reimported it and was able to reproduce.

Here's a video of the issue: https://user-images.githubusercontent.com/2124383/167632357-46ffea09-27d2-45ac-980d-bfcc68c9d934.mov

To reproduce this yourself you can import this collection: Insomnia_2022-05-10.json.zip

Then do the following:

  1. Expand the Acl folder
  2. Select the last request "Is Member of Acl? (admin for user3)" and notice it has a url
  3. Press Cmd+D to duplicate
  4. Click create (leave the request name the same)
  5. Notice the new request has a url
  6. Select the previous request and notice it now has no url

I hope this helps!

LunaticoCR avatar May 10 '22 12:05 LunaticoCR

Cmd+D is mapped to Duplicate Request but also "Delete line under the cursor" so if your cursor is still in the url bar its deletes the line when you duplicate.

https://defkey.com/codemirror-shortcuts

jackkav avatar Jun 07 '22 16:06 jackkav

My workaround was change the shortcut to Cmd+Shift+D

askareija avatar Jun 14 '22 04:06 askareija

Hi folks, quick update, @gatzjames has given a shot at fixing it with https://github.com/Kong/insomnia/pull/4917 and https://github.com/Kong/insomnia/pull/4937

We'll update you here once a definitive fix is merge. In the meantime feel free to report any other issues! 🙇

filfreire avatar Aug 04 '22 06:08 filfreire

Changing the shortcut to Cmd+Shift+D is great, but is there any progress on this issue?

I'm sure new users are going to have a hard time figuring out why the duplicate dialog deletes their request URL at the same time.

hunterwilhelm avatar Sep 14 '22 16:09 hunterwilhelm

Hi everyone!

I was trying to duplicate some requests today and found the same bug when using CTRL + D. So I have tested it and found another bug regarding the same shortcut issue. When in the editor, clicking CTRL + D will delete the line where the cursor was set before and if a text block is selected, the whole block will be deleted when the shortcut is pressed.

Like @hunterwilhelm said, is there any progress by now?

Edchja avatar Sep 14 '22 16:09 Edchja