-
Type: Task
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
Use Case
As a Node.js engineer
I want a consistent experience with types returned from the server
So that logging and event monitoring is clear and accurate
The Monitor is configured to promoteBuffers, a setting that will change Binary types to Node.js Buffers. This makes the subtype inaccessible and degrades the log-ability and readability of the value.
Mainly, this fixes a logging inconvenience, our hellos are longer than 1000 characters because we are hitting Buffer.prototype.toJSON instead of Binary’s extended JSON format
User Impact
- Depends on our opinion on the reply field of the serverHeartBeat event and how it relates to semver. Technically this field changes depending on the server version/topology you connect to.
Dependencies
- The "signature.hash" field
Unknowns
- Is there any code that depends on this change? The main focus is to make signature.hash a Binary again so that it will inspect as a base64 string. Are there other Binary fields the monitor may receive? Is there any reason they should not be Binary?
Acceptance Criteria
Implementation Requirements
- set promoteBuffers to false in monitor constructor
- The "signature.hash" field should be a Binary
Testing Requirements
- assert the Monitor calls command with promoteBuffers set to false
- Manually verify that signature.hash is a Binary
Documentation Requirements
- API documentation on server reply fields and semver
Follow Up Requirements
- None