Skip to content

fix(api): repair the #1529 x #1552 merge seam — main is red - #1587

Closed
aaj3f wants to merge 1 commit into
mainfrom
fix/materialize-import-sink-seam
Closed

aaj3f wants to merge 1 commit into
mainfrom
fix/materialize-import-sink-seam

Conversation

@aaj3f

@aaj3f aaj3f commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

main is red at eadc31e (the #1552 merge): two E0308s in fluree-db-api/src/materialize.rs, plus an unused_must_use behind CI's -D warnings. This is a three-line repair.

Why neither PR's CI could see it

This is a semantic seam between two PRs that were each green on their own base:

Merged together, sink.finish() resolves to the trait method returning (), and both destructurings fail to typecheck. Each PR's CI ran against its own pre-merge base; the merge commit is the first place the two changes coexist, and main's CI went red exactly there (parent dcfd7838c = success, eadc31e11 = failure).

The fix

  • Both sink.finish() call sites → sink.into_parts() (the renamed inherent method; same 3-tuple, same error).
  • self.sink.emit_triple(s, p, o) → let _ = self.sink.emit_triple(s, p, o) with a comment stating the contract: ImportSink uses deferred-error semantics — emit_* stashes the first encode failure and into_parts() surfaces it as a hard error — so the discard is deliberate, not lossy. If the materialize owner prefers a per-triple failure site, propagating instead is also sound; happy to follow up.

Verified: cargo check --workspace --all-targets clean at this branch, cargo clippy -p fluree-db-api --all-features --all-targets -- -D warnings clean, fluree-db-api test suite green (counts in the checks below).

Every open PR is currently inheriting this red; nothing else in the repo touches these lines, so this should be safe to land quickly.

main went red at the #1552 merge for a seam neither PR's CI could see:
#1552 renamed the inherent ImportSink::finish() to into_parts() to free
the name for GraphSink::finish() (which returns unit), while #1529 landed
materialize.rs on main during that review with two sink.finish() calls
destructuring the 3-tuple. Merged, finish() resolves to the trait method
and both destructurings fail to typecheck. Each PR ran green against its
own base; the merge commit is the first tree where the two coexist.

Both call sites now use into_parts(). The emit_triple return is discarded
explicitly with the contract stated in place: ImportSink defers errors —
emit_* stashes the first encode failure and into_parts() surfaces it —
so the discard is deliberate, not lossy.
@aaj3f

aaj3f commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #1586, which was opened first and takes the better form on the emit_triple site (real propagation rather than a documented discard — behaviorally identical today since ImportSink's emit_triple unconditionally returns Ok and defers encode errors to into_parts(), but propagation is future-proof if that contract ever changes). Two sessions independently diagnosed the same three sites, which is corroboration for #1586, not a conflict. The seam analysis in this PR's commit message and body applies to #1586 verbatim.

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