fix(serverless-offline-sqs): resolve a .fifo event name against a bare ElasticMQ queue id (Fixes #189)#292
Merged
Merged
Conversation
…e ElasticMQ queue id (Fixes #189) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5e05255 to
2e753c6
Compare
This was referenced Jun 21, 2026
Closed
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.
Fixes #189
What / why
When an
sqsevent'sarnresolves to a.fifo-suffixed queue name (e.g.arn:aws:sqs:<region>:root:QueueName.fifo) but the local ElasticMQ instance is configured with the bare idQueueName(ElasticMQ does not append.fifofor a FIFO queue),GetQueueUrl({QueueName: 'QueueName.fifo'})was rejected withQueueDoesNotExistand the listener hung — the lambda never fired. (extractQueueNameFromARNcorrectly preserves the suffix, which is AWS-correct; the pre-existing_getQueueUrlwas dead code that only retried the same name.)Because the emulator's naming contract is ambiguous (no single correct name), the plugin now probes both forms via a pure, exported
queueNameCandidateshelper: the name exactly as given first, then the toggled.fifovariant. AQueueDoesNotExiston one candidate falls through to the next; only when every candidate is genuinely missing does it keep the historical wait-for-availability delay-and-retry (so a not-yet-created queue is still awaited). #265'squeueNameoverride remains a valid workaround; this auto-resolves the root mismatch.Credit
Thanks to @nicolaspfernandes for the detailed repro (config +
elastic.conf).Verification
Failing AVA repro written first (helper
not a function+ the cross-name_getQueueUrlcases hung the old same-name loop) and confirmed to FAIL onorigin/master. After the fix:npx ava packages/serverless-offline-sqs/test/index.js→ 124 passed (7 new #189 tests),npx eslintclean. Independently re-run by the orchestrator: green. Fully unit-verified by mocking the client — the only ElasticMQ-dependent behavior is theQueueDoesNotExist-vs-success branch — so no docker is needed.Reviewer caveat (non-blocking)
A queue genuinely absent in both name forms (or a nil queue name from an unresolvable intrinsic) now enters the silent 10s wait-loop rather than surfacing master's immediate rejection. Matches the prior dead-code loop and the intended wait-for-availability behavior; a warning or bounded retry on candidate exhaustion would restore that visibility — possible follow-up.
🤖 Generated with Claude Code