Skip to content

JSON environment is not saved when json format becomes valid for the first time[INS-5894] - #8816

Merged
cwangsmv merged 1 commit into
developfrom
fix/environment-editor-save-issue
Jun 30, 2025
Merged

JSON environment is not saved when json format becomes valid for the first time[INS-5894]#8816
cwangsmv merged 1 commit into
developfrom
fix/environment-editor-save-issue

Conversation

@cwangsmv

Copy link
Copy Markdown
Contributor

Reproduce Step:

  1. Existing JSON environment:
{"foo": "bar"}

2.Insert a new row(Invalid JSON since comma is missing for the first line)

{
"foo": "bar"
"foo1": "bar"
}

3.Add the missing comma and close the editor

{
"foo": "bar",
"foo1": "bar"
}

4.The environment has not been saved

The root cause is that when json becomes valid for the first time, the isValid() ref still returns the false since error state is not updated yet.
Add a new ref to save the error message and isValid() ref will use the ref to detect if the json content is valid or not.

@cwangsmv
cwangsmv requested a review from gatzjames June 27, 2025 02:07
@cwangsmv
cwangsmv force-pushed the fix/environment-editor-save-issue branch from d5de6f0 to 7f531c4 Compare June 30, 2025 02:01
@cwangsmv
cwangsmv merged commit d476b25 into develop Jun 30, 2025
@cwangsmv
cwangsmv deleted the fix/environment-editor-save-issue branch June 30, 2025 02:01
RoamingLost pushed a commit to RoamingLost/insomnia that referenced this pull request Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants