Skip to content

Say when the source fields will not be applied, rather than after publish - #26

Merged
leggetter merged 3 commits into
mainfrom
fix/source-fields-inert-when-adopting
Sep 8, 2026
Merged

leggetter merged 3 commits into
mainfrom
fix/source-fields-inert-when-adopting

Conversation

@leggetter

Copy link
Copy Markdown
Contributor

Closes #14.

Picking a source from the list adopts it exactly as Hookdeck has it configured — Source Type, Verification and the secret fields are ignored unless Options → Update Existing Source is on. The only sign of that was a warning logged after publish, by which point someone has filled the fields in and believes they configured verification.

A notice now appears the moment a source is picked from the list.

Deviation from the issue, deliberately

The issue asks for the fields to be visibly inert unless the checkbox is ticked. Both mechanisms n8n has for that destroy what is in them:

  • disabledOptions greys a field out, and ParameterInputFull.vue watches the read-only transition and resets any parameter carrying disabledOptions to its default. Switching the Source picker to "From list" would wipe a webhook secret typed a moment earlier.
  • displayOptions.hide loses it later instead: getNodeParameters skips parameters that are not displayed, so the values go when the workflow saves.

I built it with disabledOptions first and found this while verifying it renders — disabledOptions appears in two nodes-base nodes and nothing documents what it does to a value. A confusing field beats a deleted secret, so the fields stay editable and the notice carries the explanation. There's a regression test asserting neither mechanism is used here, because reading the issue leads straight back to them.

Why the condition needs show and hide together

show is AND-ed across its keys, so "picked from the list OR opted in" isn't one clause. show + hide reads as "picked from the list, and not opted in":

show: { 'source.mode': ['list'] },
hide: { 'options.updateExistingSource': [true] },

options.updateExistingSource resolves as a dotted key from the top level because n8n reads these with lodash get — so the checkbox did not have to be lifted out of the collection, which would have changed its path and dropped the setting from every workflow that had it on.

source.mode is list only when the source came from Hookdeck, so it exists. A source given by name is created if the name is free and adopted if it is taken, and nothing on screen knows which — that case keeps the post-publish warning, which is the only honest place to report it.

Verification

Dumped both nodes' full parameter trees (path, type, displayOptions, disabledOptions, default) before and after: the action node's is identical, and the trigger's differs by the notice alone — no existing field changed type, visibility or default. 114 unit tests, lint, scan and the load check pass.

CONTRIBUTING.md also now states that a breaking change is a MINOR bump while pre-1.0, matching what the release skill already said and resolving the contradiction between them.

leggetter and others added 3 commits September 8, 2026 10:41
…lish

Closes #14.

Picking a source from the list adopts it exactly as Hookdeck has it configured.
Source Type, Verification and the secret fields below are ignored in that case
unless Options → Update Existing Source is on, and until now the only sign was a
warning in the log after publishing — by which point someone has filled the
fields in, published, and believes they configured verification.

A notice now appears the moment a source is picked from the list. It is exact
about the one case the editor can be certain about: `source.mode` is `list` only
when the source came from Hookdeck, so it exists. A source given by name is
created if the name is free and adopted if it is taken, and nothing on screen
knows which — that case keeps the post-publish warning, which is the only honest
place to report it.

The condition needs both halves of `displayOptions`: `show` is AND-ed across its
keys, so "picked from the list OR opted in" cannot be written as one clause,
while `show` with `hide` reads as "picked from the list, and not opted in".
`options.updateExistingSource` works as a dotted key from the top level because
n8n resolves these with lodash `get`, so the checkbox did not have to be lifted
out of the collection — which would have changed its path and dropped the
setting from every workflow that had it on.

## Why the fields are not greyed out

The issue asked for them to be visibly inert. Both mechanisms n8n has for that
destroy what is in them, which is worse than the problem:

- `disabledOptions` is the built-in for greying out, and
  `ParameterInputFull.vue` watches the read-only transition and resets any
  parameter carrying `disabledOptions` to its default. Switching the Source
  picker to "From list" would wipe a webhook secret typed a moment earlier.
- `displayOptions.hide` loses it later instead: `getNodeParameters` skips
  parameters that are not displayed, so the values go when the workflow saves.

Verified in n8n's source rather than assumed, because `disabledOptions` appears
in exactly two nodes-base nodes and there is no documentation of what it does to
a value. A test asserts neither mechanism is used on these fields, since reading
the issue would lead someone straight back to them.

The action node is untouched: its Source > Get or Create always applies what it
asks for. Confirmed by dumping both nodes' full parameter trees before and
after — the action node's is identical, and the trigger's differs by the notice
alone, with no existing field's type, displayOptions or default changed.

CONTRIBUTING now says a breaking change is a MINOR bump while pre-1.0, which is
the maintainer's call and matches what the release skill already said.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6ZF876ibkomShmV6rSKLn
Two problems visible in the same screenshot, both from keying on the picker's
mode alone.

The notice said "This source already exists" with nothing selected. Switching to
"From list" sets the mode before there is a value, so the sentence was a
statement about a source the user had not chosen yet. It now also requires
`source.value` to exist — n8n's `exists` condition rejects '', null and
undefined, which covers the empty selection and a resourceLocator with no value
key.

And `setupNotice` is directions to a source that exists: "The URL to give your
provider appears under Source → From list once the source exists — create one in
Hookdeck, or name one below and publish." Read that while the picker is already
on "From list" and it advises the thing you just did, then points at a mode you
are not in. It hides in list mode, which also stops two notices stacking at the
top of the panel — the failure the comment above it was written to avoid.

`IDisplayOptions` on the constant because `{ exists: true }` widens to
`boolean` in a bare object literal and the type wants the literal `true`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U6ZF876ibkomShmV6rSKLn
@leggetter
leggetter merged commit cc52615 into main Sep 8, 2026
3 checks passed
@leggetter
leggetter deleted the fix/source-fields-inert-when-adopting branch September 8, 2026 11:44
@leggetter leggetter mentioned this pull request Sep 9, 2026
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.

Source Type and Verification are editable and "saved" but never applied when an existing source is adopted

1 participant