Skip to content

Commit 263b3eb

Browse files
authored
fix(search): say a Slack file hit can return its full text rather than promising it (#10123)
1 parent cf81937 commit 263b3eb

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎apps/sim/lib/sim-search/live/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Each event must exist under the source's delegated token, be in an allowed calen
5858

5959
### Slack
6060

61-
Member mode only. Search uses the connected user's Slack real-time search grant and provider search syntax. Date bounds are sent as numeric provider timestamps; date ordering selects keyword retrieval and timestamp sort, because Slack semantic retrieval uses relevance ordering. Channels, messages, direct messages, and files are limited by that grant and provider scopes; there is no admin channel filter in member mode. Missing required search scopes produce a reconnect status. Thread/file reads use the same connected identity. Real-time Search returns only a file's title for a file hit, so the hit names the file's type and size and whether a read returns its text. A file read downloads the full text of a canvas (HTML), text snippet, PDF or DOCX from `files.slack.com` only, using `url_private_download` when present (Slack redirects a PDF's `url_private` to a viewer on another domain), never a remote file's own URL (redirects are followed only within that host; a hop elsewhere, such as a sign-in page, keeps the preview), within the shared response-size limit; when Slack will not serve it, the read returns the `files.info` preview. Real-time Search returns at most 20 results a call and counts every page against the member's rate limit, so a search across every source reads one page; a Slack-scoped or native Slack search follows the cursor for up to three pages to fill its limit, and a later page that fails keeps the earlier pages and returns the unread cursor.
61+
Member mode only. Search uses the connected user's Slack real-time search grant and provider search syntax. Date bounds are sent as numeric provider timestamps; date ordering selects keyword retrieval and timestamp sort, because Slack semantic retrieval uses relevance ordering. Channels, messages, direct messages, and files are limited by that grant and provider scopes; there is no admin channel filter in member mode. Missing required search scopes produce a reconnect status. Thread/file reads use the same connected identity. Real-time Search returns only a file's title for a file hit, so the hit names the file's type and size and whether a read can return its text. A file read downloads the full text of a canvas (HTML), text snippet, PDF or DOCX from `files.slack.com` only, using `url_private_download` when present (Slack redirects a PDF's `url_private` to a viewer on another domain), never a remote file's own URL (redirects are followed only within that host; a hop elsewhere, such as a sign-in page, keeps the preview), within the shared response-size limit; when Slack will not serve it, the read returns the `files.info` preview. Real-time Search returns at most 20 results a call and counts every page against the member's rate limit, so a search across every source reads one page; a Slack-scoped or native Slack search follows the cursor for up to three pages to fill its limit, and a later page that fails keeps the earlier pages and returns the unread cursor.
6262

6363
### GitHub
6464

‎apps/sim/lib/sim-search/live/providers.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ describe('Slack file hits', () => {
213213
...fields,
214214
})
215215

216-
it('says what each file is and whether a read returns its text, instead of echoing its title', async () => {
216+
it('says what each file is and whether a read can return its text, instead of echoing its title', async () => {
217217
expect(
218218
await fileHits([
219219
hit({ file_type: 'application/pdf', size: 245760 }),
@@ -223,9 +223,9 @@ describe('Slack file hits', () => {
223223
hit({ file_type: 'application/vnd.slack-list' }),
224224
])
225225
).toEqual([
226-
'PDF, 240 KB. Reading it returns its full text.',
227-
'Canvas. Reading it returns its full text.',
228-
'CSV. Reading it returns its full text.',
226+
'PDF, 240 KB. Reading it can return its full text.',
227+
'Canvas. Reading it can return its full text.',
228+
'CSV. Reading it can return its full text.',
229229
'Image. Its contents cannot be read here; open the source.',
230230
'List. Its contents cannot be read here; open the source.',
231231
])
@@ -239,7 +239,7 @@ describe('Slack file hits', () => {
239239
hit({ file_type: 'application/x-unknown', title: 'Plan v2.1 final', content: '' }),
240240
])
241241
).toEqual([
242-
'PDF. Reading it returns its full text.\nRevenue grew 12% in Q3',
242+
'PDF. Reading it can return its full text.\nRevenue grew 12% in Q3',
243243
'File. Its contents cannot be read here; open the source.',
244244
'File. Its contents cannot be read here; open the source.',
245245
])

‎apps/sim/lib/sim-search/live/slack.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ function knownFileLabel(mimetype: string): string {
384384

385385
/**
386386
* Slack search returns only a file's title, repeated as its content. A hit says what the file is
387-
* and whether reading it returns its text, so a reader can tell which files to open.
387+
* and whether reading it can return its text, so a reader can tell which files to open.
388388
*/
389389
function slackFileHitContent(file: Record<string, unknown>, users: Map<string, string>): string {
390390
const mimetype = normalizeMimeType(string(file.file_type))
@@ -402,7 +402,7 @@ function slackFileHitContent(file: Record<string, unknown>, users: Map<string, s
402402
: file.size === 0
403403
? 'The file is empty.'
404404
: withinDownloadLimit(format, file.size)
405-
? 'Reading it returns its full text.'
405+
? 'Reading it can return its full text.'
406406
: 'Too large to read in full here; open the source.'
407407
const text = slackPlainText(string(file.content), users)
408408
return [`${summary}. ${reading}`, text === string(file.title) ? '' : text]

0 commit comments

Comments
 (0)