Skip to content

fix: follow a selected path that disappears from its source at runtime - #62

Merged
windischb merged 1 commit into
developfrom
fix/select-section-removed-at-runtime
Oct 5, 2026
Merged

windischb merged 1 commit into
developfrom
fix/select-section-removed-at-runtime

Conversation

@windischb

Copy link
Copy Markdown
Contributor

Summary

  • A rule with .Select(...) kept serving its previous values when the selected path was removed from the source at runtime. No error, no notification, health stayed Healthy; only a restart corrected it.
  • Cause: TransformCache.ProcessProviderChange swallowed the KeyNotFoundException of the failed select as "nothing changed", so the cache stayed valid and later recomputes never fetched again.
  • Fix: a missing path now drops the cache and publishes a change. The next recompute goes through the fetch path and behaves as at startup — an optional rule contributes nothing and is reported as failed (Degraded), a required rule keeps the last good snapshot and is reported. Repeated changes that still lack the path trigger only one recompute. Malformed documents caught mid-write are still ignored.

Behaviour change

A source that delivers {} at runtime (for example a deleted file) now also resets a Select rule to its defaults, matching rules without Select.

Test plan

  • New SelectedSectionRemovedTests (optional rule incl. recovery, Select + MountAt, required rule) — all three failed before the fix
  • dotnet test ./src -c Release --filter "Type!=Performance" — all green

🤖 Generated with Claude Code

The change handler swallowed the KeyNotFoundException of a failed Select as
"nothing changed", so the transform cache stayed valid and every later recompute
kept serving the bytes from before the path was removed. Only a restart
corrected it, and health stayed Healthy.

A well-formed document without the selected path is new content. It now drops
the cache and publishes a change, so the next recompute goes through the fetch
path and decides optional versus required exactly as it does at startup.
Malformed documents caught mid-write are still ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@windischb
windischb merged commit 33e4667 into develop Oct 5, 2026
@windischb
windischb deleted the fix/select-section-removed-at-runtime branch October 5, 2026 15:44
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.

1 participant