-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(mongo): rewrite Buffer as ? during serialization #14071
Conversation
size-limit report 📦
|
let isBuffer = false; | ||
if (typeof Buffer !== 'undefined') { | ||
isBuffer = Buffer.isBuffer(value); | ||
} | ||
return isBuffer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary, all our node versions should support this so let's just check normally here :)
Have we considered trying to upstream this into OTel's mongo instrumentation? Seems like a nicer default than what they've got, and it helps share the maintenance of the code. (Doesn't have to block this PR though, we can always take it back out if/when it gets upstreamed). |
@mjq yes, I will upstream and keep an eye on when we can roll this code back. |
Buffer
, which Mongoose uses some instances rather than astring
serializes as{"0": "?", "1": "?", "2": "?"}
.yarn lint
) & (yarn test
).