Repository navigation
fix(slack): Require workspace membership for messages - #1936
Merged
Merged
Conversation
Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Remove redundant checks and repeated test cases. Keep unknown authors blocked. Co-Authored-By: David Cramer <[email protected]>
Validate ingress fields against Slack contracts and remove unchecked membership casts. Use upstream Block Kit types and raw event fixtures. Co-Authored-By: David Cramer <[email protected]>
dcramer
marked this pull request as ready for review
September 25, 2026 17:38
dcramer
approved these changes
Sep 25, 2026
Share assistant callback parsing, keep membership validation local, and remove unused type plumbing and repeated prose. Co-Authored-By: David Cramer <[email protected]>
Contributor
|
1 screenshot change — 1 changed · 0 added · 0 removed Review screenshots in Frameshift
|
dcramer
approved these changes
Sep 25, 2026
dcramer
added a commit
that referenced
this pull request
Sep 25, 2026
Follow up on #1936. Replace copied Slack types and payload casts with SDK types. Keep local validation only where the SDK types are incomplete. Reject malformed files, blocks, previews, and timestamps before Chat SDK parses them. Preserve nested message content. Validate slash-command IDs once and carry their types into the handler. Remove the synthetic SDK event, duplicate checks, and redundant component tests. <!-- junior-request-attribution:start --> via **David Cramer**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1790359713.639289 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1790359713.639289) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1790359713.639289/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>
dcramer
added a commit
that referenced
this pull request
Nov 12, 2026
…e no user (#3213) Some app integrations, such as HackerOne, post `bot_message` events that have a `bot_id` and no `user`. Since #1936, `isSlackWorkspaceMember` returns false for these events, so the webhook drops them before channel-message automations can match. Because of this, #2197's `match.user_id` cannot name these bots. A channel-message automation filtered on HackerOne's bot ID has had zero runs. This change adds a narrow path for these posts. Per review, it uses a workspace + bot check, not an allowlist. - **Channel scope:** `slackChannelScope` reads the signed envelope once. A `workspace` channel needs `is_ext_shared_channel: false`, `context_team_id` equal to `team_id`, and no `context_enterprise_id` ([callback fields](https://docs.slack.dev/apis/events-api#callback-field)). Any other envelope is `unknown` and drops the post. An Enterprise Grid install drops these posts too. - **Bot check:** `slackWorkspaceBotId` sits next to `isSlackWorkspaceMember` and uses the same cache TTLs: - If the event has `bot_profile`, its `id` must match `bot_id`, its `team_id` must be this workspace, and it must not be deleted. No lookup. - Otherwise, `bots.info` must return the bot, not deleted. If the bot has a `user_id`, `users.info` must return a bot user in this workspace that is not deleted. - A classic integration has no bot user, so it is accepted on the channel scope alone. Production spans suggest HackerOne (`B09LC7U21UG`) is this case. - **Automations only:** these posts never start a Turn. A post that mentions Junior runs nothing, the same as a mention from a person. - **Exact opt-in:** only automations that name the bot ID in `match.user_id` run. The Event gets a typed author (`{ kind: "bot", botId }`), so the summary no longer guesses the kind from the ID's format. Member posts and bot posts share one ingest helper. Link previews read the same channel scope and skip only `external`. Their behavior does not change. `slack.message.ingress` now records `app.slack.context_team_id` and `app.slack.context_enterprise_id`, so a dropped bot post can be traced to its envelope. #2034 is still open. This PR answers it only for channel-message automations and leaves Workflow mentions as they are. <!-- junior-request-attribution:start --> via @markatsentry, @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A3daf59e82cad7da4d1222db396136948 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A3daf59e82cad7da4d1222db396136948) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A3daf59e82cad7da4d1222db396136948/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Mark Collao <[email protected]> Co-authored-by: David Cramer <[email protected]>
This branch was successfully deployed
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
source_teamonly whenuser_teamis absent. No membership lookup fallback.@slack/typesfor event fields, fixtures, and Block Kit output. Validate untyped input instead of casting it.Validation
via David Cramer.
--
View Junior Session [Sentry]