Open jreyesr opened 1 year ago
Some further information: if I switch to another request and then switch back, the history does appear as expected. Presumably unmounting and remounting the React component causes it to rerender with the most recent data?
Expected Behavior
When a plugin triggers a request (via
network.sendRequest
), that response should appear on the response history dropdown, as the responses of manually-triggered requests do.Actual Behavior
Plugin-initiated responses don't appear on the history dropdown until a request is sent manually (with the Send button), at which point all the responses that were caused by the plugin, plus the recently-made manual request, all appear at once
Reproduction Steps
Is there an existing issue for this?
Additional Information
This was reported on a Insomnia plugin that I maintain. See https://github.com/jreyesr/insomnia-plugin-batch-requests/issues/10. However, I can reproduce it with a very simple plugin too, taken directly from the docs, so it appears to be general and thus I'm reporting it here.
To reproduce the issue, you can use the following minimal plugin:
package.json
```json { "name": "insomnia-plugin-repro-history", "version": "0.0.1", "private": true, "insomnia": { "name": "repro-history", "description": "" }, "main": "main.js" } ```main.js
```js module.exports.requestActions = [ { label: "Send request", action: async (context, data) => { const { request } = data; const response = await context.network.sendRequest(request); const html = `${request.name}: ${response.statusCode}
`; context.app.showGenericModalDialog("Results", { html }); }, }, ]; ```Insomnia Version
2023.5.8
What operating system are you using?
Windows
Operating System Version
Ubuntu 22.04
Installation method
APT (.deb file)
Last Known Working Insomnia version
2022.5.7