Skip to content

Commit 5334653

Browse files
author
dirkwa
committed
docs(plugins): base correcter guidance on republish vs in-place edit
Reword the "don't use registerDeltaInputHandler" rationale so it no longer hinges on input handlers running after source-priority filtering. That ordering is being fixed in SignalK#2748 (handlers will run before priority), so the previous justification would become stale once that lands. The durable reason stands either way: an input handler edits a delta in place, whereas a correction plugin republishes under its own $source and lets priority choose — two different patterns.
1 parent ca8bcc1 commit 5334653

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/develop/plugins/deltas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ A correction plugin needs its **input** at full rate, _independent_ of the prior
273273

274274
- `sourcePolicy: 'all'` delivers every source at full rate with no cascade on your input. Skip updates whose `$source` is your own `plugin.id` so you don't reprocess your output. The global priority cascade still applies to consumers, so the user's ranking of your output works as expected.
275275

276-
Do **not** use `registerDeltaInputHandler` for this: delta input handlers run **after** source-priority filtering, so once the user ranks your output above the raw source the filter removes the raw value before your handler sees it — the handler stops firing, your value goes stale, the path falls back to the raw source, your handler fires once, and the path oscillates.
276+
Do **not** use `registerDeltaInputHandler` for this. An input handler is for modifying a delta in place as it passes through, not for republishing a value under your own source — a correction plugin emits its corrected value under its own `$source` and lets source priority choose between that and the raw source, which is a different shape from rewriting the incoming delta. Subscribe-and-emit keeps the raw and corrected values as two distinct sources the user can rank.
277277

278278
`excludeSelf` (see [Excluding Sources](#excluding-sources-excludesources--excludeself)) is a different tool and **not** what you want for a full-rate correction. It runs the priority cascade on your input feed, so it delivers a single ranked-and-throttled upstream value rather than every reading: with the user ranking your plugin rank-0, the real source is held as a lower-ranked fallback and only reaches you after the fallback timeout. `excludeSelf` fits a plugin that wants _the preferred remaining upstream value_ (e.g. "show source B, fall back to A, never my own C"), not one that corrects each raw sample.
279279

0 commit comments

Comments
 (0)