Skip to content

Preserve BSON document hooks through generic interfaces - #43

Merged
liran merged 2 commits into
mainfrom
fix/mongodb-interface-marshaler
Nov 12, 2026
Merged

liran merged 2 commits into
mainfrom
fix/mongodb-interface-marshaler

Conversation

@liran

@liran liran commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Collection writes add a pointer around their generic document value. For interface document types, that wrapper bypassed the BSON driver’s top-level MarshalBSON selection and could invoke MarshalBSONValue instead or reject a non-empty interface.

Unwrap only the artificial interface pointer before encoding, leaving concrete typed pointers unchanged. Regression tests cover concrete, any and non-empty interface documents with both BSON hooks; they fail before the correction and pass with the full race-enabled suite afterward.

@liran liran self-assigned this Nov 12, 2026
@liran
liran merged commit 7a48e1a into main Nov 12, 2026
3 checks passed
@liran
liran deleted the fix/mongodb-interface-marshaler branch November 12, 2026 16:19
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