thunder-client-support icon indicating copy to clipboard operation
thunder-client-support copied to clipboard

Multiple pre requests for a single target

Open shawnferry opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. Attempts to create multiple pre requests targeting the same request/action/target result in a circular dependency error.

  • I have an access_token refresh request which requires a valid refresh_token.
  • refresh_token and access_token expire on a known schedule.
  • I have two collections a helper/reference collection and a sample collection.
    • The sample collection PreReq calls Reference -> Refresh Token every X minutes
    • The sample collection PreReq calls Reference -> Refresh Token once OR if access_token is empty (either of these creates the circular dependency error)
  • I want to call my Reference -> Get Token request as a PreReq from my Reference -> Refresh Token when either:
    • refresh_token has expired (Run every X minutes)
    • refresh_token once OR if it is not defined

Related #961

Describe the solution you'd like I'd like to be able to create multiple pre requests for the same collection -> request target.

Describe alternatives you've considered

  • PreReqs invisibly grouped on collection -> request, evaluated in the order defined, and stop after the first match.
  • PreReqs have multiple execution conditions and stop after first match.

Your Team Size Using TC: 3-5

shawnferry avatar Jan 06 '23 19:01 shawnferry

Hi @shawnferry

if you ignore the error, what happens? Will the access token and refresh token working for the remaining requests?

can you share screenshot of Pre-Run tab? just want to look at it?

Is it all requests causing circular error or only a particular single request?

rangav avatar Jan 06 '23 19:01 rangav

If I ignore the error it fails continuously once the tokens have expired. If the access token is valid everything it emits the error and continues to work as desired.

If I then manually run either get token or refresh token it will start working again.

image image

shawnferry avatar Jan 06 '23 20:01 shawnferry

Hi @rangav

Is it all requests causing circular error or only a particular single request?

For the example collection every request has the error from the collection level Pre-Run. For the support collection only the refresh request has the error.

shawnferry avatar Jan 06 '23 20:01 shawnferry

Thanks for sharing will look into it.

rangav avatar Jan 06 '23 20:01 rangav

This happens with any request with multiple pre requests. One pre request works. Two pre requests results in no pre requests running.

bwoodall-pfx avatar Apr 27 '23 22:04 bwoodall-pfx