bruno icon indicating copy to clipboard operation
bruno copied to clipboard

[BUG] Deleted Request Variables are stilling being used

Open peerb opened this issue 1 year ago • 6 comments

Deleted Request Variables are stilling being used in the request.

Steps to reproduce:

  1. Create new a new collection
  2. Create new "GET" Request with variable in path: https://run.mocky.io/{{version}}/3561f32c-66a5-44d9-9c2f-7398b118468a
  3. Go to the "Vars" tab in this request and send the request
  4. Add the var with the name "version" and value "v3"
  5. Send request and check the "Timeline" tab to verify "v3" is used for "version" in the path
  6. Go to the "Vars" tab and delete the "version" var
  7. Send request
  8. For the result go to the "Timeline" tab: After deleting the var "version" from the "Vars" tab, it is still used in the request.

ezgif-5-eff3302b95

peerb avatar Feb 08 '24 08:02 peerb

Just my 2 cents: a clean solution could be to implement the delete as: deactivate + delete.

epestela avatar Feb 09 '24 07:02 epestela

@epestela how about one step at a time with the current quality? Pull request for activate/deactivate ist already open: #1101

peerb avatar Feb 09 '24 09:02 peerb

@peerb I agree and I might have not bean clear in my previous comment. I did not mean to ask to fix both cases together. I meant to use the disable feature for the (future) delete fix

  • on delete request
    • disable the variable
    • remove the variable

but it was just a suggestion

epestela avatar Feb 09 '24 09:02 epestela

@epestela thanks for clarifying. No it is understood, but this would be the case if the var would delete.

peerb avatar Feb 09 '24 10:02 peerb

Entire request context should be cleared between calls. If you create a variable using a script and then you don't create it on your next run of that same script (because you changed the script), the variable is still there.

https://github.com/usebruno/bruno/assets/33555533/09a9c42a-2e5a-4add-bf52-5874e6201456

DT209 avatar Mar 11 '24 18:03 DT209

@DT209 thank you for the input. This is already addressed in #1539 and the pull request is waiting for approval.

peerb avatar Mar 12 '24 06:03 peerb

The Request variables - in the Vars Tab are supposed to be scoped only under the context of request execution.

Before v1.20.2 the request variables were being persisted and were getting leaked into the global scope. This was a bug and it has been fixed in the latest release.

We have also added support for Folder Level Variables which gets applied to all requests under the folder.

helloanoop avatar Jul 09 '24 10:07 helloanoop