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
{{ message }}
Repository navigation
Node SDK: add unit tests for the delete segments command #4795
DELETE_SEGMENTS.serialize in the Node SDK has no unit test. It calls serializeSegmentsParams in foreign/node/src/wire/segment/segment.utils.ts, which writes the stream identifier, the topic identifier, a uint32 partition id and a uint32 segment count, and throws when the count is below 1 or above 1000.
Affected area / component
Node SDK
Proposed solution
Add foreign/node/src/wire/segment/delete-segments.command.test.ts, modelled on foreign/node/src/wire/user/create-user.command.test.ts (node:test and node:assert/strict).
Check the exact output bytes for numeric identifiers and for string identifiers. Build the expected buffer by hand with Buffer.concat, so the test does not call the code it checks. identifier.utils.ts shows how identifiers serialise.
Check that a count of 1 and a count of 1000 are accepted, and that 0 and 1001 throw.
The error message says Topic partition_count must be between 1 and 1000, copied from the partition code. Only check that it throws; fixing the wording is a separate change.
How to test:npm run test:unit and npm run lint pass in foreign/node.
Good first issue
I think this could be a good first issue for a new contributor
Hi @justinmclean, I'd like to take this one if it's still available. It would be my first contribution to Iggy.
My plan, following the description:
Add foreign/node/src/wire/segment/delete-segments.command.test.ts, modelled on create-user.command.test.ts (node:test + node:assert/strict).
Check the exact output bytes for both numeric and string stream/topic identifiers. I'll build the expected buffer by hand with Buffer.concat, following identifier.utils.ts, so the test doesn't call the code it checks.
Cover the count limits: 1 and 1000 are accepted, 0 and 1001 throw. I'll only check that it throws, not the message wording.
Run npm run test:unit and npm run lint in foreign/node before opening the PR.
Activity
himanchalkaushale commentedon Nov 9, 2026
@justinmclean I want to work on this issue. Assign me
justinmclean commentedon Nov 9, 2026
All yours, if you have any questions just ask.
github-actions commentedon Nov 9, 2026
Note for maintainers: @himanchalkaushale is also assigned to good first issue #4700. New contributors take one good first issue. See CONTRIBUTING.md.
slbotbm commentedon Nov 9, 2026
@himanchalkaushale since you've already completed one good first issue, i've unassigned you.
armnkumar321-spec commentedon Nov 9, 2026
Hi @justinmclean, I'd like to take this one if it's still available. It would be my first contribution to Iggy.
My plan, following the description:
foreign/node/src/wire/segment/delete-segments.command.test.ts, modelled oncreate-user.command.test.ts(node:test+node:assert/strict).Buffer.concat, followingidentifier.utils.ts, so the test doesn't call the code it checks.npm run test:unitandnpm run lintinforeign/nodebefore opening the PR.Could you assign it to me? Thanks!
justinmclean commentedon Nov 9, 2026
all yours @armnkumar321-spec