@flowdrop/flowdrop 2.2.1 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.2.2] - 2026-08-18
11
+
12
+ ### Fixed
13
+
14
+ - **The interface's last entry could not be removed.** Removing the only remaining entry did nothing — the row stayed on screen. It surfaced most often as "I cannot delete the output entry", since that is usually the last one standing. An emptied interface was reported as `undefined`, which is indistinguishable from "no interface supplied, leave it alone", so the removal was dropped before it reached the store — and, because the save omitted the key for the same reason, a cleared interface came back on reload even once the row had gone.
15
+
10
16
  ## [2.2.1] - 2026-08-18
11
17
 
12
18
  ### Fixed
@@ -197,20 +197,30 @@
197
197
  }
198
198
 
199
199
  /**
200
- * Commit a direction's entry list back to the workflow, collapsing to
201
- * `undefined` when the whole interface ends up empty (decision 5: additive
202
- * and optional — an interface nobody populated should not linger as `{}`).
200
+ * Commit a direction's entry list back to the workflow, dropping a side that
201
+ * ends up empty so it reads as "declares nothing on this side".
202
+ *
203
+ * Always reports an interface *object*, even when the author has emptied both
204
+ * sides. Reporting `undefined` there — as this did — made removing the last
205
+ * entry impossible: the store treats `interface: undefined` as "no interface
206
+ * key supplied, leave it alone", so the removal never landed and the row
207
+ * stayed on screen. The server draws the same distinction, and for the same
208
+ * reason: an absent `interface` is a partial update that must not disturb
209
+ * port exposures authored elsewhere (the Drupal admin form), while a present
210
+ * one rewrites both sides — so `{}` is what "the author emptied this" has to
211
+ * look like on the wire.
212
+ *
213
+ * Decision 5 (additive and optional — an interface nobody populated should
214
+ * not linger as `{}`) still holds: a workflow nobody has authored an
215
+ * interface for never reaches this function, and keeps its absent key.
203
216
  */
204
217
  function commit(direction: Direction, next: WorkflowInterfaceEntry[]): void {
205
218
  const inputs = direction === 'inputs' ? next : (workflow.interface?.inputs ?? []);
206
219
  const outputs = direction === 'outputs' ? next : (workflow.interface?.outputs ?? []);
207
- const cleanedInputs = inputs.length > 0 ? inputs : undefined;
208
- const cleanedOutputs = outputs.length > 0 ? outputs : undefined;
209
- if (!cleanedInputs && !cleanedOutputs) {
210
- onChange(undefined);
211
- return;
212
- }
213
- onChange({ inputs: cleanedInputs, outputs: cleanedOutputs });
220
+ onChange({
221
+ inputs: inputs.length > 0 ? inputs : undefined,
222
+ outputs: outputs.length > 0 ? outputs : undefined
223
+ });
214
224
  }
215
225
 
216
226
  function addEntry(direction: Direction): void {
@@ -667,7 +667,11 @@ export class WorkflowStore {
667
667
  description: updates.description
668
668
  }),
669
669
  ...(updates.config !== undefined && { config: updates.config }),
670
- ...(updates.interface !== undefined && { interface: updates.interface }),
670
+ // Keyed on presence, not on value: `undefined` is a meaningful interface —
671
+ // "this workflow declares no contract" — so a caller clearing it must be
672
+ // able to say so. Testing `!== undefined` silently dropped that update and
673
+ // left the old contract in place.
674
+ ...('interface' in updates && { interface: updates.interface }),
671
675
  metadata: buildMetadata(this.#workflow.metadata, updates.metadata ?? undefined)
672
676
  };
673
677
  this.#pushToHistory('Batch update');
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "A drop-in visual workflow editor for any web application. You own the backend. You own the data. You own the orchestration.",
4
4
  "license": "MIT",
5
5
  "private": false,
6
- "version": "2.2.1",
6
+ "version": "2.2.2",
7
7
  "author": "Shibin Das (D34dMan)",
8
8
  "bugs": {
9
9
  "url": "https://github.com/flowdrop-io/flowdrop/issues"