You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
👋 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.
This should definitely be addressed. Thank you for pointing it out. It's quite an edge case.
The reason it currently doesn't work is because canceling the prompt modal causes the render step to fail, resulting in an exception, which then does not go through the response hooks. There may be other reasons why exceptions are thrown as well. For example, general render errors, misconfigured settings, validation errors, etc.
I think a generic requestErrorHooks plugin API would do the trick. Thoughts?
I have now noticed it also happens when you make a typo and you get exceptions such as hostname could not be resolved so indeed, a general requestErrorHooks plugin could make sense.
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.
The text was updated successfully, but these errors were encountered: