Skip to content

fix(slack): paginate selector resources - #7362

Merged
waleedlatif1 merged 1 commit into
stagingfrom
investigate/slack-selector-pagination
Sep 1, 2026
Merged

fix(slack): paginate selector resources#7362
waleedlatif1 merged 1 commit into
stagingfrom
investigate/slack-selector-pagination

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the ten-request Slack selector drain with one provider page per selector request and mode-bound continuation cursors.
  • Pages scoped OAuth public channels and installing-user private memberships independently, while preserving fail-closed private-channel behavior.
  • Adds direct users.info and conversations.info hydration for saved values, with bounded conversations.members verification for scoped private channels.
  • Keeps bot-only public fallback distinct from OAuth behavior and rejects cursors when the selector or recomputed authentication mode does not match.

Security

  • Selector cursors contain only a version, authentication mode, and opaque Slack continuation values.
  • Scoped OAuth never emits private channels from conversations.list; private channels come only from users.conversations for the installing user.
  • Membership lookup failure retains public results but removes private results and continuation.
  • Scoped private detail hydration fails closed on lookup failure, exhaustion, repeated cursors, or the 10,000-member bound.
  • Abort errors continue to propagate and provider errors remain generic.

Tests

  • Focused Slack provider, selector manifest, and generic selector-query suites: 26 tests passed.
  • apps/sim type check passed.
  • Targeted Biome check passed.
  • Strict API validation, fork-dependent coverage, client-boundary validation, and git diff check passed.

Live validation

Not run: no suitably large authenticated Slack workspace was available. The follow-up manual checklist is continuation beyond ten cursors, authorized versus bot-only private visibility, separate OAuth and bot fallback behavior, saved label hydration in editor and connector surfaces, and cancellation or credential changes during loading.

@vercel

vercel Bot commented Sep 1, 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 Sep 1, 2026 6:46pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR converts Slack channel and user selectors to cursor-based pagination and adds direct detail hydration for saved values. It also separates public and installing-user private-channel streams, binds cursors to authentication modes, and applies bounded fail-closed membership verification.

  • Enables paginated list and detail capabilities for both Slack selectors.
  • Encodes and validates mode-specific Slack continuation cursors.
  • Adds direct users.info and conversations.info hydration.
  • Adds focused coverage for pagination, cancellation, fallback behavior, cursor isolation, and private-channel verification.

Confidence Score: 5/5

The PR appears safe to merge because no concrete blocking or independently actionable non-blocking issue was identified.

The manifest capabilities align with the new provider responses, pagination cursors are validated against the recomputed authentication mode, and private-channel listing and hydration retain the documented fail-closed boundaries.

Important Files Changed

Filename Overview
apps/sim/lib/selectors/server/providers/slack.ts Replaces bounded eager draining with mode-bound pagination, dual-stream scoped channel listing, direct detail hydration, and fail-closed private membership checks; no actionable defect was established.
apps/sim/lib/selectors/server/providers/slack.test.ts Adds focused tests for continuation, cancellation, authentication-mode isolation, fallback behavior, detail hydration, and private-channel failure handling.
apps/sim/lib/selectors/manifest.ts Advertises pagination and detail support for Slack channel and user selectors, matching the updated provider result contract.

Sequence Diagram

sequenceDiagram
  participant C as Selector client
  participant P as Slack selector provider
  participant L as Slack API
  C->>P: List channels
  P->>L: conversations.list (public stream)
  L-->>P: Public page + cursor
  P->>L: users.conversations (private membership stream)
  L-->>P: Private page + cursor
  P-->>C: Deduplicated options + mode-bound composite cursor
  C->>P: Continue with composite cursor
  P->>L: Continue each unfinished stream
  L-->>P: Next pages
  P-->>C: Options + remaining continuation
  C->>P: Hydrate saved private channel ID
  P->>L: conversations.info
  P->>L: conversations.members (bounded verification)
  P-->>C: Detail option or null
Loading

Reviews (1): Last reviewed commit: "fix(slack): paginate selector resources" | Re-trigger 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.

All reported issues were addressed across 3 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Fix all with cubic | Re-trigger cubic

Comment thread apps/sim/lib/selectors/manifest.ts
@waleedlatif1
waleedlatif1 merged commit c43e842 into staging Sep 1, 2026
27 checks passed
@waleedlatif1
waleedlatif1 deleted the investigate/slack-selector-pagination branch September 1, 2026 23:09
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