Skip to content

Resolve handler strings passed to subscribe in the SST plugin - #2436

Merged
webpro merged 4 commits into
webpro-nl:mainfrom
everton-dgn:fix/sst-subscribe-string-handler
Nov 22, 2026
Merged

webpro merged 4 commits into
webpro-nl:mainfrom
everton-dgn:fix/sst-subscribe-string-handler

Conversation

@everton-dgn

@everton-dgn everton-dgn commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Queues and topics in SST v3 take a handler string in subscribe(), as in the aws-topic example, and the plugin didn't read it, so subscriber.ts was reported as unused. The handler is the second argument when that one is a string or has a handler, as in SST's isFunctionSubscriber, and the first one when the second is missing or an args object. Subscription names and ARNs aren't taken as files.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/knip@2436
npm i https://pkg.pr.new/@knip/language-server@2436
npm i https://pkg.pr.new/@knip/mcp@2436

commit: 63f1c49

@everton-dgn
everton-dgn marked this pull request as ready for review November 21, 2026 14:16

@webpro webpro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Éverton! Choosing the subscriber the way SST's isFunctionSubscriber does covers both subscribe signatures, and on SST's own examples the subscriber files of queues, topics, buses, Dynamo and Kinesis streams and Realtime are no longer reported.

@webpro
webpro merged commit 294bfa5 into webpro-nl:main Nov 22, 2026
33 checks passed
@webpro

webpro commented Nov 22, 2026

Copy link
Copy Markdown
Member

🚀 This pull request is included in v6.48.0. See Release 6.48.0 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants