Skip to content

fix(queue): accept Update Message without a body (visibility-only update) - #621

Merged
hectorvent merged 2 commits into
floci-io:mainfrom
clohl:fix/queue-update-message-optional-body
Nov 11, 2026
Merged

hectorvent merged 2 commits into
floci-io:mainfrom
clohl:fix/queue-update-message-optional-body

Conversation

@clohl

@clohl clohl commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Queue Update Message now accepts an empty body: a visibility-only update. It keeps the message text, rotates the pop receipt and applies the new visibility timeout, as Azure does. Before this, the handler always parsed the XML body, so an empty one threw and floci-az answered 500.

Closes #620

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

Azure Compatibility

Incorrect behavior: PUT …/messages/{id}?popreceipt=…&visibilitytimeout=… with no body returned 500 with an empty body.

Azure behavior: the message content has been optional since x-ms-version 2011-08-18. The update returns 204 with a new x-ms-popreceipt and x-ms-time-next-visible, and the text is unchanged.

Seen with: Node @azure/storage-queue 12.32.0 updateMessage(id, popReceipt, undefined, timeout) and Python azure-storage-queue 12.13.0 update_message(..., visibility_timeout=...). Both are the lease-extension calls of queue workers.

New test QueueServiceTest#updateMessageWithoutBodyKeepsTextAndMovesVisibility:

  • an update with no body extends visibility, so the message is hidden from peek;
  • a second update with no body and visibilitytimeout=0 makes it visible again with the original text;
  • the superseded pop receipt is refused, and the current one deletes the message.

The test fails without the fix (500 instead of 204).

Checklist

  • ./mvnw test passes locally. I ran mvn test -Dtest=QueueServiceTest (30 passed, 0 failures) with Maven 3.9.16 on eclipse-temurin-25. The wrapper's Maven 3.10.0 download failed its distributionSha256Sum check in my environment, so I didn't run the full suite locally; I'm relying on CI for it.
  • New or updated integration test added
  • Commit messages follow Conventional Commits
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🎉 Thanks for your first pull request to floci-az!

Your CI checks need a maintainer to approve them before they run. That is GitHub's standard gate on first-time contributors, not a problem with your PR, so if the checks look like they are doing nothing, that is why. Once a maintainer approves, CI and the compatibility suite start automatically. Nothing is needed from you in the meantime.

While you wait, a couple of things that make review faster:

  • Link the issue this fixes with Closes #N in the description
  • Commits follow Conventional Commits (feat(blob): ..., fix(keyvault): ...)
  • Behaviour changes come with a test, see CONTRIBUTING.md

Come join us in Slack. It is the fastest way to reach maintainers if you get stuck, or want feedback on an approach before investing more time in it.

@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain.

Summary

Queue updates without a body now preserve the message text, move its visibility deadline, and return a new pop receipt.

  • Queue message updates keep the text when workers omit the body.

Reviews (3) · Last reviewed commit: "fix(queue): peek for an empty Update Mes..." · Reviewed by Greptile

clohl added a commit to clohl/floci-az that referenced this pull request Nov 2, 2026
…g it

Review follow-up (floci-io#621):
- The handler now peeks for the first non-whitespace byte (PushbackInputStream)
  and streams a present body to the XML parser. It no longer reads the whole
  request into memory first.
- The test asserts x-ms-time-next-visible is about 60 s out, beyond the
  dequeue's 30 s. That proves the body-less update extends the visibility
  timeout, not just that the header is present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hectorvent hectorvent added bug Something isn't working queue Azure Queue Storage labels Nov 2, 2026
@hectorvent

Copy link
Copy Markdown
Member

Thanks for the clear report in #620 and for the fix. I checked it against the spec: the message body is optional on Update Message (spec), and Azurite also keeps the stored text when none is sent (Azurite), so this matches. The test now proves the visibility really moves, too.

  1. (blocking) Commits 3b162dd and 8aeb476 carry an AI co-author trailer; this repo keeps commit attribution with human contributors (see AGENTS.md). Would you amend or squash those commits and force push so the attribution is yours alone?

CI needs my approval on a first PR, so I'll start it once that push lands. That trailer is the only thing I'd change.

@hectorvent hectorvent added waiting-author Review posted; waiting on the PR author to respond waiting-maintainer Contributor has replied; waiting on a maintainer response and removed waiting-author Review posted; waiting on the PR author to respond waiting-maintainer Contributor has replied; waiting on a maintainer response labels Nov 3, 2026
@hectorvent

Copy link
Copy Markdown
Member

A small correction to my note above: I said the trailer was the only thing I'd change, but now that CI has run, PR Hygiene also reports both commits as unsigned.

  1. (blocking) Would you sign the commits when you rewrite them to drop the trailer, then force push? This repo requires signed, verified commits.

The rest of CI passed on this head, including QueueServiceTest, and the code still looks right to me. No other blockers from my side.

@deyanp

deyanp commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

@clohl could you fix the issues with your PR, so that it can be merged? I am also affected by this bug, and I am interested in having this fixed in the version ;)

@clohl

clohl commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@clohl could you fix the issues with your PR, so that it can be merged? I am also affected by this bug, and I am interested in having this fixed in the version ;)

Yeah sorry, on it now.

clohl added 2 commits November 9, 2026 22:34
…ate)

Azure has accepted Update Message without a body since x-ms-version
2011-08-18. The update keeps the message text and only moves the
visibility timeout. SDK clients use it to extend a lease
(updateMessage(id, popReceipt, undefined, timeout) in Node,
update_message(..., visibility_timeout=...) in Python).

The handler always parsed the body, so an empty one threw and was
answered with 500. An empty or blank body now keeps the stored text,
still rotates the pop receipt and applies the visibility timeout.

Closes floci-io#620
…g it

Review follow-up (floci-io#621):
- The handler now peeks for the first non-whitespace byte (PushbackInputStream)
  and streams a present body to the XML parser. It no longer reads the whole
  request into memory first.
- The test asserts x-ms-time-next-visible is about 60 s out, beyond the
  dequeue's 30 s. That proves the body-less update extends the visibility
  timeout, not just that the header is present.
@clohl
clohl force-pushed the fix/queue-update-message-optional-body branch from 8aeb476 to a2c6204 Compare November 10, 2026 05:35
@clohl

clohl commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

A small correction to my note above: I said the trailer was the only thing I'd change, but now that CI has run, PR Hygiene also reports both commits as unsigned.

  1. (blocking) Would you sign the commits when you rewrite them to drop the trailer, then force push? This repo requires signed, verified commits.

The rest of CI passed on this head, including QueueServiceTest, and the code still looks right to me. No other blockers from my side.

Just rebased with the amended commit messages -- git log --format=%B c4f6ab6..HEAD | grep -iE 'claude|anthropic' now returns "". Pushed the GPG signed rebase && sorry I missed this previously.

@clohl

clohl commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the clear report in #620 and for the fix. I checked it against the spec: the message body is optional on Update Message (spec), and Azurite also keeps the stored text when none is sent (Azurite), so this matches. The test now proves the visibility really moves, too.

  1. (blocking) Commits 3b162dd and 8aeb476 carry an AI co-author trailer; this repo keeps commit attribution with human contributors (see AGENTS.md). Would you amend or squash those commits and force push so the attribution is yours alone?

CI needs my approval on a first PR, so I'll start it once that push lands. That trailer is the only thing I'd change.

@hectorvent please re-review and release my PR to CI when you get a chance. I appreciate and thank you!

@hectorvent

Copy link
Copy Markdown
Member

Thanks for rewriting those, clohl. Both commits are now signed and attributed to you alone, and the code is the same as what I reviewed before. CI passed on this head, including QueueServiceTest.

No blockers from my side.

@hectorvent hectorvent removed the waiting-author Review posted; waiting on the PR author to respond label Nov 11, 2026
@hectorvent
hectorvent merged commit c3215c8 into floci-io:main Nov 11, 2026
15 checks passed
@clohl
clohl deleted the fix/queue-update-message-optional-body branch November 12, 2026 16:03
@hectorvent

Copy link
Copy Markdown
Member

🎉 This PR is included in version 0.17.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

McFizh pushed a commit to McFizh/floci-az that referenced this pull request Nov 16, 2026
# [0.17.0](floci-io/floci-az@0.16.0...0.17.0) (2026-11-15)

### Bug Fixes

* **aci:** report a failed container group action on the POST ([floci-io#623](floci-io#623)) ([b9ab61c](floci-io@b9ab61c))
* **apim:** keep child resources in the storage layer, keyed case-insensitively ([floci-io#651](floci-io#651)) ([d70496f](floci-io@d70496f))
* **blob:** answer Append Block with Last-Modified and x-ms-request-server-encrypted ([floci-io#631](floci-io#631)) ([f440fce](floci-io@f440fce)), closes [floci-io#587](floci-io#587)
* **blob:** apply SAS response-header overrides on read ([floci-io#629](floci-io#629)) ([04ec99e](floci-io@04ec99e))
* **containerapps:** drop an empty keyVaultUrl from a plain secret ([floci-io#649](floci-io#649)) ([68a9e13](floci-io@68a9e13)), closes [floci-io#576](floci-io#576)
* **containerapps:** report a managed environment's customDomainVerificationId ([floci-io#630](floci-io#630)) ([6b2b76f](floci-io@6b2b76f)), closes [floci-io#573](floci-io#573)
* **deployments:** list a nested deployment's resources in its parent ([floci-io#636](floci-io#636)) ([87c08bd](floci-io@87c08bd))
* **deployments:** read a parameter with a null reference as a plain value ([floci-io#635](floci-io#635)) ([e29d909](floci-io@e29d909))
* **eventgrid:** refuse a destination type floci-az cannot deliver to ([floci-io#622](floci-io#622)) ([aec34bd](floci-io@aec34bd))
* **eventhub:** skip discarded journal disk tuning ([floci-io#614](floci-io#614)) ([284f3fc](floci-io@284f3fc)), closes [floci-io#606](floci-io#606)
* **keyvault:** serve deleted vaults so terraform destroy can purge ([floci-io#634](floci-io#634)) ([f90d590](floci-io@f90d590)), closes [floci-io#624](floci-io#624)
* **keyvault:** store a vault's properties and support PATCH ([floci-io#624](floci-io#624)) ([9b8b44f](floci-io@9b8b44f))
* **monitor:** answer the deleted workspaces list ([floci-io#625](floci-io#625)) ([b60d698](floci-io@b60d698))
* **monitor:** keep the tags of workspaces and data collection endpoints and rules ([floci-io#660](floci-io#660)) ([df23147](floci-io@df23147)), closes [floci-io#659](floci-io#659)
* **queue:** accept Update Message without a body (visibility-only update) ([floci-io#621](floci-io#621)) ([c3215c8](floci-io@c3215c8)), closes [floci-io#620](floci-io#620)
* **queue:** return messages in the order they were sent ([floci-io#647](floci-io#647)) ([37b0f46](floci-io@37b0f46))
* **servicebus,eventhub:** wait for Artemis to answer AMQP before reporting a namespace ready ([floci-io#615](floci-io#615)) ([6fa9511](floci-io@6fa9511))
* **servicebus:** balance source accounting after explicit dead-letter ([floci-io#648](floci-io#648)) ([16f5f74](floci-io@16f5f74))
* **servicebus:** bound TCP connect by the readiness deadline ([floci-io#604](floci-io#604)) ([b06f481](floci-io@b06f481)), closes [floci-io#603](floci-io#603)
* **servicebus:** count deliveries after session lock expiry ([floci-io#645](floci-io#645)) ([ff31e3d](floci-io@ff31e3d))
* **servicebus:** restore stored entities when a broker starts ([floci-io#643](floci-io#643)) ([0d8dbab](floci-io@0d8dbab)), closes [floci-io#642](floci-io#642)
* **servicebus:** skip discarded journal disk tuning ([floci-io#606](floci-io#606)) ([db31031](floci-io@db31031)), closes [floci-io#605](floci-io#605)
* **storage:** answer an ARM container GET with the container's stored ETag and Last-Modified ([floci-io#617](floci-io#617)) ([f58abb4](floci-io@f58abb4))
* **storage:** answer an ARM container PUT with the container's stored ETag and Last-Modified ([floci-io#602](floci-io#602)) ([c5bbac8](floci-io@c5bbac8))
* **storage:** return the sku, kind and properties a PUT set ([floci-io#646](floci-io#646)) ([afc79e6](floci-io@afc79e6)), closes [floci-io#571](floci-io#571)
* **vm:** preserve request origin in polling URLs ([floci-io#628](floci-io#628)) ([9560864](floci-io@9560864)), closes [floci-io#626](floci-io#626)
* **vm:** report each power action's real outcome on its operation status ([floci-io#655](floci-io#655)) ([183f63d](floci-io@183f63d)), closes [floci-io#626](floci-io#626) [floci-io#626](floci-io#626)

### Features

* **arm:** refuse a token from another tenant under strict-tokens ([floci-io#619](floci-io#619)) ([fb76ca4](floci-io@fb76ca4))
* **arm:** refuse invalid Bearer tokens under strict-tokens ([floci-io#616](floci-io#616)) ([d6af59c](floci-io@d6af59c))
* **arm:** report each public region's physicalLocation ([floci-io#653](floci-io#653)) ([874b552](floci-io@874b552))
* **authorization:** serve role definitions and store role assignments ([floci-io#656](floci-io#656)) ([003a53c](floci-io@003a53c)), closes [floci-io#567](floci-io#567)
* **blob:** serve Set Blob Properties ([floci-io#654](floci-io#654)) ([d09366d](floci-io@d09366d))
* **deployments:** resolve Key Vault parameter references ([floci-io#641](floci-io#641)) ([3bcb475](floci-io@3bcb475)), closes [floci-io#635](floci-io#635) [floci-io#635](floci-io#635)
* **deployments:** serve deployments at management-group scope ([floci-io#640](floci-io#640)) ([0fe757d](floci-io@0fe757d))
* **deployments:** serve symbolic resource names (languageVersion 2.0) ([floci-io#637](floci-io#637)) ([17f00a3](floci-io@17f00a3))
* **deployments:** serve the CIDR functions and deployer ([floci-io#639](floci-io#639)) ([7fd4ade](floci-io@7fd4ade))
* **deployments:** serve the lambda functions and flatten ([floci-io#638](floci-io#638)) ([cddc4e0](floci-io@cddc4e0))
* **entra:** validate directory passwords and issue ROPC refresh tokens ([floci-io#633](floci-io#633)) ([9b2a464](floci-io@9b2a464)), closes [floci-io#632](floci-io#632)
* **tls:** answer for Azure's public hosts behind an opt-in setting ([floci-io#650](floci-io#650)) ([457de34](floci-io@457de34))
* **tls:** keep a trusted CA, accept your own, and warn when a client rejects the certificate ([floci-io#662](floci-io#662)) ([bac63e9](floci-io@bac63e9))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working queue Azure Queue Storage released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Queue Update Message without a body (visibility-only update) returns 500

3 participants