1
Add cancelHook for plugins
Source: Kong/insomnia#3727 · opened by @PieterJanVanAeken
• Insomnia Version: 6.5.4
• Operating System: Elementary OS 5.0
Details
I think it could be useful to make available cancel hooks in the plugins, similar to the response hooks.
Use case:
When I do not specify a storage key in the prompt plugin, I expect to get reprompted for every request. This works fine, provided the request results in a response, which cleans up the cache through the response hook.
However, if I cancel the request (for instance, because it cannot be fulfilled and I do not want to enforce timeouts), I need to restart the application to clear the cache.
I could (and have) modified the prompt plugin to include a flag to reprompt every time, but this is not the ideal behaviour either as prompts could be rendered multiple times for a single request.
The ideal solution would be to have a form of cancelHook, which allows for cleanup of the cache upon cancellation of the request.
• Operating System: Elementary OS 5.0
Details
I think it could be useful to make available cancel hooks in the plugins, similar to the response hooks.
Use case:
When I do not specify a storage key in the prompt plugin, I expect to get reprompted for every request. This works fine, provided the request results in a response, which cleans up the cache through the response hook.
However, if I cancel the request (for instance, because it cannot be fulfilled and I do not want to enforce timeouts), I need to restart the application to clear the cache.
I could (and have) modified the prompt plugin to include a flag to reprompt every time, but this is not the ideal behaviour either as prompts could be rendered multiple times for a single request.
The ideal solution would be to have a form of cancelHook, which allows for cleanup of the cache upon cancellation of the request.
No pledges yet. Be the first to back this.
Comments
Similar requests
Add plugin `onPluginUpdate` lifecycle event for data / migration management
1 vote · 0 comments
Expose electron.clipboard.writeHTML to context.app.clipboard
1 vote · 0 comments
Allow plugins synchronize to workspace
1 vote · 0 comments
Add Event hooks to Plugins
1 vote · 0 comments
Export data should include plugin's data
1 vote · 0 comments
No comments yet.