Repository navigation
Say when the source fields will not be applied, rather than after publish - #26
Merged
Merged
Conversation
…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
Merged
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.
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:
disabledOptionsgreys a field out, andParameterInputFull.vuewatches the read-only transition and resets any parameter carryingdisabledOptionsto its default. Switching the Source picker to "From list" would wipe a webhook secret typed a moment earlier.displayOptions.hideloses it later instead:getNodeParametersskips parameters that are not displayed, so the values go when the workflow saves.I built it with
disabledOptionsfirst and found this while verifying it renders —disabledOptionsappears 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
showandhidetogethershowis AND-ed across its keys, so "picked from the list OR opted in" isn't one clause.show+hidereads as "picked from the list, and not opted in":options.updateExistingSourceresolves as a dotted key from the top level because n8n reads these with lodashget— 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.modeislistonly 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.mdalso 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.