Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4520

Provide a legacy callback client and deprecate optional callback parameters

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.10.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Needed
    • Hide

      Consult node team

      Show
      Consult node team

      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

      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

       

        There are no Sub-Tasks for this issue.

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            daria.pardue@mongodb.com Daria Pardue
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: