You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, we need to improve that. The TL;DR is that offset is an int64, and we use strings to represent those values, so you don't lose anything on precision issues. Internally we convert the input to our internal representation of a BigInt, so the number and the string inputs will work. Accepting the number is just a quality of life improvement on the developer experience. Most of the types came from community contributions, and perhaps the contributor never reached offsets greater than an int32. We should update the definition to accept both types, and I think we also accept BigInt there nowadays.
Do you think you could create a PR to add string | number?
Describe the bug
There's a mismatch between the documentation about the seek method here:
https://kafka.js.org/docs/consuming#a-name-seek-a-seek
And the related type of the function:
https://github.com/tulios/kafkajs/blob/master/types/index.d.ts#L843
The documentation says that the offset should be a number:
consumer.seek({ topic: 'example', partition: 0, offset: 12384 })
But the seek method type has a signature that requires a string:
seek(topicPartition: { topic: string; partition: number; offset: string }): void
To Reproduce
No need to reproduce the error.
Expected behavior
offset type should be a number.
Observed behavior
offset is a string.
The text was updated successfully, but these errors were encountered: