-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
Acceptance Criteria
- Deprecate all optional callback parameters (overloads) in public methods and emit a runtime warning when a callback is detected
- Follow up with Shell to make sure it doesn't negatively affect them
- Provide access to a legacy client that allows callback use and does not emit these warnings
- Ensure the legacy client has distinct metadata from the standard client for Atlas tracking
- Release the client as a separate node module so that we can get npm statistics
- Legacy client should depend on the main driver and expose wrapped methods that are able to handle callbacks
- Do not introduce new error classes, use existing node driver error types
Implementation Requirements
- Deprecate callback signatures in all public methods:
- Exceptions are withSession and withTransaction (since they are specifically designed to use a callback)
- Refer to the following draft design doc: Technical Design: Async Await inside the driver
- Update the document by checking the compiled library for function method signatures and the src code for `callback?` and `cb?`
Testing Requirements
- For ease of maintenance, use a github-only pipeline with unit tests that cover the rewrapped methods:
- callback form
- happy path & error forwarding
- promise form
- happy path & error forwarding
- callback form
Documentation Requirements
- API docs can be minimal and refer to main driver docs instead
- Readme for the legacy driver should briefly explain the purpose and give an example use
- MongoDB docs page should be updated with the deprecation notice for callbacks and point to the legacy driver for callback use