Kong / Kong/insomnia

Insomnia setNextRequest function doesn't work when calling other request either by id or name.

Open
#10,319 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B-bug S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

Expected Behavior

After running last request, setNextRequest will point to first request from the list, and the whole flow will be reiteratted, until clause becomes false.

Actual Behavior

The runner never goes back to first request, as specified in the function of setNextRequest, and it finishes on last request

Reproduction Steps
  1. Create a list of requests, at least 2, with unique names
  2. in pre-request and after-response scripts of the first and last request create a simple script to go back to first request
  3. on last request set SetNextRequest function to point to the first request from the list
  4. Open runner, select All requests and press run
  5. observe behaivor

Example of last request after-response script to reitarate based on a list of users

if (userId != list[listSize-1]) {
insomnia.execution.setNextRequest();
}

Is there an existing issue for this?
Which sync method do you use?
  • Git sync.
  • Insomnia Cloud sync.
  • Local only
Additional Information

SetNextRequest does work to reiterate through the same endpoint perfectly, however if we say to go back to other request, it will look like the id or name is not found and finalize all.
This functionality was a big help into creating dynamic users, working with them and then removing based on any external factor. Now it does not work anymore and I dont see any walkaround to do so, other than making a lot of variables as list then using them as required. In my case this ups the complexity a lot.

Insomnia Version

13.1.0

What operating system are you using?

Windows

Operating System Version

25H2

Installation method

Insomnia.rest

Last Known Working Insomnia version

before 13.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the request runner with two named requests and an after-response setNextRequest call targeting the first request. Trace how the runner resolves request IDs and names, and confirm that execution can return to an earlier request and repeat until the condition is false.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.