Skip to content

fix(slack): refuse binding a Search bot to a different app or workspace than members - #9109

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/slack-search-bot-member-app
Oct 16, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/slack-search-bot-member-app

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Binding Sim Search to an existing bot credential (configureSlackSearchInstallation) created a new installation without checking the organization's member Slack app, so a bot left over from an earlier install could be bound to a different app or workspace than the members' accounts — a state the install flow already refuses, and one that leaves member setup stuck
  • The new-installation path now runs the same check as setup, inside its transaction under the organization Slack app lock; enabling, disabling and re-validating an existing installation are unchanged (an update is already pinned to its app and workspace)
  • The member-app resolution and the bot-vs-members rule move from setup.ts into organization-slack-app.ts, so both paths share one implementation and one message
  • requireSlackSearchAppAvailable takes the caller's transaction: enabling a custom bot and completing member setup looked up the Slack app kind on a second pooled connection while holding the transaction's, which can deadlock the pool at saturation (the new integration test is the first to reach that path)

Type of Change

  • Bug fix

Testing

  • Integration (slack-shared-member-accounts.integration.ts, real Postgres): members on the shared app, then binding a leftover custom bot in another workspace is refused with no installation written (inserts one on the current code); binding a leftover shared-app bot in the members' workspace still succeeds
  • setup.test.ts updated for the moved helper; it still exercises the real rule
  • Ran biome on changed files; lint, check:audits, type-check, unit and integration suites run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 16, 2026 4:58am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

New Slack Search bindings now check the bot against the organization's member app and workspace before saving.

  • Saved Slack bots must match the members’ app and workspace.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Verify bot with Slack] --> B[Begin transaction and lock organization]
  B --> C{Installation exists?}
  C -->|Yes| D[Keep existing update behavior]
  C -->|No| E[Read member app and workspace]
  E --> F{Bot matches member settings?}
  F -->|No| G[Reject without saving]
  F -->|Yes| H[Create installation]
Loading

Reviews (1) · Last reviewed commit: "fix(slack): refuse binding a Search bot ..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 5 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 62f609b into staging Oct 16, 2026
51 of 52 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/slack-search-bot-member-app branch October 16, 2026 07:53

This branch was previously deployed

1 inactive deployment
Preview — 5d5f4a0e Deployed Oct 16, 2026 by vercel[bot]
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.

1 participant