Skip to content

[bug] Environment variables fully overridden when changing Environment during pending request #5528

@jakfalter

Description

@jakfalter

Is there an existing issue for this?

N/A

Current behavior

Switching Environments during an active request will completely overwrite all (both current and initial) environment variable values with the values from the Environment that has been selected before. This is a critical data loss issue - user data in environments can be accidentally corrupted by switching environments at the wrong time.

Expected Behavior

Environment variable values should never be updated during request execution.

Steps to reproduce

  1. Create two Environments A and B with the same variable test-variable and set it to ABC in Environment A and DEF in Environment B.
Image Image

Here is how it looks in the Database

Image
  1. Select Environment B.
  2. Now send some kind of request that uses the variable from the environment and does not immediately respond. To test I have sent a simple GET request to koreanbuilds.net as it gave me 5 seconds during which I switched to Environment A.
Image

Now check the contents of Environment A, test-variable is now overwritten with DEF

Image

We can confirm the same by looking into the database

Image

Hoppscotch Version

Server: Self hosted 2025.6.1
Client: MacOS Desktop 2025.6.1

Interceptor

N/A

Browsers Affected

N/A

Operating System

MacOS

Additional Information

N/A

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneed testingNeeds to be tested before merging onto production

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions