bbovenzi commented on code in PR #55558:
URL: https://github.com/apache/airflow/pull/55558#discussion_r2355736408


##########
airflow-core/src/airflow/ui/src/pages/Connections/ConnectionForm.tsx:
##########
@@ -96,6 +96,19 @@ const ConnectionForm = ({
     mutateConnection(data);
   };
 
+  // Check if extra fields have changed by comparing with initial connection
+  const isExtraFieldsDirty = (() => {
+    try {
+      const initialParsed = JSON.parse(initialConnection.extra) as 
Record<string, unknown>;
+      const currentParsed = JSON.parse(extra) as Record<string, unknown>;
+
+      return JSON.stringify(initialParsed) !== JSON.stringify(currentParsed);
+    } catch {
+      // If parsing fails, fall back to string comparison
+      return extra !== initialConnection.extra;
+    }
+  })();

Review Comment:
   I don't think parsing and stringifying does anything helpful here.
   
   Either we just do `extra !== initialConnection.extra` or we we iterate 
through initialParsed with Object.keys to actually compare each key/value pair



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to