fix unsaved changes showing when no changes in extensions#6743
Merged
Conversation
Collaborator
|
Hi @zanesq, I tested this, but I wanted to check, Is this change only targeting envVars/request header changes, or does it also cover overall extension changes? When I change the extension name, description, etc., I don’t see any dialog showing up like before cancelling. It wasn’t showing previously either, but I just wanted to confirm whether we wanted to include those cases as well. |
Collaborator
Author
|
@Abhijay007 good catch I will add name and description and also I noticed port is not triggering it. |
Collaborator
I tried editing port it was triggering it for me 🤔 I tried changing it's value in jetbrain extension |
Collaborator
Author
|
@Abhijay007 my bad meant |
This was referenced Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue: The "Unsaved Changes" dialog was appearing when closing the extension configuration modal even when no changes were made. This happened for extensions that had existing environment variables.
Root Cause: In
ExtensionModal.tsx, thehasFormChanges()function had a check calledenvVarsHaveTextthat would returntrueif any environment variable had text in it, regardless of whether it was modified or just loaded from the initial data:This check was meant to catch cases where users typed something but didn't explicitly mark it as edited. However, it caused false positives for existing extensions with environment variables because those env vars already have text in them.
Fix: Removed the
envVarsHaveTextcheck. The other existing checks already cover all necessary cases:envVarsChanged- detects when existing env vars are edited (isEdited === true)envVarsAdded- detects when new env vars are added (length comparison)envVarsRemoved- detects when env vars are removed (length comparison)hasPendingInput- detects when user is typing in the "new env var" input fieldsFiles Changed:
ui/desktop/src/components/settings/extensions/modal/ExtensionModal.tsx- Removed the redundantenvVarsHaveTextcheckui/desktop/src/components/settings/extensions/modal/ExtensionModal.test.tsx- Added a test to verify the fixcloses #6732