Same-length editor content updates fixed
The JSON editor was silently dropping content updates when replacement text matched the original length—the watch guard required different string lengths before rebuilding. Now the editor updates whenever the content actually changes, regardless of character count.
The JSON editor had a watch handler guard that prevented editor rebuilds when content was replaced with same-length strings. When a credential was updated from old to ***, both three characters, the editor would silently ignore the change — showing stale content while the backend held the new value.
The fix removes the faulty length check. The guard now compares only whether content actually differs, using strict equality instead of character-count comparison. The guard was also tightened from a loose editorValue && check to the more precise editorValue !== undefined, correctly handling empty-string states that previously fell through.
In the frontend editor UI, the shared JSON editor component now reliably refreshes on all content updates — whether the new string is longer, shorter, or exactly the same length.
View Original GitHub Description
Summary
The JsonEditor watch handler had a guard condition that required the incoming value to differ in length before rebuilding the editor. This caused silent no-ops when an external update replaced the content with a string of the same character count — for example, replacing old (3 chars) with *** (3 chars) after a credential save.
- Remove the length check; now the editor rebuilds whenever the content actually differs (
editorValue !== newValue) - Also tighten the guard from
editorValue &&toeditorValue !== undefinedto correctly handle empty-string editor state
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/IAM-408
Review / Merge checklist
- PR title and summary are descriptive. (conventions)
- Docs updated or follow-up ticket created.
- Tests included.
- PR Labeled with
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)