Skip to content

fix(data): the collections GetStream overload names what it could not reduce - #3007

Merged
rbuergi merged 2 commits into
mainfrom
fix/2990-followup-reduce-stream-diagnostic
Sep 1, 2026
Merged

rbuergi merged 2 commits into
mainfrom
fix/2990-followup-reduce-stream-diagnostic

Conversation

@rbuergi

@rbuergi rbuergi commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #3004 (which closed #2990). Lands the one review finding that arrived after
auto-merge had already taken #3004.

#3004 gave Workspace.ReduceLocalStream a diagnostic that names the reference and the owning hub —
because the bare InvalidOperationException("Failed to create stream") is precisely why three
deliberate fault classifiers in SubscribeWithReEstablish could not recognise a boot-time probe's
own-node read, and reported it as a transient production ERROR.

The adjacent GetStream(params Type[] types) overload kept the old bare message, so the same
ReduceStream failure stayed unclassifiable from one of the two call paths. It now names the
resolved collection names and the hub, matching its sibling.

Behaviour is otherwise unchanged: the collections array is hoisted to a local purely so the message
can quote it, and the unknown-type ArgumentException still throws from the projection, before any
reduce.

MeshWeaver.Data.Test 419/419 green; dotnet build src/MeshWeaver.Data -c Release -warnaserror
clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SD7aiLSo59xng2TzU32xEa

… reduce

#3004 gave Workspace.ReduceLocalStream a diagnostic that names the reference and the
owning hub, because the bare InvalidOperationException("Failed to create stream") is
exactly why three deliberate fault classifiers in SubscribeWithReEstablish could not
recognise a boot-time probe's own-node read (#2990). The adjacent
GetStream(params Type[] types) overload kept the old bare message, so the same
ReduceStream failure stayed unclassifiable from one of the two call paths — the
inconsistency Copilot's review of #3004 caught.

It now names the resolved collection names and the hub, matching its sibling. The
collections array is hoisted to a local so the message can quote it; behaviour is
otherwise unchanged (the unknown-type ArgumentException still throws from the
projection, before any reduce).

MeshWeaver.Data.Test: 419/419 green. Release -warnaserror clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SD7aiLSo59xng2TzU32xEa

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is narrowly scoped to diagnostic clarity and matches the PR description, with no functional behavior changes for valid inputs.

Pull request overview

This PR aligns Workspace.GetStream(params Type[] types) with the improved diagnostic contract introduced for Workspace.ReduceLocalStream, so ReduceStream failures are no longer reported with an unclassifiable bare "Failed to create stream" message.

Changes:

  • Replace the bare InvalidOperationException("Failed to create stream") with a message that includes the resolved collection names and owning hub address.
  • Hoist the resolved collection names into a local variable so they can be quoted in the failure message.
  • Add XML doc remarks stating the shared diagnostic contract with ReduceLocalStream.
File summaries
File Description
src/MeshWeaver.Data/Workspace.cs Improves GetStream(Type[]) reduce-failure diagnostics to include collections + hub, matching ReduceLocalStream behavior.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/MeshWeaver.Data/Workspace.cs Resolved
@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

216 tests  ±0   216 ✅ ±0   2m 35s ⏱️ +2s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit a02216e. ± Comparison against base commit 812f7dd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

586 tests  ±0   586 ✅ ±0   58s ⏱️ +10s
  2 suites ±0     0 💤 ±0 
  2 files   ±0     0 ❌ ±0 

Results for commit a02216e. ± Comparison against base commit 812f7dd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

    3 files  ±0      3 suites  ±0   1m 10s ⏱️ -3s
1 218 tests ±0  1 026 ✅ ±0  192 💤 ±0  0 ❌ ±0 
1 219 runs  ±0  1 027 ✅ ±0  192 💤 ±0  0 ❌ ±0 

Results for commit a02216e. ± Comparison against base commit 812f7dd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

419 tests  ±0   419 ✅ ±0   1m 22s ⏱️ -5s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit a02216e. ± Comparison against base commit 812f7dd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

531 tests  ±0   529 ✅ ±0   1m 31s ⏱️ -2s
  4 suites ±0     2 💤 ±0 
  4 files   ±0     0 ❌ ±0 

Results for commit a02216e. ± Comparison against base commit 812f7dd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

1 693 tests  +3   1 693 ✅ +3   1m 40s ⏱️ -10s
    3 suites ±0       0 💤 ±0 
    3 files   ±0       0 ❌ ±0 

Results for commit a02216e. ± Comparison against base commit 812f7dd.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   14 files  ±0     14 suites  ±0   9m 20s ⏱️ -6s
4 663 tests +3  4 469 ✅ +3  194 💤 ±0  0 ❌ ±0 
4 664 runs  +3  4 470 ✅ +3  194 💤 ±0  0 ❌ ±0 

Results for commit a02216e. ± Comparison against base commit 812f7dd.

♻️ This comment has been updated with latest results.

…asserted

Copilot's review of #3007 read `collections!` as redundant on the grounds that ToArray()
never returns null. The suppression was not about the array: TryGetCollectionName's out
parameter is `string?`, so the projection is `string?` and the array is `string?[]`,
which CollectionsReference (IReadOnlyCollection<string>) rejects with CS8620 — an error
under CI's -warnaserror. Removing the `!` alone would red the build.

The finding is still right that a suppression is the wrong shape here, so the invariant is
now CHECKED rather than asserted: `&& name is not null` makes the projection a real
`string`, the array a `string[]`, and the suppression unnecessary. It also closes the
case the suppression silently allowed — a `true` return with a null name would have gone
into the reference as a null collection name; it now throws the same unknown-type
ArgumentException every other unresolvable type gets.

Deliberately NOT changed: argument validation for a null `types` array or a null element.
That NRE is pre-existing, is a programming error at the call site, and validating it is a
separate change from this one's subject (an unclassifiable diagnostic message).

MeshWeaver.Data.Test: 419/419 green. Release -warnaserror clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SD7aiLSo59xng2TzU32xEa
@rbuergi
rbuergi merged commit dd8d277 into main Sep 1, 2026
25 of 26 checks passed
@rbuergi
rbuergi deleted the fix/2990-followup-reduce-stream-diagnostic branch September 13, 2026 10:24
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.

ActivityControlPlane watcher reports the boot-time content-type probe as a transient ERROR and arms a re-establish

2 participants