Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request link lost from response function when exporting and re importing #5943

Closed
1 task done
mark-watkin opened this issue May 4, 2023 · 4 comments
Closed
1 task done
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer

Comments

@mark-watkin
Copy link

Expected Behavior

If I have a request set up that uses a response function to get a value from the body of another response I expect that if I export and re import the function the request link should remain.

Actual Behavior

After exporting and re importing my request the request link cannot be found even though it is present in the json file that is exported.
Screenshot 2023-05-04 at 09 11 30

Reproduction Steps

Create a GQL request
Created response function as part of Bearer auth
Export the entire project as insomnia V4 (json)
Delete the project and re import the json file
Inside the response function the request value is blank and an error message is shown "Could not find request"

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

2023.2.0

What operating system are you using?

macOS

Operating System Version

macOS Monterey

Installation method

Brew

Last Known Working Insomnia version

This worked in the previous version I had I assume 2023.1.0

@mark-watkin mark-watkin added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels May 4, 2023
@jones1008
Copy link

Yes, I noticed this too. This can be very frustrating if you have a lot of environment variables and you need to set them all again after re-importing.

Notice: I think this bug occurs because the request (e.g. with id req_4b9ffe87e75f4ce2a476f9cddd3d541d) that is connected with the environment variable, does not exist anymore because it was deleted.
That means if you don't delete the insomnia collection before importing the json file (having two collections then), the environment variables work because the connected request is still there in the other collection that you didn't delete.

Currently I see the following solutions that could solve this:

  • Import the requests with the id specified in the json and don't create a new id when creating a request. Then the environment variables would be connected correctly to the request. This would have the disadvantage that you can't import a collection without deleting the one you exported before, because the id of the requests can't be the same.
  • Change the export mechanism so the environment variables are not connected to the request via the request id but via another identifier?
  • When importing, somehow set the request id of the environment variables to the newly created request id.
  • See what has changed from the previous insomnia version, where this worked?

@felixjaegers
Copy link

The same issue happens for me in test suites on a Windows 10 host.
I have a unit test which references a request by id in the JS code const response = await insomnia.send('req_436bfb93833b4cfd9ea188c1123076e3');. When I export->delete->import the document, this request, which are linked by id, will fail with failed to find request.

@smacktoid
Copy link

smacktoid commented Jun 5, 2023

Seems like this is the same as the problem reported in #5942. Export/Import of request chains is pretty broken at the moment.

@filfreire
Copy link
Member

Closing as duplicate of #5730

@filfreire filfreire closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: general classification S-unverified Status: Unverified by maintainer
Projects
None yet
Development

No branches or pull requests

5 participants