You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(search): bound personal Gmail sources and sync them from Gmail history (#7717)
* fix(search): bound personal Gmail sources and sync them from Gmail history
A personal Gmail connection indexed the whole mailbox from all time, and
members mode removes the thread cap by design (a capped listing cannot tell
a thread that fell out of the window from one the person lost access to).
Search sources now start from the connector's declared defaults, so Gmail
indexes the last six months unless the source says otherwise. Explicit
settings still win and knowledge-base connectors are unchanged.
Every hourly Gmail sync relisted the entire mailbox because the connector
had no change feed. It now opens a cursor at the mailbox history id and
reads users.history.list, re-reading only threads that gained a message,
were relabelled, or were deleted, and evaluates the configured labels,
date range and category exclusions locally. A free-form search filter
cannot be evaluated locally, so such a source keeps relisting. An expired
history id reopens the feed from a full listing through the engine's
existing cursor-invalid path.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix(search): assert the Gmail date-range table as const
The lookup narrows an arbitrary config string through a type guard
instead of indexing a widened record.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: apps/docs/content/docs/search/gmail.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Open **Settings → Sources** and turn on **Gmail**. Gmail uses member accounts;
25
25
26
26
### Connect your account
27
27
28
-
Open **Integrations** and select **Connect** beside Gmail. Authorize the Google account matching your verified Sim email. The first connection creates the default sync configuration: all dates and labels, excluding Promotions, Social, Spam, and Trash.
28
+
Open **Integrations** and select **Connect** beside Gmail. Authorize the Google account matching your verified Sim email. The first connection creates the default sync configuration: the last 6 months across all labels, excluding Promotions, Social, Spam, and Trash.
29
29
30
30
</Step>
31
31
<Step>
@@ -60,9 +60,9 @@ An admin opens **Settings → Sources**, selects **Manage** beside **Gmail**, op
60
60
| Option | Behavior |
61
61
| --- | --- |
62
62
| Labels | Optional comma-separated names or system IDs, such as `Engineering, INBOX`. A thread matching any listed label is included. Leave empty for all labels. Custom IDs such as `Label_7` belong to one mailbox and cannot be used for member setup. |
63
-
| Date Range |All time by default. Choose the last 7, 30, or 90 days, 6 months, or year. |
63
+
| Date Range |Last 6 months by default for Search sources. Choose the last 7, 30, or 90 days, a year, or all time. A knowledge-base connector outside Search defaults to all time. |
64
64
| Exclude Promotions / Exclude Social | Both enabled by default. Choose **No** to include either category. |
65
-
| Search Filter | Optional [Gmail query](https://developers.google.com/workspace/gmail/api/guides/filtering), such as `from:team@example.com subject:release`. This filters what is indexed; it is not a Sim Search query. |
65
+
| Search Filter | Optional [Gmail query](https://developers.google.com/workspace/gmail/api/guides/filtering), such as `from:team@example.com subject:release`. This filters what is indexed; it is not a Sim Search query. A source with a search filter cannot use Gmail's change history and relists the mailbox on every sync. |
66
66
67
67
In the add-source form, **More options** contains optional **Metadata tags**. Sync frequency and the general knowledge-base **Max Threads** setting are hidden in Search.
68
68
@@ -72,7 +72,7 @@ Sim indexes the message text Gmail returns for each matching thread, plus subjec
72
72
73
73
File attachments and image contents are not indexed. Thread discovery uses Gmail's default exclusion of Spam and Trash. A filter such as `has:attachment` selects the email thread; it does not index the attachment. Gmail API filtering also differs from Gmail's interface for aliases and thread-wide searches. See Google's [thread listing reference](https://developers.google.com/workspace/gmail/api/reference/rest/v1/users.threads/list) and [filtering guide](https://developers.google.com/workspace/gmail/api/guides/filtering).
74
74
75
-
Search schedules syncs hourly. The first sync and large mailboxes can take longer; results appear as documents are indexed. Updates and removals are reconciled during background sync, rather than fetched live for each search.
75
+
Search schedules syncs hourly. The first sync lists every thread in scope and can take several runs for a large mailbox; results appear as documents are indexed. Later syncs read Gmail's change history instead of relisting the mailbox, so only threads that gained a message, were relabelled, or were deleted since the previous run are fetched. A full relisting runs about weekly, or sooner if Gmail no longer retains the history the source last read. Updates and removals are reconciled during background sync, rather than fetched live for each search.
76
76
77
77
An empty mailbox or filters with no matching threads complete normally with zero documents.
0 commit comments