Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
https://insomnia.rest
Apache License 2.0
34.51k stars 1.95k forks source link

Firing plugins on specific actions #6004

Open gbjackc opened 1 year ago

gbjackc commented 1 year ago

Expected Behavior

A way to have a plugin fire on a specific action e.g done pressed, env loaded, argument change, debounced argument input.

Actual Behavior

A template tag plugin that fires a request will send a request for each character change in an argument which results in rate limit errors/lag/etc. This could be solved majorly with reliable debouncing, but I don't see a way to do this. Another way would be storing arguments and only firing when they don't change. But I can't see a way for an instance of a template tag to know which one it is, so when using in an environment multiple instances overwrite each-other's store.

Reproduction Steps

  1. make a template tag that makes a request based on arguments
  2. start typing an argument and watch requests start flying in the dev tools

Is there an existing issue for this?

Additional Information

This is essentially asking for the same thing as this issue. I don't see how the solution at the end actually fixes this issue.

Insomnia Version

2023.2.2

What operating system are you using?

macOS

Operating System Version

13.3.1 (22E261)

Installation method

insomnia website

Last Known Working Insomnia version

No response

gbjackc commented 1 year ago

I have realised I can add another argument to the plugin called ~"arguments key" to solve the instance separation issue and make this workable, though I still think the above issues are worth addressing