Insomnia setNextRequest function doesn't work when calling other request either by id or name.
Nobody has claimed this yet.
- 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
- Create a list of requests, at least 2, with unique names
- in pre-request and after-response scripts of the first and last request create a simple script to go back to first request
- on last request set SetNextRequest function to point to the first request from the list
- Open runner, select All requests and press run
- 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?
- I have searched the issue tracker for this problem.
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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