Skip to content

fall back to every topic when resolveTopicName throws for the scheduler's prefix probe - #342

Merged
adenhertog merged 1 commit into
masterfrom
fix-scheduler-topic-prefix-probe
Oct 6, 2026
Merged

adenhertog merged 1 commit into
masterfrom
fix-scheduler-topic-prefix-probe

Conversation

@adenhertog

Copy link
Copy Markdown
Contributor

Summary

bus provision no longer fails for an SQS asScheduler() bus whose resolveTopicName throws 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:Publish on <prefix>*. topicNamePrefix() finds the prefix by calling resolveTopicName with 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 provision errored 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 (with serializeError, 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.md and the bus-sqs CLAUDE.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 needed

  • Docs: updated docs/ for user-facing changes, or none needed

🤖 Generated with Claude Code

…er's prefix probe

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@adenhertog adenhertog added the no-issue PR not tied to a roadmap issue label Oct 6, 2026
@adenhertog
adenhertog merged commit 579d9e1 into master Oct 6, 2026
5 checks passed
@adenhertog
adenhertog deleted the fix-scheduler-topic-prefix-probe branch October 6, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-issue PR not tied to a roadmap issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant