insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

[Bug] Having any Response tag with trigger behaviour "Always" results in infinite requests

Open dachucky opened this issue 7 years ago • 4 comments

  • Insomnia Version: 6.5.1
  • Operating System: Ubuntu 19.04 (Disco Dingo)

Details

If any response tag in the workspace is set to always trigger a resend, sending any request (even if it doesn't contain the response tag) will result in Insomnia infinitely sending that request. This prevents the results of a request from being shown, as the timer will just count up indefinitely. The Cancel button also ceases to function, though other parts of the UI continue to respond. To stop the requests, the application has to be closed.

I have attached a screenshot of the dev tools showing the mass requests, and a workspace with a minimal example. You should just be able to send the Get request and observe the timer start counting up indefinitely. (You may need to recreate the response tag in the base environment). Insomnia Bug Insomnia Bug Example.zip

dachucky avatar May 08 '19 10:05 dachucky

👋 Thanks for opening your first issue! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. If you're requesting a feature 🎁, please provide real use cases that would benefit. 👪

To help make this a smooth process, please be sure you have first read the contributing guidelines.

welcome[bot] avatar May 08 '19 10:05 welcome[bot]

Thanks for the sample workspace. I should be able to fix the issue now that I can reproduce 😄

gschier avatar May 08 '19 14:05 gschier

Ah yes. It seems that the problem comes from:

  1. Trigger request to be sent
  2. Environment is rendered, causing the response tag to send the dependency
  3. Trigger dependent request to be sent
  4. Environment is rendered, causing the response tag to send the dependency
  5. Go to step 3

This might be a tricky one to fix...

gschier avatar May 08 '19 14:05 gschier

Added a fix for this here: https://github.com/getinsomnia/insomnia/commit/8adee60c8671291712b8ad33f6bbc1e43c453c16#diff-58635dede9b4e0e443b219d70e735b20R97

Basically, the response tag will now track that it's already sending a request dependency and simply return null if it is. This is the best I could come up with for now and it seems to work pretty well.

gschier avatar May 08 '19 18:05 gschier