theluckystrike opened a new pull request, #4337:
URL: https://github.com/apache/iggy/pull/4337

   ## Which issue does this PR address?
   
   Closes #4331
   
   ## Rationale
   
   Issue #4331 requests the GetSnapshot binary command (code 130) for the Node 
SDK and gives the exact serialization recipe. The Node SDK currently cannot 
fetch system snapshots over the binary protocol.
   
   ## What changed?
   
   Before, `client.getSnapshot()` did not exist; the Node SDK covered system 
stats but not snapshots. After, `GetSnapshot` (code 130) is implemented per the 
issue recipe and mirrored against 
`core/binary_protocol/src/requests/system/get_snapshot.rs`:
   
   - `getSnapshot(command: GetSnapshotCommand)` requests a snapshot for the 
given command and returns `GetSnapshotResult` with `id`, `name`, 
`snapshotType`, `createdAt`, and `content`.
   - Response metadata uses the existing 4-byte-per-field pattern; content is 
length-prefixed UTF-8.
   - Empty `snapshot_types` list is permitted, matching the Rust side.
   
   ## Local Execution
   
   - Passed
   - Pre-commit hooks ran / not ran (project not prek-configured in this 
environment)
   
   Validation: `npm run build` and `npm run test` pass for the iggy-node 
package; wire output byte-compared against the Rust serializer for a sample 
snapshot (id, name, type, timestamps, and payload length fields).
   
   ## AI Usage
   
   1. Claude (Hermes Agent) was used to generate the command file from the 
issue recipe.
   2. Scope: the new `get-snapshot.command.ts` implementation and this PR 
description.
   3. Verification: unit tests plus byte-level comparison of the serialized 
request/deserialized response against the Rust reference implementation.
   4. Yes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to