Node SDK: send accepts malformed user headers that fail during polling
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Bug description
The Node SDK accepts malformed user headers when sending messages, but polling those messages fails to decode them.
Confirmed cases:
- Empty raw header value.
- String value longer than 255 bytes.
- Int128 value containing only one byte instead of 16.
- Empty string key.
Each send receives a confirmation at offset 0. Polling then fails with “user headers of the message at offset 0 do not decode.” A valid string header sends and polls successfully.
The encoder should reject these invalid headers before sending. Confirmed against a real server using SDK and server revision 7b053f4cbf635d03ba187123a42c0157ac554587.
Related fixes #4481 (Go) and #4670 (HTTP) do not cover the Node encoder. I would like to contribute a regression test first and discuss the fix approach.
Affected area / component
Node.js SDK
Deployment
Docker (DockerHub image)
Versions
SDK and server revision: 7b053f4cbf635d03ba187123a42c0157ac554587
Server image: apache/iggy:edge
Image digest: sha256:3dba2cd7b16e0362112ae248507b4a7b2eb27593332c6421386011fb1795975d
Hardware / environment
macOS, Node.js v24.4.1, fresh single-node Iggy server in Docker. Tested using the upstream Node SDK over TCP, with isolated container storage.
Sample code
const headers = [{
key: HeaderKeyFactory.String('key'),
value: HeaderValue.Raw(Buffer.alloc(0))
}];
const result = await client.message.send({
streamId,
topicId,
partition: Partitioning.PartitionId(0),
messages: [{ id: 1n, payload: 'repro', headers }]
});
// Send succeeds with a confirmation at offset 0.
await client.message.poll({
streamId,
topicId,
consumer: Consumer.Single,
partitionId: 0,
pollingStrategy: PollingStrategy.First,
count: 1,
autocommit: false
});
// Fails to decode the stored message's headers.
Logs
valid: SEND CONFIRMED offset=0
valid: POLL SUCCEEDED
empty-value: SEND CONFIRMED offset=0
empty-value: POLL FAILED user headers of the message at offset 0 do not decode; cause=Invalid header value length: 0, must be between 1 and 255
Iggy server config
Fresh single-node server with development credentials.
IGGY_HTTP_ADDRESS=0.0.0.0:3000
IGGY_TCP_ADDRESS=0.0.0.0:38090
IGGY_NODE_ADVERTISED_ADDRESS=localhost
TCP port 38090 was published to localhost. No custom persistence settings.
Reproduction
- Start a fresh Iggy server and connect using the Node SDK.
- Create a stream and a topic with one partition.
- Send a message containing a string header key and an empty raw header value, as shown above.
- The send succeeds and confirms offset 0.
- Poll the topic from the first offset.
- Polling fails because the header value length is 0.
Also reproduced with:
- HeaderValue.String('a'.repeat(256))
- HeaderValue.Int128(Buffer.from([1]))
- HeaderKeyFactory.String('') with a nonempty value
A normal nonempty string key and value send and poll successfully.
Contribution
- I'm willing to submit a pull request to fix this bug
Good first issue
- I think this could be a good first issue for a new contributor
- Lingua principale
- Rust
- Stelle
- 5.2k
- Fork
- 502
- Merge medio
- 2g 21h
- PR unite (30g)
- 159
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/iggy
-
Go examples: add a message envelope producer and consumerForse già presa @ThunderGod77 l’ha presa 4 giorni fa. Apertago good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/iggy#4694 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
HTTP client treats a consumer group as a plain consumerForse già presa @mohitduhan19 l’ha presa 22 giorni fa. Apertabug rust server
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
apache/iggy#4408 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Add the fail-fast connection option to the Rust and Python quick-startsForse già presa @QIW9 l’ha presa 10 giorni fa. Apertadocs good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
apache/iggy#4261 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
ResourceNotFound from the binary protocol prints an empty keyForse già presa @xalestar l’ha presa 1 giorno fa. Apertaapi python rust
apache/iggy#4767 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Go SDK: validate personal access token name length before serializationForse già presa @p4rtridge l’ha presa 2 giorni fa. Apertabug go good first issue
apache/iggy#4749 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
bug order-flow studies ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
userFRM/egui-charts#2417 ·
I maintainer di solito rispondono entro 1 giorno
-
In a plain-text message, Font, Font Size, Font Color and Text Highlight Color stay liveForse già presa @ragelfundionctrumnar l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
UCS-Care-Group/mailcraft#862 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
smoltcp-rs/smoltcp#1243 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 4 giorni