[Service Bus] SDK binding rejects messages without x-opt-lock-token annotation despite host-provided lock-token prefix

Chiusa Adatta ai principianti
#180 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@amandeep25100-a11y ci sta già lavorando.

Dal 10/11/2026.

  • #182 di @swapnil-nagar — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
azure, node.js, typescript
Ambito
api, backend

Direzione di ricerca

Leggi azure-functions-nodejs-extensions-servicebus/src/util/serviceBusMessageDecoder.ts, in particolare i controlli del decoder sul token di blocco e l’analisi del prefisso. Confronta il suo comportamento con il contenuto di binding segnalato: un prefisso GUID di 16 byte seguito da byte AMQP grezzi. Aggiungi test di regressione per i messaggi senza annotazioni e per un ordinamento dei byte GUID diverso da zero, quindi conferma che la conversione restituisce il token dal prefisso.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

@azure/functions-extensions-servicebus version 0.5.1 fails to convert incoming messages when their AMQP representation lacks x-opt-lock-token, even when binding content includes the 16-byte lock-token prefix supplied by the Functions host.

The affected topic receives REST-published messages. Every observed invocation fails before entering the handler. We have not captured the failing host payload, so the relationship to REST publishing remains an observation rather than a confirmed cause.

Environment

  • @azure/functions-extensions-servicebus: 0.5.1
  • @azure/functions: 4.17.0
  • Azure Functions on Windows
  • Host version shown in worker path: 4.1055.300
  • Extension bundle: Microsoft.Azure.Functions.ExtensionBundle, range [4.0.0, 5.0.0)
  • Trigger: sdkBinding: true, cardinality: 'one'
  • autoCompleteMessages: false in host configuration and trigger registration

Actual Behavior

Invocation fails during argument conversion, before the handler runs:

Unable to create client. Please register the extensions library with your function app.
Error: Lock token not found in content

at fromRpcTypedData.ts:40:19
at InvocationModel.ts:85:29
at InvocationModel.getArguments

Disabling autocompletion and using manual settlement did not resolve the error.

Reproduction

Construct binding content with a 16-byte GUID prefix followed by an AMQP message without x-opt-lock-token. The extension factory throws Lock token not found in content.

Adding message_annotations: { 'x-opt-lock-token': Buffer.alloc(16) } makes conversion succeed, with the returned token correctly read from the prefix.

We reproduced identical results using the native CommonJS SDK entry point and a minified esbuild bundle.

Expected Behavior and Suspected Cause

The host's ConvertReceivedMessageToBindingData serializes 16 GUID bytes followed by raw AMQP bytes.

However, ServiceBusMessageDecoder.decode first searches for x-opt-lock-token and throws if absent, although it subsequently reads the token from the prefix.

Could the decoder validate and read the prefix directly without requiring the annotation? Regression coverage should include annotation-free messages and nonzero GUID byte ordering.

Impact

All observed invocations of the affected function fail before business processing or settlement can run.

Lingua principale
TypeScript
Stelle
2
Fork
8
Merge medio
4g 23h
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/azure-functions-nodejs-extensions

Tutte le issue di Azure/azure-functions-nodejs-extensions

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.