Repository navigation
fall back to every topic when resolveTopicName throws for the scheduler's prefix probe - #342
Merged
Merged
Conversation
…er's prefix probe Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Summary
bus provisionno longer fails for an SQSasScheduler()bus whoseresolveTopicNamethrows for message names it doesn't know. Follow-up to #339.Background
A scheduler can publish any stored message, so its runtime policy grants
sns:Publishon<prefix>*.topicNamePrefix()finds the prefix by callingresolveTopicNamewith two made-up names (node-ts-bus-probe-a/-b) and falls back to*when the result isn't a fixed prefix plus the default name.Problem
A resolver that throws for unknown names (e.g. one backed by a lookup table) threw on the probe, so building the plan failed and
bus provisionerrored for that scheduler, even as a dry run (e.g.Unknown message node-ts-bus-probe-a).Approach
Catch errors from the probe and use the same unprefixed
*fallback, logging a warning (withserializeError, now a bus-sqs dependency like in bus-core and bus-rabbitmq) since the grant is broader than the user may expect.Unit test with a resolver that throws for unknown names: the plan grants
arn:…:*and the warning is logged once.Nothing else probes this way: RabbitMQ's scheduler grant is
write: '.*'with no resolver call.Noted in
docs/guide/provisioning.mdand the bus-sqsCLAUDE.md; patch changeset for@node-ts/bus-sqs.This is original work under the clean-room policy, not ported, translated or copied from another messaging framework
Added a changeset (
pnpm changeset) for user-facing changes to published packages, or none is neededDocs: updated
docs/for user-facing changes, or none needed🤖 Generated with Claude Code