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

Investigate NODE-4108 - session.withTransaction has wrong return type

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 3
    • Not Needed

      NODE-4108 Description

      What problem are you facing?

      The Node.js Driver types for session.withTransaction are completely wrong and misleading

      What driver and relevant dependency versions are you using?

      `mongodb@4.4.1` 

      Steps to reproduce?

      Look at the code in mongodb.d.ts. It says that the return type depends on the input to the withTransaction function. But in runtime, the function always returns :

       

      
      
      { "ok": 1,"$clusterTime": { "clusterTime": { "$timestamp": "7077570972357754881" }, "signature": { "hash": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=", "keyId": 0 } }, "operationTime": { "$timestamp": "7077570972357754881" } }
      
      

       I don't know if this is a bug in `withTransaction` - or a type issue - but it needs to be fixed soon. I have tried to raise attention about this for almost a year in the community 😅

       

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            dbeng-pm-bot PM Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: