Fix response correctness: empty dequeue returns 204, peek() returns value (qu-g2j)#10
Merged
Conversation
…alue not index (qu-g2j) Two bugs fixed: 1. peek() was returning array indices as strings (e.g., '0') instead of values 2. Dequeue from empty queue returned HTTP 200 with 'undefined' string instead of HTTP 204 Changes: - queue.ts: Fixed peek() to return this.messages[0] instead of for...in loop - handler.ts: Return HTTP 204 when dequeue gets undefined; added /peek endpoint - manager.ts: Added peek() method to support the new /peek endpoint - tests/test.ts: Added TDD tests for both bugs (RED tests that now pass) Manual E2E verification confirmed: - peek() returns actual message values, not indices - Empty dequeue returns HTTP 204 No Content Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
jonbaldie
force-pushed
the
polecat/thunder-mofs8eao
branch
from
April 26, 2026 20:29
c63df07 to
7f5b3c2
Compare
jonbaldie
added a commit
that referenced
this pull request
Apr 26, 2026
…alue (qu-g2j) (#10) * fix: response correctness - empty dequeue returns 204, peek returns value not index (qu-g2j) Two bugs fixed: 1. peek() was returning array indices as strings (e.g., '0') instead of values 2. Dequeue from empty queue returned HTTP 200 with 'undefined' string instead of HTTP 204 Changes: - queue.ts: Fixed peek() to return this.messages[0] instead of for...in loop - handler.ts: Return HTTP 204 when dequeue gets undefined; added /peek endpoint - manager.ts: Added peek() method to support the new /peek endpoint - tests/test.ts: Added TDD tests for both bugs (RED tests that now pass) Manual E2E verification confirmed: - peek() returns actual message values, not indices - Empty dequeue returns HTTP 204 No Content Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * Fix tests to match new API behavior (204 status on empty dequeue, peek returns value) --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated PR from refinery for qu-g2j. Replaces response indices with values and fixes empty dequeue status code.