-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Describe the bug
When loading Solidity code into Remix via the code URL parameter together with remaps, opening a second contract in a new Remix window appears to reuse shared workspace state across both windows and overwrite remappings.txt.
To Reproduce
Steps to reproduce the behavior:
- Open Remix in a new window with a URL that includes an encoded Solidity file in
#code=...and a first set of remappings in#remaps=.... Example first URL. - Observe that compile passes, and the file explorer shows the single contract and remappings.txt.
- In a separate new window, open Remix again with a different encoded Solidity file and a different set of remappings. Example second URL.
- Observe that the second window's compile passes and file explorer looks correct as well.
- In the first window, click
remappings.txtin the file explorer. - Observe that the first window's
remappings.txthas been replaced with the second window's remappings, and the second contract also appears in the first window's workspace. - Observe that the first contract now fails to compile because its remappings are no longer correct.
- In the second window, click
remappings.txt. - Observe that the first contract also appears there, indicating that both windows are sharing the same workspace state.
Expected behavior
Loading a second contract in another Remix window with a different remaps payload should not overwrite remapping state in a way that breaks compilation for the first contract.
Desktop (please complete the following information):
- OS: macOS
- Browser: Brave
- Version: 2.0.2
Additional context
Relates to #6454
The single-launch flow works correctly, but after loading two contracts with different remapping sets in separate Remix windows, opening remappings.txt in either window reveals shared workspace state and the first contract can stop compiling.
The docs for loading Solidity code via code suggest that this flow uses a code-sample workspace, so it is not clear whether the current behavior is intended or whether there is a recommended way to avoid remappings.txt collisions:
https://remix-ide.readthedocs.io/en/latest/locations.html#load-a-solidity-file-in-the-editor-via-an-encoded-base64-string