EventStore-Client-NodeJS icon indicating copy to clipboard operation
EventStore-Client-NodeJS copied to clipboard

AllStreamResolvedEvent.commitPosition declares as a bigint but is deserialized as a number

Open aovens-quantifi opened this issue 5 months ago • 1 comments

🐛 Current behavior

I'm using commitPosition to track my position for subsequent calls to readAll. In the old client it was a bigint, this library declares it as a bigint and I think it should be a bigint in order to hold large commit positions.

Here is the console log of a resolved event:

{
  event: {
    streamId: '...',
    id: '8dd912be-af55-4892-ba36-ab9102129318',
    revision: 60,
    type: '...',
    data: {
      ...
    },
    metadata: undefined,
    isJson: true,
    created: 2025-06-18T15:24:11.000Z,
    position: { commit: 1245436n, prepare: 1245436n }
  },
  commitPosition: 1245436
}

🔍 Steps to reproduce

Read an event using readAll() and check the type of commitPosition

Reproducible link

<n/a>

💭 Expected behavior

commitPosition should be a bigint, similar to event.event.position.commit

Package version

"@kurrent/kurrentdb-client": "^1.0.2"

KurrentDB Version

24.10.5.2125-experimental

Connection string

kurrentdb+discover://localhost:2113?tls=false

☁️ Deployment Environment

Single-node (Docker)

Other Deployment Details

No response

Operating system

No response

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

aovens-quantifi avatar Jun 18 '25 15:06 aovens-quantifi

Looking through the code, I think this is an issue in the underlying bridge

aovens-quantifi avatar Jun 18 '25 15:06 aovens-quantifi

The issue is during the conversion of the event from the bridge client. I've submitted a PR to address this issue. Once it's reviewed and approved, I'll release a patch version

w1am avatar Jun 19 '25 06:06 w1am