Skip to content

fix(integrations): gdrive trashed search, slack blocks-with-file, slack get_message ts#4600

Merged
waleedlatif1 merged 3 commits into
stagingfrom
waleedlatif1/arga-bug-audit
May 14, 2026
Merged

fix(integrations): gdrive trashed search, slack blocks-with-file, slack get_message ts#4600
waleedlatif1 merged 3 commits into
stagingfrom
waleedlatif1/arga-bug-audit

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Google Drive search/list: stop hardcoding trashed = false. Now skipped when the user query already specifies a trashed = ... predicate, so searching for trashed files actually works. Drive's files.list has no implicit trash filter — the caller owns q.
  • Slack send-message with files: forward blocks through completeSlackFileUpload to files.completeUploadExternal so Block Kit renders when a file is attached. Slack accepts blocks on that endpoint; we just weren't passing it.
  • Slack get_message: switch from conversations.history (oldest is a lower-bound, returned the next message after when input ts didn't exactly match) to conversations.replies with ts= for deterministic single-message lookup. Added a defensive ts-equality guard and a clearer "Message not found at timestamp X" error.

Type of Change

  • Bug fix

Testing

Tested manually against the API behavior described in each bug report. bun run check:api-validation passes. No happy-path behavior changes — only the bug-triggering inputs change behavior.

Checklist

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

…ck get_message ts

- Google Drive search/list: skip default `trashed = false` when user query
  already specifies a `trashed = ...` predicate, so trashed-file searches work.
- Slack send-message with files: forward `blocks` through to
  `files.completeUploadExternal` so Block Kit renders when files are attached.
- Slack get_message: switch from `conversations.history` (oldest lower-bound
  returned the next message after) to `conversations.replies` with `ts=`
  for exact-match lookup, plus a defensive ts-equality guard and clearer error.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 14, 2026 6:24pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 14, 2026

PR Summary

Medium Risk
Changes behavior of Google Drive query construction and Slack message/file-posting endpoints; mistakes could alter which files/messages are returned or how Slack content renders, but scope is limited to integration tools.

Overview
Fixes Google Drive tool query construction so advanced search no longer forces trashed = false when the caller explicitly includes a trashed = ... predicate, while list clarifies/enforces that its plain-text name filter always excludes trashed items.

Improves Slack integrations by forwarding blocks through files.completeUploadExternal (and omitting initial_comment when blocks are present so Block Kit renders with file uploads), and updates slack_get_message to use conversations.replies with ts= plus stricter timestamp validation and clearer “message not found at timestamp …” errors.

Reviewed by Cursor Bugbot for commit db18b88. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 14, 2026

Greptile Summary

This PR fixes three independent integration bugs across Google Drive search, Slack file-upload messages, and Slack message retrieval.

  • Google Drive search.ts: Stops hardcoding trashed = false when the caller's query already contains a trashed = predicate (detected via /\btrashed\s*=/), so searching for trashed files now works. list.ts gets only a comment clarification and an explicit type annotation — no functional change.
  • Slack utils.ts: Threads blocks through to completeSlackFileUpload and, because Slack silently ignores blocks when initial_comment is also present, omits initial_comment and sends only blocks when blocks are provided.
  • Slack get_message.ts: Replaces conversations.history (which used oldest as a lower-bound and could return the wrong message) with conversations.replies using an exact ts= lookup, adds a defensive ts-equality guard, and improves error messages for message_not_found / thread_not_found.

Confidence Score: 5/5

All four changes are narrow, targeted bug fixes with no side-effects on happy-path inputs.

Each fix is tightly scoped: the trashed-guard regex only fires when the user explicitly writes a trashed = predicate; the blocks/initial_comment branch follows documented Slack API behaviour; the conversations.replies switch is guarded by a ts-equality check that throws an informative error on any mismatch. No new code paths are introduced for normal inputs, and the defensive guards only activate on previously-broken inputs.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/tools/google_drive/search.ts Added userSpecifiesTrashed guard to skip injecting trashed = false when the caller's query already includes a trashed predicate, enabling searches for trashed files.
apps/sim/tools/google_drive/list.ts Added explicit string[] type annotation to conditions array and clarifying comment; no functional change — previous fix already reverted the incorrect trashed-guard from list.ts.
apps/sim/app/api/tools/slack/utils.ts Threads blocks through to completeSlackFileUpload and, per Slack docs, omits initial_comment when blocks are present so Block Kit renders correctly on file-upload messages.
apps/sim/tools/slack/get_message.ts Switched from conversations.history (oldest-bound, non-deterministic) to conversations.replies (ts-exact lookup) and added a ts-equality guard plus improved error messages for clearer diagnostics.

Reviews (3): Last reviewed commit: "fix(slack): omit initial_comment when bl..." | Re-trigger Greptile

Comment thread apps/sim/tools/google_drive/list.ts Outdated
Comment thread apps/sim/tools/google_drive/list.ts Outdated
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/tools/slack/utils.ts Outdated
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit db18b88. Configure here.

@waleedlatif1 waleedlatif1 merged commit 044e034 into staging May 14, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/arga-bug-audit branch May 14, 2026 18:33
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