AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
222 stars 20 forks source link

Markdown response not updated when request repeated with a different body #226

Closed manderson23 closed 9 months ago

manderson23 commented 9 months ago

When I have multiple requests like the following

POST https://host/api/invoke
{
  "commandName": "command1"
}

POST https://host/api/invoke
{
  "commandName": "command2"
}

I execute them in order and the response bodies are shown correctly in the preview.

However, when I open the markdown for the second POST it still shows the details of the first POST.

AnWeber commented 9 months ago

@manderson23 It seems to be a bug in the markdown preview editor. I try to create a unique meaningful filename for storing the response based on the name or url. Unfortunately this does not work here and both requests have the same file name. When displaying I just add the extension .md and display this file. Here however then the previous request is represented. If I open the file on the hard disk or in VSCode Editor, the correct content is displayed. It seems that the Markdown Preview uses some kind of caching.

markdown_bug

Tested workaround is to add a random number in the file path and do cache busting, but seems hacky

AnWeber commented 9 months ago

here the same bug without my extension markdown_bug

https://github.com/microsoft/vscode/issues/194421

AnWeber commented 9 months ago

@manderson23 I added some kind of cache busting to prevent the VSCode Bug. I will remove this hack after fix of vscode issue.