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
Copy file name to clipboardExpand all lines: docs/backend/threads.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,18 @@ It's intentionally not organized into a single package so that API-level functio
43
43
* If sync fails, continues and returns cached data (graceful degradation).
44
44
* Sync errors are logged but don't fail the request.
45
45
46
+
## Thread Fields
47
+
48
+
The `GetThreadsForFolder` function returns threads with the following fields populated for list views:
49
+
50
+
***`message_count`**: Number of messages in the thread. Always populated in list views to avoid needing to load the full messages array.
51
+
***`last_sent_at`**: Date/time of the most recent message in the thread. Used for date display in the email list (shows time if today, otherwise shows day).
52
+
***`preview_snippet`**: First 100 characters of the first message's body text, with whitespace normalized. Used for email preview in the list view.
53
+
***`has_attachments`**: Boolean indicating if any messages in the thread have non-inline attachments. Used to display attachment indicator (📎) in the list view.
54
+
***`first_message_from_address`**: Sender address of the first message in the thread. Used to display the sender name in the list view.
55
+
56
+
The `EnrichThreadsWithPreviewAndAttachments` function also populates these fields for search results and other cases where threads don't have them pre-populated.
0 commit comments