Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(channels): show system activity inline with messages (#6674)

teo41fc673feeba
diff --git a/.sqlx/query-61f16c34534adc603c9e4730633a37c8e6e77b9dbb20eb1035e8b74dca5b71fc.json b/.sqlx/query-61f16c34534adc603c9e4730633a37c8e6e77b9dbb20eb1035e8b74dca5b71fc.json
new file mode 100644
index 0000000000..9e6ba26c98
--- /dev/null
+++ b/.sqlx/query-61f16c34534adc603c9e4730633a37c8e6e77b9dbb20eb1035e8b74dca5b71fc.json
@@ -0,0 +1,50 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT event.id AS \"id!\", event.actor_id AS \"actor_id!\",\n event.occurred_at AS \"occurred_at!\", event.action AS \"action!\", event.payload\n FROM unnest($3::text[]) selected(action)\n CROSS JOIN LATERAL (\n SELECT id, actor_id, occurred_at, action, action_payload AS payload\n FROM activity_events\n WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action\n AND action NOT IN ('messaged', 'opened', 'edited', 'sent')\n AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0\n OR action_payload->>'property' = ANY($4::text[]))\n ORDER BY occurred_at DESC, id DESC LIMIT $5\n ) event\n ORDER BY event.occurred_at DESC, event.id DESC LIMIT $5\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "actor_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "occurred_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 3,
+ "name": "action!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "payload",
+ "type_info": "Jsonb"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Text",
+ "TextArray",
+ "TextArray",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "61f16c34534adc603c9e4730633a37c8e6e77b9dbb20eb1035e8b74dca5b71fc"
+}
diff --git a/.sqlx/query-74187721de1bb2d18f665de8eba9e6ea70beed6f40115a7d4a382fab38007c05.json b/.sqlx/query-74187721de1bb2d18f665de8eba9e6ea70beed6f40115a7d4a382fab38007c05.json
new file mode 100644
index 0000000000..803569eb21
--- /dev/null
+++ b/.sqlx/query-74187721de1bb2d18f665de8eba9e6ea70beed6f40115a7d4a382fab38007c05.json
@@ -0,0 +1,50 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT event.id AS \"id!\", event.actor_id AS \"actor_id!\",\n event.occurred_at AS \"occurred_at!\", event.action AS \"action!\", event.payload\n FROM unnest($3::text[]) selected(action)\n CROSS JOIN LATERAL (\n SELECT id, actor_id, occurred_at, action, action_payload AS payload\n FROM activity_events\n WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action\n AND action NOT IN ('messaged', 'opened', 'edited', 'sent')\n AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0\n OR action_payload->>'property' = ANY($4::text[]))\n ORDER BY occurred_at ASC, id ASC LIMIT $5\n ) event\n ORDER BY event.occurred_at ASC, event.id ASC LIMIT $5\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "actor_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "occurred_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 3,
+ "name": "action!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "payload",
+ "type_info": "Jsonb"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Text",
+ "TextArray",
+ "TextArray",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "74187721de1bb2d18f665de8eba9e6ea70beed6f40115a7d4a382fab38007c05"
+}
diff --git a/.sqlx/query-bbe91bbffcd4264d7f12fdaae93996a859f433af3b482abf56d6705b6648e4df.json b/.sqlx/query-bbe91bbffcd4264d7f12fdaae93996a859f433af3b482abf56d6705b6648e4df.json
new file mode 100644
index 0000000000..bd091f98e8
--- /dev/null
+++ b/.sqlx/query-bbe91bbffcd4264d7f12fdaae93996a859f433af3b482abf56d6705b6648e4df.json
@@ -0,0 +1,52 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT event.id AS \"id!\", event.actor_id AS \"actor_id!\",\n event.occurred_at AS \"occurred_at!\", event.action AS \"action!\", event.payload\n FROM unnest($3::text[]) selected(action)\n CROSS JOIN LATERAL (\n SELECT id, actor_id, occurred_at, action, action_payload AS payload\n FROM activity_events\n WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action\n AND action NOT IN ('messaged', 'opened', 'edited', 'sent')\n AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0\n OR action_payload->>'property' = ANY($4::text[]))\n AND (occurred_at, id) < ($5, $6)\n ORDER BY occurred_at DESC, id DESC LIMIT $7\n ) event\n ORDER BY event.occurred_at DESC, event.id DESC LIMIT $7\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "actor_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "occurred_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 3,
+ "name": "action!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "payload",
+ "type_info": "Jsonb"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Text",
+ "TextArray",
+ "TextArray",
+ "Timestamptz",
+ "Uuid",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "bbe91bbffcd4264d7f12fdaae93996a859f433af3b482abf56d6705b6648e4df"
+}
diff --git a/.sqlx/query-e695716e4524a9eb08f634a0b3001e16ba48aab75f7dae7ac8d4297fb0c5250d.json b/.sqlx/query-e695716e4524a9eb08f634a0b3001e16ba48aab75f7dae7ac8d4297fb0c5250d.json
new file mode 100644
index 0000000000..6d58658d45
--- /dev/null
+++ b/.sqlx/query-e695716e4524a9eb08f634a0b3001e16ba48aab75f7dae7ac8d4297fb0c5250d.json
@@ -0,0 +1,52 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT event.id AS \"id!\", event.actor_id AS \"actor_id!\",\n event.occurred_at AS \"occurred_at!\", event.action AS \"action!\", event.payload\n FROM unnest($3::text[]) selected(action)\n CROSS JOIN LATERAL (\n SELECT id, actor_id, occurred_at, action, action_payload AS payload\n FROM activity_events\n WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action\n AND action NOT IN ('messaged', 'opened', 'edited', 'sent')\n AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0\n OR action_payload->>'property' = ANY($4::text[]))\n AND (occurred_at, id) > ($5, $6)\n ORDER BY occurred_at ASC, id ASC LIMIT $7\n ) event\n ORDER BY event.occurred_at ASC, event.id ASC LIMIT $7\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "id!",
+ "type_info": "Uuid"
+ },
+ {
+ "ordinal": 1,
+ "name": "actor_id!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "occurred_at!",
+ "type_info": "Timestamptz"
+ },
+ {
+ "ordinal": 3,
+ "name": "action!",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "payload",
+ "type_info": "Jsonb"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Text",
+ "Text",
+ "TextArray",
+ "TextArray",
+ "Timestamptz",
+ "Uuid",
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ false,
+ true
+ ]
+ },
+ "hash": "e695716e4524a9eb08f634a0b3001e16ba48aab75f7dae7ac8d4297fb0c5250d"
+}
diff --git a/.sqlx/query-c21fcdd69e4f9d116b052ae79df233fdc85c1088cc61a9574707076b2c4b5141.json b/.sqlx/query-e95190988d13eda46c61b0f347c942ecb92a1c858529be4a98c549017f993399.json
similarity index 60%
rename from .sqlx/query-c21fcdd69e4f9d116b052ae79df233fdc85c1088cc61a9574707076b2c4b5141.json
rename to .sqlx/query-e95190988d13eda46c61b0f347c942ecb92a1c858529be4a98c549017f993399.json
index 3cf87e3554..6e615d9e07 100644
--- a/.sqlx/query-c21fcdd69e4f9d116b052ae79df233fdc85c1088cc61a9574707076b2c4b5141.json
+++ b/.sqlx/query-e95190988d13eda46c61b0f347c942ecb92a1c858529be4a98c549017f993399.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "UPDATE comms_channels SET profile_picture_id = $2, updated_at = NOW() WHERE id = $1",
+ "query": "UPDATE comms_channels SET profile_picture_id = $2, updated_at = NOW() WHERE id = $1 AND profile_picture_id IS DISTINCT FROM $2",
"describe": {
"columns": [],
"parameters": {
@@ -11,5 +11,5 @@
},
"nullable": []
},
- "hash": "c21fcdd69e4f9d116b052ae79df233fdc85c1088cc61a9574707076b2c4b5141"
+ "hash": "e95190988d13eda46c61b0f347c942ecb92a1c858529be4a98c549017f993399"
}
diff --git a/Cargo.lock b/Cargo.lock
index 47c6b095ab..7682584bad 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -39,6 +39,7 @@ dependencies = [
"tokio-retry",
"tokio-util",
"tracing",
+ "utoipa",
"uuid",
"workspace-hack",
]
@@ -12170,6 +12171,7 @@ dependencies = [
name = "messages"
version = "0.1.0"
dependencies = [
+ "activity",
"async-trait",
"axum",
"bot_id",
@@ -12177,6 +12179,7 @@ dependencies = [
"chrono",
"connection_gateway_client",
"entity_access",
+ "futures",
"initiative",
"macro_authorization",
"macro_db_migrator",
diff --git a/apps/web/src/features/block-channel/component/NewChannelBlockAdapter.tsx b/apps/web/src/features/block-channel/component/NewChannelBlockAdapter.tsx
index 21f16c5727..f3eadb283f 100644
--- a/apps/web/src/features/block-channel/component/NewChannelBlockAdapter.tsx
+++ b/apps/web/src/features/block-channel/component/NewChannelBlockAdapter.tsx
@@ -9,7 +9,6 @@ import {
useBlockEntityCommands,
} from '@app/features/next-soup/actions';
import { createSearchParams } from '@app/lib/split-router';
-import { globalSplitManager } from '@app/signal/splitLayout';
import { URL_PARAMS } from '@block-channel/constants';
import { ChannelAttachmentsTab } from '@channel/Attachments/ChannelAttachmentsTab';
import { useChannelBotManagement } from '@channel/Bots/use-channel-bot-management';
@@ -56,6 +55,7 @@ import { HeaderIsland } from '@components/app/split-layout/components/HeaderIsla
import { BlockSplitFileMenu } from '@components/app/split-layout/components/SplitFileMenu';
import { SplitHeaderRight } from '@components/app/split-layout/components/SplitHeader';
import { SplitTitleFileMenu } from '@components/app/split-layout/components/SplitLabel';
+import { SplitLayoutContext } from '@components/app/split-layout/context';
import {
useCanAutofocusSplitContent,
useSplitPanelOrThrow,
@@ -93,6 +93,7 @@ import {
Show,
Suspense,
Switch,
+ useContext,
} from 'solid-js';
import { ChannelTopLeft } from './Top';
@@ -311,6 +312,8 @@ export function NewChannelBlockAdapter(props: BlockChannelProps) {
// BlockContainer. The adapter requires a split panel, so unlike
// BlockContainer it needs no fallback DOM scope of its own.
const splitPanel = useSplitPanelOrThrow();
+ // The layout context exists during construction; its global signal is set later.
+ const splitLayout = useContext(SplitLayoutContext);
blockHotkeyScopeSignal.set(splitPanel.splitHotkeyScope);
useBlockEntityCommands();
const canAutofocusSplitContent = useCanAutofocusSplitContent();
@@ -335,7 +338,7 @@ export function NewChannelBlockAdapter(props: BlockChannelProps) {
[URL_PARAMS.thread]: props[URL_PARAMS.thread],
};
}
- const isSingleSplit = globalSplitManager()?.splits().length === 1;
+ const isSingleSplit = splitLayout?.manager.splits().length === 1;
if (!isSingleSplit) return {};
return {
[URL_PARAMS.message]: searchParams[URL_PARAMS.message] as
@@ -369,7 +372,7 @@ export function NewChannelBlockAdapter(props: BlockChannelProps) {
props[URL_PARAMS.thread] !== undefined;
if (hasPropsTarget) return true;
- const isSingleSplit = globalSplitManager()?.splits().length === 1;
+ const isSingleSplit = splitLayout?.manager.splits().length === 1;
if (!isSingleSplit) return false;
return (
diff --git a/apps/web/src/features/channel/Channel/Channel.tsx b/apps/web/src/features/channel/Channel/Channel.tsx
index d91ffbcecb..6317239284 100644
--- a/apps/web/src/features/channel/Channel/Channel.tsx
+++ b/apps/web/src/features/channel/Channel/Channel.tsx
@@ -69,6 +69,7 @@ import {
type MessageTimelineData,
useMessageTimelineQuery,
} from '@queries/messages/timeline';
+import { timelineEntryKey } from '@queries/messages/timeline-entries';
import { usePostTypingUpdateMutation } from '@queries/messages/typing';
import { ChannelTypeEnum } from '@service-storage/client';
import { useBeforeLeave } from '@solidjs/router';
@@ -91,7 +92,11 @@ import {
} from '../Input';
import { ChannelInputContainer } from '../Input/ChannelInputContainer';
import { hasSendableInputContent } from '../Input/utils/sendable-content';
+import { decodeSystemActivity } from '../queries/system-activity';
+import { SystemActivity } from '../SystemActivity';
import { ChannelThread } from '../Thread';
+import { ThreadRow } from '../Thread/ThreadRow';
+import { ThreadTypingIndicator } from '../Thread/ThreadTypingIndicator';
import { buildReplyTargetValue } from '../Thread/utils/message-actions';
import { CHANNEL_TOUR } from '../tour';
import { isUnifiedInputMode } from '../unified-input-mode';
@@ -252,8 +257,9 @@ export function Channel(props: ChannelProps) {
: undefined
);
- const messages = createMemo(() => [...messageIndex.items]);
const messageById = () => messageIndex.byId;
+ // Loaded messages, oldest first; activity rows are not unread targets.
+ const messages = createMemo(() => [...messageIndex.byId.values()]);
const participants = useChannelParticipants(() => props.channelId);
const channelBotMentionUsers = useMessageBotMentionUsers(() => ({
type: 'channel',
@@ -334,9 +340,9 @@ export function Channel(props: ChannelProps) {
userId,
});
- const listMetaByMessageId = createMemo(() =>
+ const listMetaByKey = createMemo(() =>
buildChannelMessageListMeta(
- messages(),
+ messageIndex.entries,
activityTracker.isNewMessage,
// Once there are no older pages left to fetch, the oldest loaded message
// (index 0) is the true first message in the channel.
@@ -561,12 +567,10 @@ export function Channel(props: ChannelProps) {
return;
// Retained data is usable after a pagination error. Wait only if the query
// has no data yet or the message index still contains the old page.
- const latestMessageId = messagesQuery.data?.pages.find(
- (page) => page.items.length > 0
- )?.items[0]?.id;
+ const latestEntry = messagesQuery.data?.pages[0]?.entries[0];
if (
- latestMessageId !== undefined &&
- messageIndex.keys.at(-1) === latestMessageId &&
+ latestEntry !== undefined &&
+ messageIndex.entryKeys.at(-1) === timelineEntryKey(latestEntry) &&
threadListNavigation()?.scrollToLatest()
)
cancelLatestNavigation();
@@ -716,7 +720,7 @@ export function Channel(props: ChannelProps) {
direction="desc"
/>
</Show>
- <Show when={messages().length > 0}>
+ <Show when={messageIndex.entryKeys.length > 0}>
<div
class="relative flex-1 min-h-0"
ref={setThreadListContainerEl}
@@ -724,6 +728,7 @@ export function Channel(props: ChannelProps) {
<ChannelUnreadNotifications
channelId={props.channelId}
messages={messages}
+ activities={() => messageIndex.activityByKey}
scrollState={threadListScrollState}
container={threadListContainerEl}
insets={threadListScrollInsets}
@@ -735,7 +740,7 @@ export function Channel(props: ChannelProps) {
triggerBehavior="spring-back"
>
<ThreadList
- keys={() => messageIndex.keys}
+ keys={() => messageIndex.entryKeys}
targetId={
targetMessageController.hasPendingElementScroll()
? targetMessageController.activeTargetMessageId()
@@ -767,110 +772,149 @@ export function Channel(props: ChannelProps) {
}
>
{(item) => {
+ const isNewestRow = () =>
+ item.id === messageIndex.entryKeys.at(-1);
+ const activity = () =>
+ messageIndex.activityByKey.get(item.id);
const message = () =>
messageById().get(item.id);
- const state =
- threadManager.getOrCreateThreadState(
- item.id
- );
- const isNewestThread = () =>
- item.id === messageIndex.keys.at(-1);
return (
- <Show when={message()}>
- {(m) => (
- <ChannelThread
- data={m}
- parent={() => ({
- type: 'channel',
- id: (() => props.channelId)(),
- })}
- isNewestThread={isNewestThread()}
- getMessageActions={getMessageActions}
- isFindBarOpen={findBar.isOpen}
- targetNavigation={{
- targetThreadId:
- targetMessageController.activeTargetMessageId,
- targetMessageId: () =>
- !targetMessageController.pendingTargetReplyId()
- ? targetMessageController.pendingScrollTargetId()
- : undefined,
- targetReplyId: () =>
- targetMessageController.pendingScrollTargetId()
- ? undefined
- : targetMessageController.pendingTargetReplyId(),
- activeTargetReplyId:
- targetMessageController.activeTargetMessageReplyId,
- positionTarget: (
- _,
- targetElement
- ) =>
- threadListNavigation()?.scrollToElement(
- targetElement
- ) ?? false,
- onTargetMessageScrolled:
- targetMessageController.completePendingScroll,
- onTargetReplyScrolled: (
- replyId
- ) => {
- targetMessageController.completePendingReplyScroll(
- item.id,
- replyId
- );
- },
- onClearTarget:
- releaseSelectionAndTarget,
- }}
- inputMode={
- isUnifiedInputMode()
- ? 'unified'
- : 'inline'
- }
- unifiedReplyTarget={unifiedInput.replyTarget()}
- isExpanded={state.isExpanded}
- setIsExpanded={state.setIsExpanded}
- isReplying={state.isReplying}
- setIsReplying={state.setIsReplying}
- replyInputState={
- state.replyInputState
- }
- setReplyInputState={
- state.setReplyInputState
- }
- setReplyInputEl={
- state.setReplyInputEl
- }
- replyInputHandle={
- state.replyInputHandle
- }
- setReplyInputHandle={
- state.setReplyInputHandle
- }
- replyInputFocusRequest={
- state.replyInputFocusRequest
- }
- listMeta={
- listMetaByMessageId()[item.id]
- }
- messageEditor={messageEditor}
- threadActions={{
- onDismissNewMessages:
- activityTracker.dismissNewMessages,
- }}
- isNewMessage={
- activityTracker.isNewMessage
- }
- selectedMessageId={
- selection.selectedId
- }
- onSelectMessage={selectMessage}
- onClearSelection={clearSelection}
- messageListScopeId={
- messageListScopeId
- }
- />
- )}
- </Show>
+ <Switch>
+ <Match when={activity()}>
+ {(activity) => (
+ <ThreadRow
+ channelId={props.channelId}
+ message={{
+ created_at:
+ activity().occurred_at,
+ }}
+ listMeta={listMetaByKey()[item.id]}
+ >
+ <SystemActivity
+ event={decodeSystemActivity(
+ activity()
+ )}
+ />
+ <Show when={isNewestRow()}>
+ <ThreadTypingIndicator
+ parent={{
+ type: 'channel',
+ id: props.channelId,
+ }}
+ threadId={null}
+ />
+ </Show>
+ </ThreadRow>
+ )}
+ </Match>
+ <Match when={message()}>
+ {(m) => {
+ const state =
+ threadManager.getOrCreateThreadState(
+ item.id
+ );
+ return (
+ <ChannelThread
+ data={m}
+ parent={() => ({
+ type: 'channel',
+ id: (() => props.channelId)(),
+ })}
+ isNewestThread={isNewestRow()}
+ getMessageActions={
+ getMessageActions
+ }
+ isFindBarOpen={findBar.isOpen}
+ targetNavigation={{
+ targetThreadId:
+ targetMessageController.activeTargetMessageId,
+ targetMessageId: () =>
+ !targetMessageController.pendingTargetReplyId()
+ ? targetMessageController.pendingScrollTargetId()
+ : undefined,
+ targetReplyId: () =>
+ targetMessageController.pendingScrollTargetId()
+ ? undefined
+ : targetMessageController.pendingTargetReplyId(),
+ activeTargetReplyId:
+ targetMessageController.activeTargetMessageReplyId,
+ positionTarget: (
+ _,
+ targetElement
+ ) =>
+ threadListNavigation()?.scrollToElement(
+ targetElement
+ ) ?? false,
+ onTargetMessageScrolled:
+ targetMessageController.completePendingScroll,
+ onTargetReplyScrolled: (
+ replyId
+ ) => {
+ targetMessageController.completePendingReplyScroll(
+ item.id,
+ replyId
+ );
+ },
+ onClearTarget:
+ releaseSelectionAndTarget,
+ }}
+ inputMode={
+ isUnifiedInputMode()
+ ? 'unified'
+ : 'inline'
+ }
+ unifiedReplyTarget={unifiedInput.replyTarget()}
+ isExpanded={state.isExpanded}
+ setIsExpanded={
+ state.setIsExpanded
+ }
+ isReplying={state.isReplying}
+ setIsReplying={
+ state.setIsReplying
+ }
+ replyInputState={
+ state.replyInputState
+ }
+ setReplyInputState={
+ state.setReplyInputState
+ }
+ setReplyInputEl={
+ state.setReplyInputEl
+ }
+ replyInputHandle={
+ state.replyInputHandle
+ }
+ setReplyInputHandle={
+ state.setReplyInputHandle
+ }
+ replyInputFocusRequest={
+ state.replyInputFocusRequest
+ }
+ listMeta={
+ listMetaByKey()[item.id]
+ }
+ messageEditor={messageEditor}
+ threadActions={{
+ onDismissNewMessages:
+ activityTracker.dismissNewMessages,
+ }}
+ isNewMessage={
+ activityTracker.isNewMessage
+ }
+ selectedMessageId={
+ selection.selectedId
+ }
+ onSelectMessage={selectMessage}
+ onClearSelection={clearSelection}
+ messageListScopeId={
+ messageListScopeId
+ }
+ />
+ );
+ }}
+ </Match>
+ </Switch>
);
}}
</ThreadList>
diff --git a/apps/web/src/features/channel/Channel/ChannelUnreadNotifications.tsx b/apps/web/src/features/channel/Channel/ChannelUnreadNotifications.tsx
index 004f34f6ee..c06b24529d 100644
--- a/apps/web/src/features/channel/Channel/ChannelUnreadNotifications.tsx
+++ b/apps/web/src/features/channel/Channel/ChannelUnreadNotifications.tsx
@@ -8,10 +8,14 @@ import { indexUnreadMessageNotifications } from '@notifications/unread-message-n
import { createChannelNotificationsQuery } from '@queries/channel/notifications';
import { queryReadyGate } from '@queries/gate';
import { useMessageTimelineByIdsQuery } from '@queries/messages/timeline';
-import type { MessageListItem } from '@service-storage/messages';
+import type {
+ MessageListItem,
+ TimelineActivity,
+} from '@service-storage/messages';
import { type Accessor, createMemo, type JSX } from 'solid-js';
import type { ThreadListScrollState } from './ThreadList';
import {
+ type ThreadPosition,
type UnreadNotificationChip,
unreadNotificationChip,
unreadThreads,
@@ -21,6 +25,8 @@ import {
export function ChannelUnreadNotifications(props: {
channelId: string;
messages: Accessor<MessageListItem[]>;
+ /** Activity rows can be the first visible row, so they need positions too. */
+ activities?: Accessor<ReadonlyMap<string, TimelineActivity>>;
scrollState: Accessor<ThreadListScrollState | undefined>;
container: Accessor<HTMLElement | undefined>;
insets: Accessor<{ start: number; end: number }>;
@@ -68,13 +74,15 @@ export function ChannelUnreadNotifications(props: {
}
);
const unreadChip = createMemo(() => {
- const positions = new Map(
+ const positions = new Map<string, ThreadPosition>(
(queryReadyGate(unreadRoots) ? unreadRoots.data : []).map((message) => [
message.id,
message,
])
);
for (const message of props.messages()) positions.set(message.id, message);
+ for (const [key, activity] of props.activities?.() ?? [])
+ positions.set(key, { id: activity.id, created_at: activity.occurred_at });
const scroll = props.scrollState();
const target = unread()[0];
const container = props.container();
diff --git a/apps/web/src/features/channel/Channel/ThreadList.tsx b/apps/web/src/features/channel/Channel/ThreadList.tsx
index 52a9ce1df0..57e5640b29 100644
--- a/apps/web/src/features/channel/Channel/ThreadList.tsx
+++ b/apps/web/src/features/channel/Channel/ThreadList.tsx
@@ -310,7 +310,7 @@ export function ThreadList(props: ThreadListProps) {
element?.addEventListener('touchstart', onTouchStart, {
passive: true,
});
- const cleanup = observeElementOffset(instance, (offset, isScrolling) => {
+ const reportOffset = (offset: number, isScrolling: boolean) => {
// An instant navigation/correction must not extend gesture compensation.
const isOwnScroll =
programmaticOffset !== undefined &&
@@ -323,8 +323,18 @@ export function ThreadList(props: ThreadListProps) {
isScrolling && !isOwnScroll
) ?? offset;
callback(logicalOffset, isScrolling && !isOwnScroll);
+ };
+ const cleanup = observeElementOffset(instance, reportOffset);
+ // A short list clamps the initial end scroll to zero without emitting a
+ // scroll event. Read it back after the initial write so the virtual range
+ // includes the first rows, before paint.
+ let disposed = false;
+ queueMicrotask(() => {
+ if (!disposed && element?.isConnected)
+ reportOffset(element.scrollTop, false);
});
return () => {
+ disposed = true;
cleanup?.();
if (onWheel) element?.removeEventListener('wheel', onWheel);
if (onTouchStart)
diff --git a/apps/web/src/features/channel/Channel/message-list-meta.ts b/apps/web/src/features/channel/Channel/message-list-meta.ts
index 8eacfd55be..9126074a67 100644
--- a/apps/web/src/features/channel/Channel/message-list-meta.ts
+++ b/apps/web/src/features/channel/Channel/message-list-meta.ts
@@ -1,11 +1,18 @@
+import { timelineEntryKey } from '@queries/messages/timeline-entries';
import type { ChannelMessageListMeta } from '../Message/list-meta';
import {
type GroupableMessage,
shouldGroupWithPreviousMessage,
} from './message-grouping-meta';
+/** One timeline row: a message, or system activity between messages. */
+type ChannelListEntry<T> =
+ | { type: 'message'; message: T }
+ | { type: 'activity'; activity: { id: string; occurred_at: string } };
+
+/** List meta keyed by `timelineEntryKey`, oldest entry first. */
export function buildChannelMessageListMeta<T extends GroupableMessage>(
- messages: T[],
+ entries: ChannelListEntry<T>[],
isNewMessageFn: (message: T) => boolean,
reachedStart: boolean,
/**
@@ -14,12 +21,29 @@ export function buildChannelMessageListMeta<T extends GroupableMessage>(
*/
isThreadOpen?: (message: T) => boolean
): Record<string, ChannelMessageListMeta> {
- const metaByMessageId: Record<string, ChannelMessageListMeta> = {};
+ const metaByKey: Record<string, ChannelMessageListMeta> = {};
let previousTopLevelCreatedAt: string | undefined;
let previousMessage: T | undefined;
let foundFirstNewMessage = false;
- for (const [index, message] of messages.entries()) {
+ for (const [index, entry] of entries.entries()) {
+ const key = timelineEntryKey(entry);
+ if (entry.type === 'activity') {
+ metaByKey[key] = {
+ index,
+ isNewMessage: false,
+ isFirstNewMessage: false,
+ previousTopLevelCreatedAt,
+ isGroupedWithPrevious: false,
+ reachedStart,
+ };
+ previousTopLevelCreatedAt = entry.activity.occurred_at;
+ // Activity ends the sender run, so neither grouping nor rails cross it.
+ previousMessage = undefined;
+ continue;
+ }
+
+ const message = entry.message;
const isNewMessage = isNewMessageFn(message);
const isFirstNewMessage = isNewMessage && !foundFirstNewMessage;
@@ -27,7 +51,7 @@ export function buildChannelMessageListMeta<T extends GroupableMessage>(
foundFirstNewMessage = true;
}
- metaByMessageId[message.id] = {
+ metaByKey[key] = {
index,
isNewMessage,
isFirstNewMessage,
@@ -45,16 +69,17 @@ export function buildChannelMessageListMeta<T extends GroupableMessage>(
// Backward pass: a row carries the rail through it when a later member of
// its sender run owns a thread (the rail runs from the run's header avatar
- // down to that fork point).
- for (let i = messages.length - 2; i >= 0; i--) {
- const next = messages[i + 1]!;
- const nextMeta = metaByMessageId[next.id]!;
+ // down to that fork point). A grouped row always follows a message.
+ for (let i = entries.length - 2; i >= 0; i--) {
+ const next = entries[i + 1]!;
+ if (next.type !== 'message') continue;
+ const nextMeta = metaByKey[next.message.id]!;
if (!nextMeta.isGroupedWithPrevious) continue;
- metaByMessageId[messages[i]!.id]!.threadRailBelow =
- (next.thread?.reply_count ?? 0) > 0 ||
- isThreadOpen?.(next) === true ||
+ metaByKey[timelineEntryKey(entries[i]!)]!.threadRailBelow =
+ (next.message.thread?.reply_count ?? 0) > 0 ||
+ isThreadOpen?.(next.message) === true ||
nextMeta.threadRailBelow === true;
}
- return metaByMessageId;
+ return metaByKey;
}
diff --git a/apps/web/src/features/channel/Channel/tests/ChannelUnreadNotifications.test.tsx b/apps/web/src/features/channel/Channel/tests/ChannelUnreadNotifications.test.tsx
index d692644fc7..8170909d1f 100644
--- a/apps/web/src/features/channel/Channel/tests/ChannelUnreadNotifications.test.tsx
+++ b/apps/web/src/features/channel/Channel/tests/ChannelUnreadNotifications.test.tsx
@@ -205,3 +205,67 @@ it('updates one chip live without suspending the channel or loading the global f
expect(view.queryByRole('button')).toBeNull();
expect(globalRead).not.toHaveBeenCalled();
});
+
+it('places the chip when an activity row is the first visible row', () => {
+ mocks.source.mockReturnValue({
+ notificationsByEntity: vi.fn(),
+ withLocalOverrides: (n: UnifiedNotification) => n,
+ });
+ mocks.query.mockReturnValue({
+ isEnabled: true,
+ isPending: false,
+ data: [notification('root-1', 12)],
+ });
+ const messages = [1, 3].map(
+ (i) =>
+ ({
+ id: `root-${i}`,
+ created_at: `2026-08-0${i}T00:00:00Z`,
+ }) as MessageListItem
+ );
+ const activities = new Map([
+ [
+ 'activity:joined',
+ {
+ id: 'joined',
+ actor_id: 'macro|[email protected]',
+ occurred_at: '2026-08-02T00:00:00Z',
+ action: 'participant_added',
+ payload: null,
+ },
+ ],
+ ]);
+ const view = render(() => (
+ <ChannelUnreadNotifications
+ channelId="channel"
+ messages={() => messages}
+ activities={() => activities}
+ scrollState={() => ({
+ didInitialScroll: true,
+ visibleRange: { first: 'activity:joined', last: 'root-3' },
+ isNearBottom: false,
+ isScrollingDown: false,
+ distanceFromBottom: 500,
+ distanceFromTop: 500,
+ viewportSize: 500,
+ })}
+ container={() => undefined}
+ insets={() => ({ start: 0, end: 0 })}
+ >
+ {(chip) => (
+ <Show when={chip()}>
+ {(value) => (
+ <UnreadNotificationsOverlay
+ direction={value().direction}
+ count={value().count}
+ onClick={() => {}}
+ />
+ )}
+ </Show>
+ )}
+ </ChannelUnreadNotifications>
+ ));
+ expect(
+ view.getByRole('button', { name: '1 unread notification stack above' })
+ ).toBeTruthy();
+});
diff --git a/apps/web/src/features/channel/Channel/tests/create-target-message-controller.test.ts b/apps/web/src/features/channel/Channel/tests/create-target-message-controller.test.ts
index 367cb713f2..0f8c139981 100644
--- a/apps/web/src/features/channel/Channel/tests/create-target-message-controller.test.ts
+++ b/apps/web/src/features/channel/Channel/tests/create-target-message-controller.test.ts
@@ -162,7 +162,7 @@ describe('pagination restore', () => {
pageParams: [null],
pages: [
{
- items: [],
+ entries: [],
next_cursor: { id: 'next', created_at: '2024-01-01T00:00:00Z' },
previous_cursor: { id: 'prev', created_at: '2024-01-01T00:00:00Z' },
},
diff --git a/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts b/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts
index 57d514a6d9..19cf7eacf0 100644
--- a/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts
+++ b/apps/web/src/features/channel/Channel/tests/message-list-meta.test.ts
@@ -35,7 +35,39 @@ function createMessage(
};
}
+const entries = (messages: MessageListItem[]) =>
+ messages.map((message) => ({ type: 'message' as const, message }));
+
describe('buildChannelMessageListMeta', () => {
+ it('counts activity rows and breaks sender runs and rails at them', () => {
+ const first = createMessage('m1', '2026-02-20T09:00:00.000Z');
+ const second = createMessage('m2', '2026-02-20T09:01:00.000Z');
+ second.thread.reply_count = 1;
+ const meta = buildChannelMessageListMeta(
+ [
+ { type: 'message', message: first },
+ {
+ type: 'activity',
+ activity: { id: 'a1', occurred_at: '2026-02-20T09:00:30.000Z' },
+ },
+ { type: 'message', message: second },
+ ],
+ () => false,
+ true
+ );
+ expect(meta['activity:a1']).toMatchObject({
+ index: 1,
+ previousTopLevelCreatedAt: '2026-02-20T09:00:00.000Z',
+ isGroupedWithPrevious: false,
+ });
+ expect(meta.m2).toMatchObject({
+ index: 2,
+ previousTopLevelCreatedAt: '2026-02-20T09:00:30.000Z',
+ isGroupedWithPrevious: false,
+ });
+ expect(meta.m1.threadRailBelow).toBeUndefined();
+ });
+
it('sets list index and previous top-level timestamp in order', () => {
const messages = [
createMessage('m1', '2026-02-20T09:00:00.000Z'),
@@ -43,7 +75,11 @@ describe('buildChannelMessageListMeta', () => {
createMessage('m3', '2026-02-21T09:00:00.000Z'),
];
- const meta = buildChannelMessageListMeta(messages, () => false, true);
+ const meta = buildChannelMessageListMeta(
+ entries(messages),
+ () => false,
+ true
+ );
expect(meta.m1).toEqual({
index: 0,
@@ -65,7 +101,7 @@ describe('buildChannelMessageListMeta', () => {
];
const meta = buildChannelMessageListMeta(
- messages,
+ entries(messages),
(message) => message.id === 'm2' || message.id === 'm3',
true
);
@@ -84,7 +120,11 @@ describe('buildChannelMessageListMeta', () => {
createMessage('m3', '2026-02-20T09:05:01.000Z'),
];
- const meta = buildChannelMessageListMeta(messages, () => false, true);
+ const meta = buildChannelMessageListMeta(
+ entries(messages),
+ () => false,
+ true
+ );
expect(meta.m1.isGroupedWithPrevious).toBe(false);
expect(meta.m2.isGroupedWithPrevious).toBe(true);
@@ -106,7 +146,11 @@ describe('buildChannelMessageListMeta', () => {
createMessage('m4', '2026-02-20T10:30:00.000Z'),
];
- const meta = buildChannelMessageListMeta(messages, () => false, true);
+ const meta = buildChannelMessageListMeta(
+ entries(messages),
+ () => false,
+ true
+ );
// m3 is grouped into the run but owns a thread: the rail passes down
// through m1 (run header) and m2 to reach it.
@@ -149,7 +193,11 @@ describe('buildChannelMessageListMeta', () => {
),
];
- const meta = buildChannelMessageListMeta(messages, () => false, true);
+ const meta = buildChannelMessageListMeta(
+ entries(messages),
+ () => false,
+ true
+ );
expect(meta.m2.isGroupedWithPrevious).toBe(false);
expect(meta.m3.isGroupedWithPrevious).toBe(true);
diff --git a/apps/web/src/features/channel/Channel/tests/thread-list-pagination.test.tsx b/apps/web/src/features/channel/Channel/tests/thread-list-pagination.test.tsx
index d1b9439a2b..db9f2d82d5 100644
--- a/apps/web/src/features/channel/Channel/tests/thread-list-pagination.test.tsx
+++ b/apps/web/src/features/channel/Channel/tests/thread-list-pagination.test.tsx
@@ -4,6 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { ThreadList, type ThreadListNavigation } from '../ThreadList';
const rowHeights = new Map<string, number>();
+let viewportHeight = 400;
const platform = vi.hoisted(() => ({ safari: true }));
vi.mock('@solid-primitives/platform', () => ({
@@ -19,16 +20,19 @@ vi.mock('@core/component/CustomScrollbar', () => ({
beforeEach(() => {
platform.safari = true;
rowHeights.clear();
+ viewportHeight = 400;
// Supply layout for the real virtualizer; jsdom does not measure DOM nodes.
vi.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockImplementation(
function (this: HTMLElement) {
return this.hasAttribute('data-index')
? (rowHeights.get(this.textContent ?? '') ?? 96)
- : 400;
+ : viewportHeight;
}
);
vi.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(400);
- vi.spyOn(HTMLElement.prototype, 'clientHeight', 'get').mockReturnValue(400);
+ vi.spyOn(HTMLElement.prototype, 'clientHeight', 'get').mockImplementation(
+ () => viewportHeight
+ );
vi.spyOn(HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(
function (this: HTMLElement) {
return Number.parseFloat(
@@ -99,6 +103,61 @@ function setup(followOnAppend = true) {
}
describe('history loading ahead of scrolling', () => {
+ it.each([false, true])(
+ 'renders every row of a short list that fits the viewport (safari=%s)',
+ async (safari) => {
+ platform.safari = safari;
+ // The estimated rows fit, so the initial end scroll clamps to zero
+ // without emitting a scroll event.
+ viewportHeight = 1000;
+ const keys = Array.from({ length: 10 }, (_, i) => `row-${i}`);
+ for (const key of keys) rowHeights.set(key, 50);
+ const { container } = render(() => (
+ <ThreadList keys={() => keys}>{({ id }) => <div>{id}</div>}</ThreadList>
+ ));
+ await waitFor(() =>
+ expect(container.querySelectorAll('[data-index]')).toHaveLength(
+ keys.length
+ )
+ );
+ const element = container.querySelector<HTMLDivElement>(
+ '[data-channel-scroll]'
+ )!;
+ expect(element.scrollTop).toBe(0);
+ expect(element.scrollHeight).toBe(element.clientHeight);
+ expect(container.querySelector('[data-index="0"]')?.textContent).toBe(
+ keys[0]
+ );
+ }
+ );
+
+ it('preserves a restored history offset during the initial readback', async () => {
+ platform.safari = false;
+ const keys = Array.from({ length: 20 }, (_, index) => String(index));
+ const onScroll = vi.fn();
+ const { container } = render(() => (
+ <ThreadList
+ keys={() => keys}
+ initialPosition={{
+ type: 'restore',
+ snapshot: { scrollOffset: 700, isNearBottom: false },
+ }}
+ onScroll={onScroll}
+ >
+ {({ id }) => <div>{id}</div>}
+ </ThreadList>
+ ));
+ await waitFor(() =>
+ expect(onScroll).toHaveBeenLastCalledWith(
+ expect.objectContaining({ distanceFromTop: 700, isNearBottom: false }),
+ expect.objectContaining({ scrollOffset: 700 })
+ )
+ );
+ expect(container.querySelector('[data-channel-scroll]')?.scrollTop).toBe(
+ 700
+ );
+ });
+
it('fills a bounded Safari buffer before a gesture and preserves the bottom pin', async () => {
const f = setup();
await waitFor(() => expect(f.paginate).toHaveBeenCalledOnce());
diff --git a/apps/web/src/features/channel/Channel/util.ts b/apps/web/src/features/channel/Channel/util.ts
index be91e5a66c..939236d22c 100644
--- a/apps/web/src/features/channel/Channel/util.ts
+++ b/apps/web/src/features/channel/Channel/util.ts
@@ -1,5 +1,6 @@
import type { DateValue } from '@core/util/date';
import type { MessageTimelineData } from '@queries/messages/timeline';
+import { timelineMessages } from '@queries/messages/timeline-entries';
import type { MessageListItem } from '@service-storage/messages';
/** Minimal shape needed by isNewMessage — satisfied by both MessageListItem and EntityMessage. */
@@ -11,7 +12,7 @@ export function flattenMessages(
if (!data?.pages?.length) return [];
const all: MessageListItem[] = [];
for (let i = data.pages.length - 1; i >= 0; i--) {
- const items = data.pages[i].items;
+ const items = timelineMessages(data.pages[i]);
for (let j = items.length - 1; j >= 0; j--) {
all.push(items[j]);
}
diff --git a/apps/web/src/features/channel/SystemActivity.tsx b/apps/web/src/features/channel/SystemActivity.tsx
new file mode 100644
index 0000000000..cc26d59316
--- /dev/null
+++ b/apps/web/src/features/channel/SystemActivity.tsx
@@ -0,0 +1,23 @@
+import { getDisplayName, tryMacroId } from '@core/user';
+import { getBotDisplayName } from '@queries/messages/message-sender';
+import { SystemActivityRow } from './components/SystemActivityRow';
+import type { SystemActivity as SystemActivityEvent } from './core/system-activity';
+
+function name(id: string): string {
+ return getBotDisplayName(id) || getDisplayName(tryMacroId(id)) || 'Someone';
+}
+
+/** App composition uses the same cached principal names as channel messages. */
+export function SystemActivity(props: { event: SystemActivityEvent }) {
+ const participant = () =>
+ 'participant' in props.event.action
+ ? name(props.event.action.participant)
+ : 'a participant';
+ return (
+ <SystemActivityRow
+ event={props.event}
+ actorName={name(props.event.actorId)}
+ participantName={participant()}
+ />
+ );
+}
diff --git a/apps/web/src/features/channel/components/SystemActivityRow.tsx b/apps/web/src/features/channel/components/SystemActivityRow.tsx
new file mode 100644
index 0000000000..e25ea9678e
--- /dev/null
+++ b/apps/web/src/features/channel/components/SystemActivityRow.tsx
@@ -0,0 +1,81 @@
+import { formatDate, formatEmailDate } from '@core/util/date';
+import ArrowLeftIcon from '@phosphor/arrow-left.svg';
+import ArrowRightIcon from '@phosphor/arrow-right.svg';
+import ImageIcon from '@phosphor/image.svg';
+import PencilIcon from '@phosphor/pencil-simple.svg';
+import PhoneIcon from '@phosphor-fill/phone-fill.svg';
+import { cn, Tooltip } from '@ui';
+import { Show } from 'solid-js';
+import { Dynamic } from 'solid-js/web';
+import {
+ describeSystemActivity,
+ type SystemActivity,
+ systemActivityDescription,
+} from '../core/system-activity';
+
+const ACTIVITY_ICONS = {
+ renamed: PencilIcon,
+ picture_changed: ImageIcon,
+ participant_added: ArrowRightIcon,
+ participant_removed: ArrowLeftIcon,
+ call_ended: PhoneIcon,
+ unknown: PencilIcon,
+} satisfies Record<SystemActivity['action']['kind'], typeof PencilIcon>;
+
+/** One-line system activity; long descriptions truncate with a tooltip. */
+export function SystemActivityRow(props: {
+ event: SystemActivity;
+ actorName: string;
+ participantName: string;
+}) {
+ const description = () =>
+ systemActivityDescription(props.event, props.participantName);
+ const label = () =>
+ `${props.actorName} ${describeSystemActivity(props.event, props.participantName)}`;
+ return (
+ <div
+ class="h-9 flex items-center gap-2 pl-(--message-padding-x) pr-2 text-sm text-ink-muted"
+ data-system-activity={props.event.id}
+ >
+ <span
+ class="w-(--user-icon-width) shrink-0 flex justify-center"
+ aria-hidden="true"
+ >
+ <Dynamic
+ component={ACTIVITY_ICONS[props.event.action.kind]}
+ class={cn(
+ 'size-4.5',
+ (props.event.action.kind === 'call_ended' ||
+ props.event.action.kind === 'participant_added') &&
+ 'text-success'
+ )}
+ />
+ </span>
+ <Tooltip
+ label={label()}
+ class="min-w-0 max-w-max flex-1 truncate"
+ as="span"
+ >
+ <span class="truncate">
+ <span class="font-medium text-ink">{props.actorName}</span>{' '}
+ {description().verb}
+ <Show when={description().subject}>
+ {(subject) => (
+ <>
+ {' '}
+ <span class="font-medium text-ink">{subject()}</span>
+ </>
+ )}
+ </Show>
+ </span>
+ </Tooltip>
+ <time
+ class="shrink-0 text-xs text-ink-extra-muted"
+ dateTime={props.event.occurredAt}
+ title={formatEmailDate(props.event.occurredAt)}
+ >
+ {formatDate(props.event.occurredAt, { showTime: true })}
+ </time>
+ </div>
+ );
+}
diff --git a/apps/web/src/features/channel/core/system-activity.test.ts b/apps/web/src/features/channel/core/system-activity.test.ts
new file mode 100644
index 0000000000..5eaa8c2fca
--- /dev/null
+++ b/apps/web/src/features/channel/core/system-activity.test.ts
@@ -0,0 +1,56 @@
+import { expect, it } from 'vitest';
+import { decodeSystemActivity } from '../queries/system-activity';
+import { callDuration, describeSystemActivity } from './system-activity';
+
+it('describes completed calls, renames, and self membership changes', () => {
+ const event = {
+ id: 'a',
+ actor_id: 'macro|[email protected]',
+ occurred_at: '2026-09-19T12:00:00Z',
+ };
+ expect(
+ describeSystemActivity(
+ decodeSystemActivity({
+ ...event,
+ action: 'call_ended',
+ payload: { duration_ms: 480000 },
+ }),
+ ''
+ )
+ ).toBe('started a call that lasted 8 minutes');
+ expect(
+ describeSystemActivity(
+ decodeSystemActivity({
+ ...event,
+ action: 'renamed',
+ payload: { to: 'Planning' },
+ }),
+ ''
+ )
+ ).toBe('renamed the channel to Planning');
+ expect(
+ describeSystemActivity(
+ decodeSystemActivity({
+ ...event,
+ action: 'participant_added',
+ payload: { participant: event.actor_id },
+ }),
+ 'Teo'
+ )
+ ).toBe('joined the channel');
+});
+
+it('formats durations and tolerates malformed future activity', () => {
+ expect(callDuration(1000)).toBe('1 second');
+ expect(callDuration(3600000)).toBe('1 hour');
+ expect(callDuration(3660000)).toBe('1 hour 1 minute');
+ expect(
+ decodeSystemActivity({
+ id: 'a',
+ actor_id: 'user',
+ occurred_at: '',
+ action: 'future',
+ payload: null,
+ }).action.kind
+ ).toBe('unknown');
+});
diff --git a/apps/web/src/features/channel/core/system-activity.ts b/apps/web/src/features/channel/core/system-activity.ts
new file mode 100644
index 0000000000..8e60c945d3
--- /dev/null
+++ b/apps/web/src/features/channel/core/system-activity.ts
@@ -0,0 +1,62 @@
+import { match } from 'ts-pattern';
+
+export type SystemActivity = {
+ id: string;
+ actorId: string;
+ occurredAt: string;
+ action:
+ | { kind: 'renamed'; name?: string }
+ | { kind: 'picture_changed' }
+ | { kind: 'participant_added'; participant: string }
+ | { kind: 'participant_removed'; participant: string }
+ | { kind: 'call_ended'; durationMs: number }
+ | { kind: 'unknown' };
+};
+
+export function callDuration(durationMs: number): string {
+ const seconds = Math.max(0, Math.floor(durationMs / 1000));
+ if (seconds < 60) return `${seconds} ${seconds === 1 ? 'second' : 'seconds'}`;
+ const minutes = Math.floor(seconds / 60);
+ if (minutes < 60) return `${minutes} ${minutes === 1 ? 'minute' : 'minutes'}`;
+ const hours = Math.floor(minutes / 60);
+ const remainder = minutes % 60;
+ return `${hours} ${hours === 1 ? 'hour' : 'hours'}${remainder ? ` ${remainder} ${remainder === 1 ? 'minute' : 'minutes'}` : ''}`;
+}
+
+export function systemActivityDescription(
+ event: SystemActivity,
+ participantName: string
+): { verb: string; subject?: string } {
+ return match(event.action)
+ .with({ kind: 'renamed' }, ({ name }) =>
+ name
+ ? { verb: 'renamed the channel to', subject: name }
+ : { verb: 'renamed the channel' }
+ )
+ .with({ kind: 'picture_changed' }, () => ({
+ verb: 'updated the channel profile picture',
+ }))
+ .with({ kind: 'participant_added' }, ({ participant }) =>
+ participant === event.actorId
+ ? { verb: 'joined the channel' }
+ : { verb: 'added', subject: participantName }
+ )
+ .with({ kind: 'participant_removed' }, ({ participant }) =>
+ participant === event.actorId
+ ? { verb: 'left the channel' }
+ : { verb: 'removed', subject: participantName }
+ )
+ .with({ kind: 'call_ended' }, ({ durationMs }) => ({
+ verb: `started a call that lasted ${callDuration(durationMs)}`,
+ }))
+ .with({ kind: 'unknown' }, () => ({ verb: 'updated the channel' }))
+ .exhaustive();
+}
+
+export function describeSystemActivity(
+ event: SystemActivity,
+ participantName: string
+): string {
+ const { verb, subject } = systemActivityDescription(event, participantName);
+ return subject ? `${verb} ${subject}` : verb;
+}
diff --git a/apps/web/src/features/channel/queries/system-activity.ts b/apps/web/src/features/channel/queries/system-activity.ts
new file mode 100644
index 0000000000..f4bbb0e811
--- /dev/null
+++ b/apps/web/src/features/channel/queries/system-activity.ts
@@ -0,0 +1,38 @@
+import type { TimelineActivity } from '@service-storage/messages';
+import type { SystemActivity } from '../core/system-activity';
+
+/** Decode the durable vocabulary at the transport boundary, tolerating future actions. */
+export function decodeSystemActivity(event: TimelineActivity): SystemActivity {
+ const payload: unknown = event.payload;
+ const fields = typeof payload === 'object' && payload !== null ? payload : {};
+ let action: SystemActivity['action'] = { kind: 'unknown' };
+ if (event.action === 'picture_changed') action = { kind: 'picture_changed' };
+ if (event.action === 'renamed')
+ action = {
+ kind: 'renamed',
+ name:
+ 'to' in fields && typeof fields.to === 'string' ? fields.to : undefined,
+ };
+ if (
+ (event.action === 'participant_added' ||
+ event.action === 'participant_removed') &&
+ 'participant' in fields &&
+ typeof fields.participant === 'string'
+ ) {
+ action = { kind: event.action, participant: fields.participant };
+ }
+ if (
+ event.action === 'call_ended' &&
+ 'duration_ms' in fields &&
+ typeof fields.duration_ms === 'number' &&
+ Number.isFinite(fields.duration_ms)
+ ) {
+ action = { kind: 'call_ended', durationMs: fields.duration_ms };
+ }
+ return {
+ id: event.id,
+ actorId: event.actor_id,
+ occurredAt: event.occurred_at,
+ action,
+ };
+}
diff --git a/apps/web/src/features/projects/project-collaboration.test.tsx b/apps/web/src/features/projects/project-collaboration.test.tsx
index 510a3ef903..d5e4b2cea7 100644
--- a/apps/web/src/features/projects/project-collaboration.test.tsx
+++ b/apps/web/src/features/projects/project-collaboration.test.tsx
@@ -94,7 +94,10 @@ function setup(targetId?: string) {
data: {
pages: [
{
- items: [message(newId, 'New comment'), message(oldId, 'Old comment')],
+ entries: [
+ { type: 'message', message: message(newId, 'New comment') },
+ { type: 'message', message: message(oldId, 'Old comment') },
+ ],
},
],
},
diff --git a/apps/web/src/lib/core/comments/discussion/Discussion.tsx b/apps/web/src/lib/core/comments/discussion/Discussion.tsx
index 10c0be3b86..91516bc5ff 100644
--- a/apps/web/src/lib/core/comments/discussion/Discussion.tsx
+++ b/apps/web/src/lib/core/comments/discussion/Discussion.tsx
@@ -106,16 +106,14 @@ export function Discussion(props: {
});
const rootMetaById = createMemo(() => {
- const messages = source.threads().flatMap((thread) => {
+ const entries = source.threads().flatMap((thread) => {
const root = thread.comments[0];
if (!root) return [];
const message = discussionCommentToChannelMessage(root);
message.thread.reply_count = thread.comments.length - 1;
- return [message];
+ return [{ type: 'message' as const, message }];
});
- const metaById = buildChannelMessageListMeta(messages, () => false, true);
-
- return metaById;
+ return buildChannelMessageListMeta(entries, () => false, true);
});
return (
diff --git a/apps/web/src/lib/core/messages/EntityConversation.test.tsx b/apps/web/src/lib/core/messages/EntityConversation.test.tsx
index d4fef253e6..66845d0f5d 100644
--- a/apps/web/src/lib/core/messages/EntityConversation.test.tsx
+++ b/apps/web/src/lib/core/messages/EntityConversation.test.tsx
@@ -1,5 +1,8 @@
import { ThrownResultError } from '@core/util/result';
-import type { MessageListItem } from '@service-storage/messages';
+import type {
+ MessageListItem,
+ MessageTimelinePage,
+} from '@service-storage/messages';
import { cleanup, fireEvent, render } from '@solidjs/testing-library';
import { type Accessor, createSignal, For, type ParentProps } from 'solid-js';
import { afterEach, describe, expect, it, vi } from 'vitest';
@@ -125,7 +128,18 @@ describe('EntityDiscussion target ownership', () => {
mocks.linkResolved = false;
mocks.timeline.mockReturnValue({
isSuccess: true,
- data: { pages: [{ items: [thread('Latest workbook topic', null)] }] },
+ data: {
+ pages: [
+ {
+ entries: [
+ {
+ type: 'message',
+ message: thread('Latest workbook topic', null),
+ },
+ ],
+ },
+ ],
+ },
});
const view = render(() => (
<EntityDiscussion
@@ -151,7 +165,18 @@ describe('EntityDiscussion target ownership', () => {
mocks.urlTarget = 'workbook-reply';
mocks.timeline.mockReturnValue({
isSuccess: true,
- data: { pages: [{ items: [thread('root-of-workbook-reply', null)] }] },
+ data: {
+ pages: [
+ {
+ entries: [
+ {
+ type: 'message',
+ message: thread('root-of-workbook-reply', null),
+ },
+ ],
+ },
+ ],
+ },
});
const view = render(() => (
<EntityDiscussion
@@ -186,7 +211,15 @@ function discussion(
mocks.timeline.mockReturnValue({
isSuccess: true,
get data() {
- return { pages: pages().map((items) => ({ items })) };
+ return {
+ pages: pages().map(
+ (messages): MessageTimelinePage => ({
+ entries: messages.map((message) => ({ type: 'message', message })),
+ next_cursor: null,
+ previous_cursor: null,
+ })
+ ),
+ };
},
});
return {
@@ -343,7 +376,15 @@ describe('EntityConversation linked message highlight', () => {
const [cleared, setCleared] = createSignal(false);
mocks.timeline.mockReturnValue({
isSuccess: true,
- data: { pages: [{ items: [thread('root-of-reply', null)] }] },
+ data: {
+ pages: [
+ {
+ entries: [
+ { type: 'message', message: thread('root-of-reply', null) },
+ ],
+ },
+ ],
+ },
});
const view = render(() => (
<EntityConversation
@@ -378,7 +419,15 @@ it('retains loaded comments on a pagination failure and removes them immediately
get isFetching() {
return fetching();
},
- data: { pages: [{ items: [thread('Known discussion', null)] }] },
+ data: {
+ pages: [
+ {
+ entries: [
+ { type: 'message', message: thread('Known discussion', null) },
+ ],
+ },
+ ],
+ },
hasNextPage: true,
fetchNextPage: loadMore,
});
@@ -416,7 +465,15 @@ it('hides cached comments when a linked message denies access and retries the li
const refetch = vi.fn();
mocks.timeline.mockReturnValue({
isPending: false,
- data: { pages: [{ items: [thread('Cached discussion', null)] }] },
+ data: {
+ pages: [
+ {
+ entries: [
+ { type: 'message', message: thread('Cached discussion', null) },
+ ],
+ },
+ ],
+ },
refetch,
});
const view = render(() => (
diff --git a/apps/web/src/lib/core/messages/EntityConversation.tsx b/apps/web/src/lib/core/messages/EntityConversation.tsx
index b24a937b6d..90912d64b6 100644
--- a/apps/web/src/lib/core/messages/EntityConversation.tsx
+++ b/apps/web/src/lib/core/messages/EntityConversation.tsx
@@ -12,6 +12,7 @@ import {
useSendMessageMutation,
} from '@queries/messages/mutations';
import { useMessageTimelineQuery } from '@queries/messages/timeline';
+import { timelineMessages } from '@queries/messages/timeline-entries';
import type { MessageParent } from '@service-storage/messages';
import { createMemo, createSignal, For, Show } from 'solid-js';
import { MessageThread } from './MessageThread';
@@ -90,7 +91,7 @@ export function EntityConversation(props: {
const messages = () =>
target.resolved() && !query.isPending && !unavailable()
? (query.data?.pages
- .flatMap((page) => page.items)
+ .flatMap(timelineMessages)
// Only known unanchored roots belong in Discussion. Live roots have
// undefined anchors until their thread metadata is fetched.
.filter(
diff --git a/apps/web/src/lib/core/util/message-timeline.test.ts b/apps/web/src/lib/core/util/message-timeline.test.ts
new file mode 100644
index 0000000000..0524058e4b
--- /dev/null
+++ b/apps/web/src/lib/core/util/message-timeline.test.ts
@@ -0,0 +1,19 @@
+import { describe, expect, it } from 'vitest';
+import { compareTimelinePositions } from './message-timeline';
+
+describe('timeline positions', () => {
+ it('uses microseconds before UUIDs and handles equivalent date representations', () => {
+ expect(
+ compareTimelinePositions(
+ { id: 'z', createdAt: '2026-09-19T12:00:00.000001Z' },
+ { id: 'a', createdAt: '2026-09-19T12:00:00.000002Z' }
+ )
+ ).toBeLessThan(0);
+ expect(
+ compareTimelinePositions(
+ { id: 'a', createdAt: '2026-09-19T12:00:00Z' },
+ { id: 'a', createdAt: '2026-09-19T12:00:00.000+00:00' }
+ )
+ ).toBe(0);
+ });
+});
diff --git a/apps/web/src/lib/core/util/message-timeline.ts b/apps/web/src/lib/core/util/message-timeline.ts
new file mode 100644
index 0000000000..727357c297
--- /dev/null
+++ b/apps/web/src/lib/core/util/message-timeline.ts
@@ -0,0 +1,17 @@
+/** A stable chronological key shared by message and activity sources. */
+export type TimelinePosition = { id: string; createdAt: string };
+
+// Preserve the server's microseconds; Date.parse alone loses keyset precision.
+function timestamp(value: string): number {
+ const fraction = /\.(\d+)/.exec(value)?.[1] ?? '';
+ return Date.parse(value) * 1000 + Number(fraction.padEnd(6, '0').slice(3, 6));
+}
+
+export function compareTimelinePositions(
+ a: TimelinePosition,
+ b: TimelinePosition
+): number {
+ return (
+ timestamp(a.createdAt) - timestamp(b.createdAt) || a.id.localeCompare(b.id)
+ );
+}
diff --git a/apps/web/src/lib/queries/channel/picture.ts b/apps/web/src/lib/queries/channel/picture.ts
index 476fcf2496..fe53c10fb7 100644
--- a/apps/web/src/lib/queries/channel/picture.ts
+++ b/apps/web/src/lib/queries/channel/picture.ts
@@ -23,8 +23,8 @@ export function handleChannelPictureChanged(payload: { channel_id: string }) {
}
async function waitForPictureUpload(fileId: string) {
- // S3 completion is recorded asynchronously by the static-file service.
- const maxAttempts = 30;
+ // Allow the static-file consumer's 20-second queue retry plus processing time.
+ const maxAttempts = 90;
for (let attempt = 0; attempt < maxAttempts; attempt++) {
const metadata = await throwOnErr(() =>
staticFileClient.getMetadata({ file_id: fileId })
diff --git a/apps/web/src/lib/queries/channel/tests/picture.test.tsx b/apps/web/src/lib/queries/channel/tests/picture.test.tsx
index 4ea7e48013..d48e428d33 100644
--- a/apps/web/src/lib/queries/channel/tests/picture.test.tsx
+++ b/apps/web/src/lib/queries/channel/tests/picture.test.tsx
@@ -170,6 +170,35 @@ it('waits for asynchronous upload confirmation before assigning the picture', as
expect(storageServiceClient.setChannelPicture).toHaveBeenCalledTimes(1);
});
+it('waits through a full queue retry before saving the uploaded picture', async () => {
+ vi.useFakeTimers();
+ let uploaded = false;
+ vi.mocked(staticFileClient.getMetadata).mockImplementation(async () =>
+ ok({
+ file_id: 'new-picture',
+ owner_id: 'owner',
+ content_type: 'image/png',
+ is_uploaded: uploaded,
+ file_name: 'picture.png',
+ s3_key: 'file/new-picture',
+ })
+ );
+ vi.mocked(storageServiceClient.setChannelPicture).mockResolvedValue(
+ ok(undefined)
+ );
+ const mutation = setup(vi.fn().mockResolvedValue('new-picture'));
+ const pending = mutation.mutateAsync({
+ channelId: 'channel',
+ file: new File(['image'], 'picture.png'),
+ });
+ await vi.advanceTimersByTimeAsync(20_000);
+ expect(storageServiceClient.setChannelPicture).not.toHaveBeenCalled();
+ uploaded = true;
+ await vi.advanceTimersByTimeAsync(500);
+ await pending;
+ expect(storageServiceClient.setChannelPicture).toHaveBeenCalledTimes(1);
+});
+
it('preserves the existing picture if upload confirmation fails', async () => {
client.setQueryData(channelKeys.picture('channel').queryKey, 'old-picture');
vi.mocked(staticFileClient.getMetadata).mockRejectedValue(
diff --git a/apps/web/src/lib/queries/messages/document-messages.ts b/apps/web/src/lib/queries/messages/document-messages.ts
index 08f334bd25..0b3ce95922 100644
--- a/apps/web/src/lib/queries/messages/document-messages.ts
+++ b/apps/web/src/lib/queries/messages/document-messages.ts
@@ -17,6 +17,7 @@ import {
} from './mutations';
import { fetchMessageThread } from './thread-replies';
import { useMessageTimelineQuery } from './timeline';
+import { timelineMessages } from './timeline-entries';
/** Positioning annotations needs every root, but never fetches every root's replies. */
export function useMessageRootsQuery(parent: Accessor<MessageParent>) {
@@ -32,9 +33,7 @@ export function useMessageRootsQuery(parent: Accessor<MessageParent>) {
});
return {
get data() {
- return query.isSuccess
- ? query.data.pages.flatMap((page) => page.items)
- : [];
+ return query.isSuccess ? query.data.pages.flatMap(timelineMessages) : [];
},
get isSuccess() {
return query.isSuccess;
diff --git a/apps/web/src/lib/queries/messages/message-sender.ts b/apps/web/src/lib/queries/messages/message-sender.ts
index 70b3adbb52..1416b1f6f7 100644
--- a/apps/web/src/lib/queries/messages/message-sender.ts
+++ b/apps/web/src/lib/queries/messages/message-sender.ts
@@ -104,13 +104,15 @@ export function normalizeChannelMessageSender(
}
export function normalizeMessageTimelinePageSenders(
- page: Omit<MessageTimelinePage, 'items'> & {
- items: ChannelMessageWithMaybeSender[];
- }
+ page: MessageTimelinePage
): MessageTimelinePage {
return {
...page,
- items: page.items.map(normalizeChannelMessageSender),
+ entries: page.entries.map((entry) =>
+ entry.type === 'message'
+ ? { ...entry, message: normalizeChannelMessageSender(entry.message) }
+ : entry
+ ),
};
}
diff --git a/apps/web/src/lib/queries/messages/reconcile.ts b/apps/web/src/lib/queries/messages/reconcile.ts
index 33f4413005..1f25ce8922 100644
--- a/apps/web/src/lib/queries/messages/reconcile.ts
+++ b/apps/web/src/lib/queries/messages/reconcile.ts
@@ -24,6 +24,7 @@ import {
findTopLevelMessageSnapshotInMessageTimeline,
insertThreadReplyIntoMessageTimeline,
insertTopLevelMessageIntoMessageTimeline,
+ mapMessageTimelineItems,
removeThreadReplyFromMessageTimeline,
removeTopLevelMessageFromMessageTimeline,
restoreThreadPreviewReplyInMessageTimeline,
@@ -314,23 +315,18 @@ export function patchTargetMessage(
setMessageTimelineData(
parent,
(data) =>
- data && {
- ...data,
- pages: data.pages.map((page) => ({
- ...page,
- items: page.items.map((root) =>
- root.id !== rootId
- ? root
- : {
- ...update(root),
- thread: {
- ...root.thread,
- preview: root.thread.preview.map(update),
- },
- }
- ),
- })),
- }
+ data &&
+ mapMessageTimelineItems(data, (root) =>
+ root.id !== rootId
+ ? root
+ : {
+ ...update(root),
+ thread: {
+ ...root.thread,
+ preview: root.thread.preview.map(update),
+ },
+ }
+ )
);
queryClient.setQueryData<MessageThread>(
getThreadRepliesQueryKey(parent, rootId),
diff --git a/apps/web/src/lib/queries/messages/sync.ts b/apps/web/src/lib/queries/messages/sync.ts
index 34112b38a9..d0ebfd4c6f 100644
--- a/apps/web/src/lib/queries/messages/sync.ts
+++ b/apps/web/src/lib/queries/messages/sync.ts
@@ -4,6 +4,7 @@ import type {
MessageListItem,
MessageParent,
MessageThread,
+ TimelineActivity,
} from '@service-storage/messages';
import { queryClient } from '../client';
import { consumeNonce } from '../nonce';
@@ -23,11 +24,27 @@ import { fetchMessageThread, getThreadRepliesQueryKey } from './thread-replies';
import {
getMessageTimelineQueryKey,
getMessageTimelineQueryKeyPrefix,
+ insertActivitiesIntoMessageTimeline,
type MessageTimelineData,
setMessageTimelineData,
} from './timeline';
import { handleCommsTyping } from './typing';
+/** Committed timeline activity, delivered whole so loaded history needs no re-read. */
+export function handleTimelineActivity(event: {
+ parent: MessageParent;
+ activities: TimelineActivity[];
+}) {
+ // A fact committed before the bottom page's first fetch resolved may be
+ // missing from a response the server already computed. Loaded windows still
+ // take it below.
+ refetchTimelineAwaitingFirstPage(event.parent);
+ queryClient.setQueriesData<MessageTimelineData>(
+ { queryKey: getMessageTimelineQueryKeyPrefix(event.parent) },
+ (data) => insertActivitiesIntoMessageTimeline(data, event.activities)
+ );
+}
+
type ThreadStateListener = (
parent: MessageParent,
state: MessageThread['state']
@@ -259,14 +276,19 @@ export function applyThreadState(
...data,
pages: data.pages.map((page) => ({
...page,
- items: page.items
+ entries: page.entries
.filter(
(item) =>
+ item.type !== 'message' ||
parent.type === 'document' ||
!state.deleted_at ||
- item.id !== state.root_id
+ item.message.id !== state.root_id
)
- .map(update),
+ .map((entry) =>
+ entry.type === 'message'
+ ? { ...entry, message: update(entry.message) }
+ : entry
+ ),
})),
}
);
diff --git a/apps/web/src/lib/queries/messages/tests/mutations.test.tsx b/apps/web/src/lib/queries/messages/tests/mutations.test.tsx
index ee7a76eab6..7c8994c3d6 100644
--- a/apps/web/src/lib/queries/messages/tests/mutations.test.tsx
+++ b/apps/web/src/lib/queries/messages/tests/mutations.test.tsx
@@ -42,6 +42,7 @@ import {
type MessageTimelineData,
useMessageTimelineQuery,
} from '../timeline';
+import { timelineMessages } from '../timeline-entries';
const time = '2026-09-09T00:00:00Z';
function message(
@@ -95,7 +96,13 @@ it('reopens a resolved project discussion through the real mutation and shared t
const threadKey = getThreadRepliesQueryKey(parent, 'root');
testQueryClient.setQueryData<MessageTimelineData>(timelineKey, {
pageParams: [null],
- pages: [{ items: [root], next_cursor: null, previous_cursor: null }],
+ pages: [
+ {
+ entries: [{ type: 'message', message: root }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
});
testQueryClient.setQueryData<MessageThread>(threadKey, {
root,
@@ -113,7 +120,9 @@ it('reopens a resolved project discussion through the real mutation and shared t
() => null
);
const mutation = usePatchThreadMutation();
- const resolved = () => timeline.data?.pages[0].items[0].state.resolved;
+ const resolved = () =>
+ timeline.data &&
+ timelineMessages(timeline.data.pages[0])[0].state.resolved;
return (
<>
<span>{resolved() ? 'Resolved' : 'Open'}</span>
@@ -151,8 +160,9 @@ it('reopens a resolved project discussion through the real mutation and shared t
testQueryClient.getQueryData<MessageThread>(threadKey)?.state.resolved
).toBe(false);
expect(
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey)?.pages[0]
- .items[0].state.resolved
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!.pages[0]
+ )[0].state.resolved
).toBe(false);
});
@@ -187,7 +197,13 @@ describe.each(['channel', 'document', 'call'] as const)(
const threadKey = getThreadRepliesQueryKey(parent, 'root');
testQueryClient.setQueryData<MessageTimelineData>(timelineKey, {
pageParams: [null],
- pages: [{ items: [root], next_cursor: null, previous_cursor: null }],
+ pages: [
+ {
+ entries: [{ type: 'message', message: root }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
});
testQueryClient.setQueryData(selectedKey, [root]);
testQueryClient.setQueryData<MessageThread>(threadKey, {
@@ -227,8 +243,10 @@ describe.each(['channel', 'document', 'call'] as const)(
if (echoTiming === 'after response') echo();
expect(
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!
- .pages[0].items[0].thread.reply_count
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!
+ .pages[0]
+ )[0].thread.reply_count
).toBe(1);
expect(
testQueryClient.getQueryData<MessageListItem[]>(selectedKey)![0]
@@ -269,7 +287,13 @@ describe('root deletion', () => {
getMessageTimelineQueryKey(parent),
{
pageParams: [null],
- pages: [{ items: [root], next_cursor: null, previous_cursor: null }],
+ pages: [
+ {
+ entries: [{ type: 'message', message: root }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
}
);
if (withThreadCache)
@@ -297,7 +321,7 @@ describe('root deletion', () => {
const roots = (parent: MessageParent) =>
testQueryClient
.getQueryData<MessageTimelineData>(getMessageTimelineQueryKey(parent))!
- .pages.flatMap((page) => page.items);
+ .pages.flatMap(timelineMessages);
it.each(['document', 'initiative', 'crm_company', 'crm_contact'] as const)(
"takes the whole %s discussion, including another author's replies",
@@ -404,13 +428,16 @@ describe('root deletion', () => {
pageParams: [null],
pages: [
{
- items: [
+ entries: [
{
- ...root,
- thread: {
- reply_count: 0,
- preview: [],
- latest_reply_at: null,
+ type: 'message',
+ message: {
+ ...root,
+ thread: {
+ reply_count: 0,
+ preview: [],
+ latest_reply_at: null,
+ },
},
},
],
@@ -453,9 +480,9 @@ describe('thread resolution', () => {
const timelineKey = getMessageTimelineQueryKey(parent);
const threadKey = getThreadRepliesQueryKey(parent, 'root');
const cachedResolved = () => ({
- timeline:
+ timeline: timelineMessages(
testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!.pages[0]
- .items[0].state.resolved,
+ )[0].state.resolved,
thread:
testQueryClient.getQueryData<MessageThread>(threadKey)!.state.resolved,
});
@@ -468,7 +495,13 @@ describe('thread resolution', () => {
};
testQueryClient.setQueryData<MessageTimelineData>(timelineKey, {
pageParams: [null],
- pages: [{ items: [root], next_cursor: null, previous_cursor: null }],
+ pages: [
+ {
+ entries: [{ type: 'message', message: root }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
});
testQueryClient.setQueryData<MessageThread>(threadKey, {
state,
@@ -547,7 +580,7 @@ describe('sending', () => {
const threadKey = getThreadRepliesQueryKey(parent, parent.id);
testQueryClient.setQueryData<MessageTimelineData>(timelineKey, {
pageParams: [null],
- pages: [{ items: [], next_cursor: null, previous_cursor: null }],
+ pages: [{ entries: [], next_cursor: null, previous_cursor: null }],
});
testQueryClient.setQueryData(threadKey, null);
mocks.post.mockResolvedValue(message(parent, parent.id));
@@ -559,9 +592,9 @@ describe('sending', () => {
optimisticId: newMessageId(),
});
- const roots =
+ const roots = timelineMessages(
testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!.pages[0]
- .items;
+ );
expect(roots.map((root) => [root.id, root.thread_id])).toEqual([
['call-id', undefined],
]);
@@ -587,11 +620,14 @@ describe('sending', () => {
pageParams: [null],
pages: [
{
- items: [
+ entries: [
{
- ...root,
- state,
- thread: { reply_count: 0, preview: [], latest_reply_at: null },
+ type: 'message',
+ message: {
+ ...root,
+ state,
+ thread: { reply_count: 0, preview: [], latest_reply_at: null },
+ },
},
],
next_cursor: null,
@@ -614,9 +650,9 @@ describe('sending', () => {
optimisticId: replyId,
});
- const roots =
+ const roots = timelineMessages(
testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!.pages[0]
- .items;
+ );
expect(roots.map((item) => item.id)).toEqual([root.id]);
expect(roots[0].thread.reply_count).toBe(1);
const thread = testQueryClient.getQueryData<MessageThread>(threadKey)!;
@@ -639,12 +675,13 @@ describe('sending', () => {
const timelineKey = getMessageTimelineQueryKey(parent);
testQueryClient.setQueryData<MessageTimelineData>(timelineKey, {
pageParams: [null],
- pages: [{ items: [], next_cursor: null, previous_cursor: null }],
+ pages: [{ entries: [], next_cursor: null, previous_cursor: null }],
});
const rootIds = () =>
testQueryClient
.getQueryData<MessageTimelineData>(timelineKey)!
- .pages[0].items.map((item) => [item.id, item.state.root_id]);
+ .pages.flatMap(timelineMessages)
+ .map((item) => [item.id, item.state.root_id]);
let respond!: () => void;
mocks.post.mockImplementation(
(_parent, input) =>
@@ -680,8 +717,9 @@ describe('sending', () => {
await pending;
expect(rootIds()).toEqual([[id, id]]);
expect(
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!.pages[0]
- .items[0].state.anchor
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey)!.pages[0]
+ )[0].state.anchor
).toEqual(anchor ?? null);
});
@@ -690,7 +728,7 @@ describe('sending', () => {
const timelineKey = getMessageTimelineQueryKey(parent);
testQueryClient.setQueryData<MessageTimelineData>(timelineKey, {
pageParams: [null],
- pages: [{ items: [], next_cursor: null, previous_cursor: null }],
+ pages: [{ entries: [], next_cursor: null, previous_cursor: null }],
});
mocks.post.mockResolvedValue(message(parent, 'server-id'));
let mutation!: ReturnType<typeof useSendMessageMutation>;
@@ -715,7 +753,8 @@ describe('sending', () => {
expect(
testQueryClient
.getQueryData<MessageTimelineData>(timelineKey)!
- .pages[0].items.map((item) => [item.id, item.state])
+ .pages.flatMap(timelineMessages)
+ .map((item) => [item.id, item.state])
).toEqual([
[
'server-id',
diff --git a/apps/web/src/lib/queries/messages/tests/optimistic.test.ts b/apps/web/src/lib/queries/messages/tests/optimistic.test.ts
index 2eeb42a9b3..d67687b23b 100644
--- a/apps/web/src/lib/queries/messages/tests/optimistic.test.ts
+++ b/apps/web/src/lib/queries/messages/tests/optimistic.test.ts
@@ -117,7 +117,7 @@ function createMessageTimelineData(
): MessageTimelineData {
return {
pages: pages.map((items, index) => ({
- items,
+ entries: items.map((message) => ({ type: 'message' as const, message })),
next_cursor:
index === pages.length - 1
? null
@@ -209,9 +209,11 @@ describe('channel optimistic cache regressions', () => {
mentions: [],
});
- expect(getMessageTimelineFromCache('channel-1')?.pages[0].items[0].id).toBe(
- 'optimistic-top-level'
- );
+ expect(
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].id
+ ).toBe('optimistic-top-level');
if (context) {
rollbackInsertChannelMessage(
@@ -220,9 +222,11 @@ describe('channel optimistic cache regressions', () => {
);
}
- expect(getMessageTimelineFromCache('channel-1')?.pages[0].items).toEqual([
- expect.objectContaining({ id: 'existing-msg' }),
- ]);
+ expect(
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )
+ ).toEqual([expect.objectContaining({ id: 'existing-msg' })]);
});
it('keeps local media metadata on optimistic top-level inserts', () => {
@@ -261,7 +265,9 @@ describe('channel optimistic cache regressions', () => {
});
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].attachments[0]
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].attachments[0]
).toEqual(
expect.objectContaining({
entity_id: 'static-file-1',
@@ -305,7 +311,9 @@ describe('channel optimistic cache regressions', () => {
expect(getThreadRepliesFromCache('channel-1', 'parent-msg-id')).toEqual([]);
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].thread.preview
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].thread.preview
).toEqual([]);
});
@@ -347,8 +355,9 @@ describe('channel optimistic cache regressions', () => {
getThreadRepliesFromCache('channel-1', 'parent-1')?.[0].reactions
).toEqual([]);
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].thread
- .preview[0].reactions
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].thread.preview[0].reactions
).toEqual([]);
});
@@ -394,8 +403,9 @@ describe('channel optimistic cache regressions', () => {
getThreadRepliesFromCache('channel-1', 'parent-1')?.[0].reactions
).toEqual([{ emoji: '👍', users: ['user-1'] }]);
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].thread
- .preview[0].reactions
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].thread.preview[0].reactions
).toEqual([{ emoji: '👍', users: ['user-1'] }]);
});
@@ -426,7 +436,11 @@ describe('channel optimistic cache regressions', () => {
attachment_ids_to_delete: ['attachment-1'],
});
- expect(getMessageTimelineFromCache('channel-1')?.pages[0].items[0]).toEqual(
+ expect(
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0]
+ ).toEqual(
expect.objectContaining({
content: 'Edited body',
attachments: [],
@@ -437,7 +451,11 @@ describe('channel optimistic cache regressions', () => {
rollbackUpdateMessage({ type: 'channel', id: 'channel-1' }, context);
}
- expect(getMessageTimelineFromCache('channel-1')?.pages[0].items[0]).toEqual(
+ expect(
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0]
+ ).toEqual(
expect.objectContaining({
content: 'Original body',
attachments: [
@@ -505,8 +523,9 @@ describe('channel optimistic cache regressions', () => {
})
);
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].thread
- .preview[0]
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].thread.preview[0]
).toEqual(
expect.objectContaining({
content: 'Edited reply',
@@ -530,8 +549,9 @@ describe('channel optimistic cache regressions', () => {
})
);
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].thread
- .preview[0]
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].thread.preview[0]
).toEqual(
expect.objectContaining({
content: 'Original reply',
@@ -573,7 +593,11 @@ describe('channel optimistic cache regressions', () => {
message_id: 'parent-1',
});
- const message = getMessageTimelineFromCache('channel-1')?.pages[0].items[0];
+ const message = getMessageTimelineFromCache(
+ 'channel-1'
+ )?.pages[0].entries.flatMap((entry) =>
+ entry.type === 'message' ? [entry.message] : []
+ )[0];
expect(message?.id).toBe('parent-1');
expect(message?.deleted_at).toBeTruthy();
expect(message?.thread.preview).toHaveLength(2);
@@ -583,8 +607,11 @@ describe('channel optimistic cache regressions', () => {
rollbackDeleteMessage({ type: 'channel', id: 'channel-1' }, context);
}
- const restored =
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0];
+ const restored = getMessageTimelineFromCache(
+ 'channel-1'
+ )?.pages[0].entries.flatMap((entry) =>
+ entry.type === 'message' ? [entry.message] : []
+ )[0];
expect(restored?.id).toBe('parent-1');
expect(restored?.deleted_at).toBeFalsy();
expect(restored?.thread.preview).toHaveLength(2);
@@ -607,7 +634,9 @@ describe('channel optimistic cache regressions', () => {
});
const itemsAfter =
- getMessageTimelineFromCache('channel-1')?.pages[0].items ?? [];
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ ) ?? [];
expect(itemsAfter.map((item) => item.id)).toEqual(['parent-2']);
if (context) {
@@ -615,12 +644,16 @@ describe('channel optimistic cache regressions', () => {
}
const itemsRolledBack =
- getMessageTimelineFromCache('channel-1')?.pages[0].items ?? [];
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ ) ?? [];
expect(itemsRolledBack.map((item) => item.id)).toEqual([
- 'parent-1',
'parent-2',
+ 'parent-1',
]);
- expect(itemsRolledBack[0].deleted_at).toBeFalsy();
+ expect(
+ itemsRolledBack.find((item) => item.id === 'parent-1')?.deleted_at
+ ).toBeFalsy();
});
it('removes thread replies from caches on optimistic delete and restores them on rollback', () => {
@@ -652,7 +685,9 @@ describe('channel optimistic cache regressions', () => {
expect(getThreadRepliesFromCache('channel-1', 'parent-1')).toEqual([]);
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].thread.preview
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].thread.preview
).toEqual([]);
if (context) {
@@ -663,7 +698,9 @@ describe('channel optimistic cache regressions', () => {
expect.objectContaining({ id: 'reply-1' }),
]);
expect(
- getMessageTimelineFromCache('channel-1')?.pages[0].items[0].thread.preview
+ getMessageTimelineFromCache('channel-1')?.pages[0].entries.flatMap(
+ (entry) => (entry.type === 'message' ? [entry.message] : [])
+ )[0].thread.preview
).toEqual([expect.objectContaining({ id: 'reply-1' })]);
});
@@ -806,17 +843,26 @@ it('removes an empty project discussion root and restores it on failed deletion'
};
const key = messageKeys.messages(parent, null).queryKey;
testQueryClient.setQueryData<MessageTimelineData>(key, {
- pages: [{ items: [root], next_cursor: null, previous_cursor: null }],
+ pages: [
+ {
+ entries: [{ type: 'message', message: root }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
pageParams: [null],
});
const context = optimisticDeleteMessage({ parent, message_id: 'root' });
expect(
- testQueryClient.getQueryData<MessageTimelineData>(key)?.pages[0].items
+ testQueryClient.getQueryData<MessageTimelineData>(key)?.pages[0].entries
).toEqual([]);
expect(context).toBeDefined();
rollbackDeleteMessage(parent, context!);
expect(
- testQueryClient.getQueryData<MessageTimelineData>(key)?.pages[0].items[0]
- .deleted_at
+ testQueryClient
+ .getQueryData<MessageTimelineData>(key)
+ ?.pages[0].entries.flatMap((entry) =>
+ entry.type === 'message' ? [entry.message] : []
+ )[0].deleted_at
).toBeFalsy();
});
diff --git a/apps/web/src/lib/queries/messages/tests/sync.test.ts b/apps/web/src/lib/queries/messages/tests/sync.test.ts
index 6305977ef1..33fd8c6d57 100644
--- a/apps/web/src/lib/queries/messages/tests/sync.test.ts
+++ b/apps/web/src/lib/queries/messages/tests/sync.test.ts
@@ -27,7 +27,12 @@ vi.mock('@service-storage/messages', async (importOriginal) => ({
import { registerNonce } from '../../nonce';
import { MessageNonceKeys, messageKeys } from '../keys';
-import { applyMessage, applyThreadState, handleMessageEvent } from '../sync';
+import {
+ applyMessage,
+ applyThreadState,
+ handleMessageEvent,
+ handleTimelineActivity,
+} from '../sync';
import {
getThreadRepliesQueryKey,
threadRepliesQueryOptions,
@@ -36,6 +41,7 @@ import {
getMessageTimelineQueryKey,
type MessageTimelineData,
} from '../timeline';
+import { timelineMessages } from '../timeline-entries';
import { clearTypingIndicators, getTypingUsers } from '../typing';
const time = '2026-09-09T00:00:00Z';
@@ -140,7 +146,11 @@ describe.each([
testQueryClient.setQueryData<MessageTimelineData>(timelineKey(), {
pageParams: [null],
pages: [
- { items: [item(parent)], next_cursor: null, previous_cursor: null },
+ {
+ entries: [{ type: 'message', message: item(parent) }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
],
});
testQueryClient.setQueryData<MessageListItem[]>(
@@ -178,9 +188,9 @@ describe.each([
reactions: [{ emoji: '👍', users: ['macro|[email protected]'] }],
};
applyMessage(edit, 'edited');
- const root = testQueryClient.getQueryData<MessageTimelineData>(
- timelineKey()
- )!.pages[0].items[0];
+ const root = timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!.pages[0]
+ )[0];
expect(root.thread.reply_count).toBe(1);
expect(root.thread.preview).toEqual([expect.objectContaining(edit)]);
expect(
@@ -234,7 +244,13 @@ describe.each([
};
testQueryClient.setQueryData<MessageTimelineData>(timelineKey(), {
pageParams: [null],
- pages: [{ items: [root], next_cursor: null, previous_cursor: null }],
+ pages: [
+ {
+ entries: [{ type: 'message', message: root }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
});
testQueryClient.setQueryData<MessageListItem[]>(
messageKeys.messagesByIds(parent, ['root']).queryKey,
@@ -256,8 +272,10 @@ describe.each([
});
expect(
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!.pages[0]
- .items[0].thread
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
+ .pages[0]
+ )[0].thread
).toEqual(root.thread);
expect(
testQueryClient.getQueryData<MessageListItem[]>(
@@ -293,8 +311,10 @@ describe.each([
}),
]);
expect(
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!.pages[0]
- .items[0].thread.reply_count
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
+ .pages[0]
+ )[0].thread.reply_count
).toBe(1);
});
it('updates the canonical root when only a linked thread is cached', () => {
@@ -331,8 +351,10 @@ describe.each([
'message_deleted'
);
expect(
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!.pages[0]
- .items[0].deleted_at
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
+ .pages[0]
+ )[0].deleted_at
).toBe(time);
expect(
testQueryClient.getQueryData<MessageThread>(threadKey())!.replies
@@ -343,8 +365,10 @@ describe.each([
).toBe(true);
applyThreadState(parent, { ...state, deleted_at: time });
expect(
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!.pages[0]
- .items
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
+ .pages[0]
+ )
).toEqual(
parent.type === 'document'
? [expect.objectContaining({ state: { ...state, deleted_at: time } })]
@@ -359,22 +383,26 @@ describe.each([
nonce: null,
change: {
type: 'posted',
- message: message(parent, 'newer-root'),
+ message: {
+ ...message(parent, 'newer-root'),
+ created_at: '2026-09-09T00:00:01Z',
+ },
mentions: [],
notification_policy: 'Default',
},
});
expect(
- testQueryClient
- .getQueryData<MessageTimelineData>(timelineKey())!
- .pages[0].items.map((root) => root.id)
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
+ .pages[0]
+ ).map((root) => root.id)
).toEqual(['newer-root', 'root']);
testQueryClient.setQueryData<MessageTimelineData>(timelineKey(), {
pageParams: [null],
pages: [
{
- items: [item(parent)],
+ entries: [{ type: 'message', message: item(parent) }],
next_cursor: null,
previous_cursor: { created_at: time, id: 'root' },
},
@@ -382,9 +410,10 @@ describe.each([
});
applyMessage(message(parent, 'mid-conversation'), 'posted');
expect(
- testQueryClient
- .getQueryData<MessageTimelineData>(timelineKey())!
- .pages[0].items.map((root) => root.id)
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
+ .pages[0]
+ ).map((root) => root.id)
).toEqual(['root']);
});
it(
@@ -428,8 +457,10 @@ describe.each([
},
});
const newestRoot = () =>
- testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
- .pages[0].items[0];
+ timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!
+ .pages[0]
+ )[0];
const agentSender = expect.objectContaining({
type: 'bot',
name: 'Bingus',
@@ -499,7 +530,11 @@ describe.each([
resolveFetch({
pageParams: [null],
pages: [
- { items: [item(parent)], next_cursor: null, previous_cursor: null },
+ {
+ entries: [{ type: 'message', message: item(parent) }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
],
});
await fetching.catch(() => undefined);
@@ -537,7 +572,7 @@ describe.each([
// still runs once the page settles.
resolveFetch({
pageParams: [null],
- pages: [{ items: [], next_cursor: null, previous_cursor: null }],
+ pages: [{ entries: [], next_cursor: null, previous_cursor: null }],
});
await fetching.catch(() => undefined);
await vi.waitFor(() =>
@@ -553,7 +588,11 @@ describe.each([
testQueryClient.setQueryData<MessageTimelineData>(timelineKey(), {
pageParams: [null],
pages: [
- { items: [item(parent)], next_cursor: null, previous_cursor: null },
+ {
+ entries: [{ type: 'message', message: item(parent) }],
+ next_cursor: null,
+ previous_cursor: null,
+ },
],
});
mocks.thread.mockReset();
@@ -595,9 +634,9 @@ describe.each([
expect(mocks.thread).toHaveBeenCalledTimes(1);
// The timeline preview mirrors the reply while the thread settles.
- const root = testQueryClient.getQueryData<MessageTimelineData>(
- timelineKey()
- )!.pages[0].items[0];
+ const root = timelineMessages(
+ testQueryClient.getQueryData<MessageTimelineData>(timelineKey())!.pages[0]
+ )[0];
expect(root.thread.reply_count).toBe(1);
expect(root.thread.preview).toEqual([
expect.objectContaining({ id: 'reply' }),
@@ -703,3 +742,89 @@ describe.each([
expect([...getTypingUsers(other)]).toEqual([]);
});
});
+
+describe('live timeline activity', () => {
+ const parent: MessageParent = { type: 'channel', id: 'live-activity' };
+ const root = (id: string, created_at: string) => ({
+ type: 'message' as const,
+ message: { ...item(parent), id, created_at },
+ });
+ const activity = {
+ id: 'renamed',
+ actor_id: 'macro|[email protected]',
+ occurred_at: '2026-09-09T00:00:01Z',
+ action: 'renamed',
+ payload: { to: 'Planning' },
+ };
+ const keys = (key: readonly unknown[]) =>
+ testQueryClient
+ .getQueryData<MessageTimelineData>(key)!
+ .pages.flatMap((page) =>
+ page.entries.map((entry) =>
+ entry.type === 'message'
+ ? entry.message.id
+ : `activity:${entry.activity.id}`
+ )
+ );
+
+ it('refetches a bottom page that is still loading when activity arrives', async () => {
+ const latest = getMessageTimelineQueryKey(parent);
+ let resolveFetch: (data: MessageTimelineData) => void = () => {};
+ const fetching = testQueryClient.fetchQuery({
+ queryKey: latest,
+ queryFn: () =>
+ new Promise<MessageTimelineData>((resolve) => {
+ resolveFetch = resolve;
+ }),
+ });
+ const invalidate = vi.spyOn(testQueryClient, 'invalidateQueries');
+ handleTimelineActivity({
+ parent,
+ activities: [activity],
+ });
+ expect(invalidate).not.toHaveBeenCalled();
+ resolveFetch({
+ pageParams: [null],
+ pages: [{ entries: [], next_cursor: null, previous_cursor: null }],
+ });
+ await fetching.catch(() => undefined);
+ await vi.waitFor(() =>
+ expect(invalidate).toHaveBeenCalledWith({ queryKey: latest, exact: true })
+ );
+ });
+
+ it('places activity by position in windows that contain it', () => {
+ const latest = getMessageTimelineQueryKey(parent);
+ const history = getMessageTimelineQueryKey(parent, 'older');
+ testQueryClient.setQueryData<MessageTimelineData>(latest, {
+ pageParams: [null],
+ pages: [
+ {
+ entries: [
+ root('newer', '2026-09-09T00:00:02Z'),
+ root('older', '2026-09-09T00:00:00Z'),
+ ],
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
+ });
+ // A load-around window whose newest loaded row predates the activity.
+ testQueryClient.setQueryData<MessageTimelineData>(history, {
+ pageParams: [null],
+ pages: [
+ {
+ entries: [root('older', '2026-09-09T00:00:00Z')],
+ next_cursor: null,
+ previous_cursor: { id: 'older', created_at: '2026-09-09T00:00:00Z' },
+ },
+ ],
+ });
+
+ handleTimelineActivity({ parent, activities: [activity] });
+ handleTimelineActivity({ parent, activities: [activity] });
+
+ expect(keys(latest)).toEqual(['newer', 'activity:renamed', 'older']);
+ expect(keys(history)).toEqual(['older']);
+ });
+});
diff --git a/apps/web/src/lib/queries/messages/tests/timeline.test.ts b/apps/web/src/lib/queries/messages/tests/timeline.test.ts
index 56d4b3907d..5f3e0b1b8c 100644
--- a/apps/web/src/lib/queries/messages/tests/timeline.test.ts
+++ b/apps/web/src/lib/queries/messages/tests/timeline.test.ts
@@ -8,12 +8,16 @@ import type {
MessageCursor,
MessageListItem,
MessageParent,
+ MessageTimelineEntry,
+ TimelineActivity,
} from '@service-storage/messages';
import { QueryClient } from '@tanstack/solid-query';
+import { createRoot } from 'solid-js';
+import { createStore, reconcile } from 'solid-js/store';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
const mocks = vi.hoisted(() => ({
- list: vi.fn(),
+ timeline: vi.fn(),
track: vi.fn(),
}));
@@ -26,7 +30,7 @@ vi.mock('../../client', () => ({
}));
vi.mock('@service-storage/messages', () => ({
- entityMessagesClient: { list: mocks.list },
+ entityMessagesClient: { timeline: mocks.timeline },
}));
vi.mock('@app/lib/analytics', () => ({
@@ -42,12 +46,19 @@ vi.mock('../subscription', () => ({
import { channelKeys } from '../../channel/keys';
import { normalizeChannelMessageSender } from '../message-sender';
import {
+ buildMessageIndex,
+ createMessageIndex,
+ findTopLevelMessageSnapshotInMessageTimeline,
getMessageTimelineQueryKey,
+ insertActivitiesIntoMessageTimeline,
isMissingMessageError,
type MessageTimelineData,
mergeCatchUpPage,
messageTimelineQueryOptions,
+ removeTopLevelMessageFromMessageTimeline,
+ restoreTopLevelMessageInMessageTimeline,
} from '../timeline';
+import { timelineEntryKey, timelineMessages } from '../timeline-entries';
const parent: MessageParent = { type: 'channel', id: 'channel-1' };
const document: MessageParent = { type: 'document', id: 'document-1' };
@@ -87,6 +98,11 @@ function createMessage(
});
}
+const entries = (items: MessageListItem[]): MessageTimelineEntry[] =>
+ items.map((message) => ({ type: 'message', message }));
+const ids = (page: { entries: MessageTimelineEntry[] }) =>
+ timelineMessages(page).map((item) => item.id);
+
const cursor = (id: string, createdAt: string): MessageCursor => ({
id,
created_at: createdAt,
@@ -107,7 +123,7 @@ function seedLatestCache(
const data: MessageTimelineData = {
pages: [
{
- items,
+ entries: entries(items),
next_cursor: extras?.nextCursor ?? cachedNext,
previous_cursor: extras?.previousCursor ?? null,
},
@@ -121,7 +137,7 @@ function fullPage(
items: MessageListItem[] = [createMessage('full-1', '2026-09-10T14:00:00Z')]
) {
return {
- items,
+ entries: entries(items),
next_cursor: null,
previous_cursor: null,
};
@@ -141,7 +157,7 @@ function resultError(code: string) {
beforeEach(() => {
testQueryClient = new QueryClient();
- mocks.list.mockReset();
+ mocks.timeline.mockReset();
mocks.track.mockReset();
});
@@ -153,7 +169,7 @@ describe('messageTimelineQueryOptions', () => {
it.each(['NOT_FOUND', 'GONE'] as const)(
'throws missing load-around messages without retrying them for %s',
async (code) => {
- mocks.list.mockRejectedValueOnce(resultError(code));
+ mocks.timeline.mockRejectedValueOnce(resultError(code));
const options = messageTimelineQueryOptions(parent, 'message-missing');
@@ -171,8 +187,8 @@ describe('messageTimelineQueryOptions', () => {
expect(error).toBeInstanceOf(ThrownResultError);
expect(isMissingMessageError(error)).toBe(true);
expect(options.retry(0, error)).toBe(false);
- expect(mocks.list).toHaveBeenCalledTimes(1);
- expect(mocks.list).toHaveBeenCalledWith(parent, {
+ expect(mocks.timeline).toHaveBeenCalledTimes(1);
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, {
...fullSelection,
around: 'message-missing',
});
@@ -188,15 +204,15 @@ describe('messageTimelineQueryOptions', () => {
it('first load without cache uses the full timeline', async () => {
const page = fullPage();
- mocks.list.mockResolvedValueOnce(page);
+ mocks.timeline.mockResolvedValueOnce(page);
const result = await messageTimelineQueryOptions(parent, null).queryFn({
pageParam: null,
});
- expect(mocks.list).toHaveBeenCalledTimes(1);
- expect(mocks.list).toHaveBeenCalledWith(parent, fullSelection);
- expect(result.items.map((item) => item.id)).toEqual(['full-1']);
+ expect(mocks.timeline).toHaveBeenCalledTimes(1);
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, fullSelection);
+ expect(ids(result)).toEqual(['full-1']);
expect(mocks.track).toHaveBeenCalledWith('channel_messages_load', {
channelId: 'channel-1',
path: 'full',
@@ -205,13 +221,13 @@ describe('messageTimelineQueryOptions', () => {
});
it('document timelines include whole-thread tombstones and report nothing', async () => {
- mocks.list.mockResolvedValueOnce(fullPage());
+ mocks.timeline.mockResolvedValueOnce(fullPage());
await messageTimelineQueryOptions(document, null).queryFn({
pageParam: null,
});
- expect(mocks.list).toHaveBeenCalledWith(document, {
+ expect(mocks.timeline).toHaveBeenCalledWith(document, {
...fullSelection,
include_deleted_threads: true,
});
@@ -230,7 +246,7 @@ describe('messageTimelineQueryOptions', () => {
getMessageTimelineQueryKey(project, null),
{ pages: [fullPage([deleted, old])], pageParams: [null] }
);
- mocks.list.mockResolvedValueOnce(
+ mocks.timeline.mockResolvedValueOnce(
fullPage([{ ...old, content: 'Edited while disconnected' }])
);
@@ -238,10 +254,10 @@ describe('messageTimelineQueryOptions', () => {
pageParam: null,
});
- expect(result.items.map((item) => item.content)).toEqual([
+ expect(timelineMessages(result).map((item) => item.content)).toEqual([
'Edited while disconnected',
]);
- expect(mocks.list).toHaveBeenCalledWith(project, fullSelection);
+ expect(mocks.timeline).toHaveBeenCalledWith(project, fullSelection);
expect(mocks.track).not.toHaveBeenCalled();
});
@@ -250,8 +266,8 @@ describe('messageTimelineQueryOptions', () => {
const newer = createMessage('msg-newer', '2026-09-10T13:19:00.123457Z');
seedLatestCache([older, newer]);
const deltaItem = createMessage('msg-delta', '2026-09-10T13:20:00.000000Z');
- mocks.list.mockResolvedValueOnce({
- items: [deltaItem],
+ mocks.timeline.mockResolvedValueOnce({
+ entries: entries([deltaItem]),
next_cursor: cursor('msg-delta', '2026-09-10T13:20:00.000000Z'),
previous_cursor: null,
});
@@ -260,18 +276,14 @@ describe('messageTimelineQueryOptions', () => {
pageParam: null,
});
- expect(mocks.list).toHaveBeenCalledTimes(1);
- expect(mocks.list).toHaveBeenCalledWith(parent, {
+ expect(mocks.timeline).toHaveBeenCalledTimes(1);
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, {
cursor: { created_at: '2026-09-10T13:19:00.123457Z', id: 'msg-newer' },
direction: 'newer',
limit: 50,
include_deleted_threads: false,
});
- expect(result.items.map((item) => item.id)).toEqual([
- 'msg-delta',
- 'msg-newer',
- 'msg-older',
- ]);
+ expect(ids(result)).toEqual(['msg-delta', 'msg-newer', 'msg-older']);
expect(result.next_cursor).toEqual(cachedNext);
expect(result.previous_cursor).toBeNull();
expect(mocks.track).toHaveBeenCalledWith('channel_messages_load', {
@@ -288,8 +300,8 @@ describe('messageTimelineQueryOptions', () => {
createMessage('msg-a', time),
createMessage('msg-b', time),
]);
- mocks.list.mockResolvedValueOnce({
- items: [],
+ mocks.timeline.mockResolvedValueOnce({
+ entries: [],
next_cursor: null,
previous_cursor: null,
});
@@ -298,7 +310,7 @@ describe('messageTimelineQueryOptions', () => {
pageParam: null,
});
- expect(mocks.list).toHaveBeenCalledWith(
+ expect(mocks.timeline).toHaveBeenCalledWith(
parent,
expect.objectContaining({ cursor: { created_at: time, id: 'msg-b' } })
);
@@ -306,22 +318,24 @@ describe('messageTimelineQueryOptions', () => {
it('delta overflow falls back to the full timeline', async () => {
seedLatestCache([createMessage('msg-1', '2026-09-10T13:19:00.123456Z')]);
- mocks.list.mockResolvedValueOnce({
- items: Array.from({ length: 50 }, (_, i) =>
- createMessage(`delta-${i}`, '2026-09-10T13:20:00Z')
+ mocks.timeline.mockResolvedValueOnce({
+ entries: entries(
+ Array.from({ length: 50 }, (_, i) =>
+ createMessage(`delta-${i}`, '2026-09-10T13:20:00Z')
+ )
),
next_cursor: cursor('delta-49', '2026-09-10T13:20:00Z'),
previous_cursor: cursor('delta-0', '2026-09-10T13:20:00Z'),
});
const page = fullPage();
- mocks.list.mockResolvedValueOnce(page);
+ mocks.timeline.mockResolvedValueOnce(page);
const result = await messageTimelineQueryOptions(parent, null).queryFn({
pageParam: null,
});
- expect(mocks.list).toHaveBeenLastCalledWith(parent, fullSelection);
- expect(result.items.map((item) => item.id)).toEqual(['full-1']);
+ expect(mocks.timeline).toHaveBeenLastCalledWith(parent, fullSelection);
+ expect(ids(result)).toEqual(['full-1']);
expect(mocks.track).toHaveBeenCalledWith('channel_messages_load', {
channelId: 'channel-1',
path: 'full',
@@ -332,7 +346,7 @@ describe('messageTimelineQueryOptions', () => {
it('cache away from latest uses the full timeline', async () => {
const page = fullPage();
- mocks.list.mockResolvedValue(page);
+ mocks.timeline.mockResolvedValue(page);
seedLatestCache([createMessage('msg-1', '2026-09-10T13:19:00Z')], {
pageParam: {
@@ -343,7 +357,7 @@ describe('messageTimelineQueryOptions', () => {
await messageTimelineQueryOptions(parent, null).queryFn({
pageParam: null,
});
- expect(mocks.list).toHaveBeenCalledWith(parent, fullSelection);
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, fullSelection);
expect(mocks.track).toHaveBeenCalledWith('channel_messages_load', {
channelId: 'channel-1',
path: 'full',
@@ -351,15 +365,15 @@ describe('messageTimelineQueryOptions', () => {
});
mocks.track.mockClear();
- mocks.list.mockClear();
+ mocks.timeline.mockClear();
seedLatestCache([createMessage('msg-1', '2026-09-10T13:19:00Z')], {
previousCursor: cursor('newer', '2026-09-10T13:30:00Z'),
});
await messageTimelineQueryOptions(parent, null).queryFn({
pageParam: null,
});
- expect(mocks.list).toHaveBeenCalledTimes(1);
- expect(mocks.list).toHaveBeenCalledWith(parent, fullSelection);
+ expect(mocks.timeline).toHaveBeenCalledTimes(1);
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, fullSelection);
expect(mocks.track).toHaveBeenCalledWith('channel_messages_load', {
channelId: 'channel-1',
path: 'full',
@@ -369,14 +383,14 @@ describe('messageTimelineQueryOptions', () => {
it('load-around stays on the full timeline', async () => {
seedLatestCache([createMessage('msg-1', '2026-09-10T13:19:00Z')]);
- mocks.list.mockResolvedValueOnce(fullPage());
+ mocks.timeline.mockResolvedValueOnce(fullPage());
await messageTimelineQueryOptions(parent, 'message-42').queryFn({
pageParam: null,
});
- expect(mocks.list).toHaveBeenCalledTimes(1);
- expect(mocks.list).toHaveBeenCalledWith(parent, {
+ expect(mocks.timeline).toHaveBeenCalledTimes(1);
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, {
...fullSelection,
around: 'message-42',
});
@@ -389,15 +403,15 @@ describe('messageTimelineQueryOptions', () => {
it('catch-up failure falls back except on auth errors', async () => {
seedLatestCache([createMessage('msg-1', '2026-09-10T13:19:00.123456Z')]);
- mocks.list.mockRejectedValueOnce(resultError('INTERNAL'));
- mocks.list.mockResolvedValueOnce(fullPage());
+ mocks.timeline.mockRejectedValueOnce(resultError('INTERNAL'));
+ mocks.timeline.mockResolvedValueOnce(fullPage());
const result = await messageTimelineQueryOptions(parent, null).queryFn({
pageParam: null,
});
- expect(result.items.map((item) => item.id)).toEqual(['full-1']);
- expect(mocks.list).toHaveBeenCalledTimes(2);
+ expect(ids(result)).toEqual(['full-1']);
+ expect(mocks.timeline).toHaveBeenCalledTimes(2);
expect(mocks.track).toHaveBeenCalledWith('channel_messages_load', {
channelId: 'channel-1',
path: 'full',
@@ -405,16 +419,16 @@ describe('messageTimelineQueryOptions', () => {
after: '2026-09-10T13:19:00.123456Z',
});
- mocks.list.mockClear();
+ mocks.timeline.mockClear();
mocks.track.mockClear();
- mocks.list.mockRejectedValueOnce(resultError('UNAUTHORIZED'));
+ mocks.timeline.mockRejectedValueOnce(resultError('UNAUTHORIZED'));
await expect(
messageTimelineQueryOptions(parent, null).queryFn({
pageParam: null,
})
).rejects.toBeInstanceOf(ThrownResultError);
- expect(mocks.list).toHaveBeenCalledTimes(1);
+ expect(mocks.timeline).toHaveBeenCalledTimes(1);
});
it('list ahead sets the reason', async () => {
@@ -432,8 +446,8 @@ describe('messageTimelineQueryOptions', () => {
},
},
] as unknown as ApiChannelWithLatest[]);
- mocks.list.mockResolvedValueOnce({
- items: [createMessage('msg-delta', '2026-09-10T13:20:00Z')],
+ mocks.timeline.mockResolvedValueOnce({
+ entries: entries([createMessage('msg-delta', '2026-09-10T13:20:00Z')]),
next_cursor: null,
previous_cursor: null,
});
@@ -457,10 +471,12 @@ describe('messageTimelineQueryOptions', () => {
const holdCatchUp = new Promise<void>((resolve) => {
releaseCatchUp = resolve;
});
- mocks.list.mockImplementationOnce(async () => {
+ mocks.timeline.mockImplementationOnce(async () => {
await holdCatchUp;
return {
- items: [createMessage('msg-delta', '2026-09-10T13:20:00.000000Z')],
+ entries: entries([
+ createMessage('msg-delta', '2026-09-10T13:20:00.000000Z'),
+ ]),
next_cursor: null,
previous_cursor: null,
};
@@ -479,23 +495,19 @@ describe('messageTimelineQueryOptions', () => {
releaseCatchUp();
const result = await pending;
- expect(result.items.map((item) => item.id)).toEqual([
- 'msg-live',
- 'msg-delta',
- 'msg-1',
- ]);
- expect(result.items[0]?.content).toBe('from websocket');
+ expect(ids(result)).toEqual(['msg-live', 'msg-delta', 'msg-1']);
+ expect(timelineMessages(result)[0]?.content).toBe('from websocket');
});
it('later pages keep using the full timeline without an event', async () => {
- mocks.list.mockResolvedValueOnce(fullPage());
+ mocks.timeline.mockResolvedValueOnce(fullPage());
const older = cursor('page-2', '2026-09-10T12:00:00Z');
await messageTimelineQueryOptions(parent, null).queryFn({
pageParam: { next_cursor: older, previous_cursor: null },
});
- expect(mocks.list).toHaveBeenCalledWith(parent, {
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, {
limit: 100,
cursor: older,
direction: 'older',
@@ -506,14 +518,14 @@ describe('messageTimelineQueryOptions', () => {
});
it('newer pages page forward from the previous cursor', async () => {
- mocks.list.mockResolvedValueOnce(fullPage());
+ mocks.timeline.mockResolvedValueOnce(fullPage());
const newer = cursor('page-0', '2026-09-10T15:00:00Z');
await messageTimelineQueryOptions(parent, null).queryFn({
pageParam: { next_cursor: null, previous_cursor: newer },
});
- expect(mocks.list).toHaveBeenCalledWith(parent, {
+ expect(mocks.timeline).toHaveBeenCalledWith(parent, {
limit: 100,
cursor: newer,
direction: 'newer',
@@ -532,19 +544,19 @@ describe('mergeCatchUpPage', () => {
const deltaNew = createMessage('msg-2', '2026-09-10T13:20:00Z');
const merged = mergeCatchUpPage(
{
- items: [deltaNew, deltaDup],
+ entries: entries([deltaNew, deltaDup]),
next_cursor: cursor('ignore-me', '2026-09-10T13:19:00Z'),
previous_cursor: cursor('also-ignore', '2026-09-10T13:20:00Z'),
},
{
- items: [cached],
+ entries: entries([cached]),
next_cursor: cachedNext,
previous_cursor: cursor('cached-prev', '2026-09-10T13:30:00Z'),
}
);
- expect(merged.items.map((item) => item.id)).toEqual(['msg-2', 'msg-1']);
- expect(merged.items[1]?.content).toBe('from delta');
+ expect(ids(merged)).toEqual(['msg-2', 'msg-1']);
+ expect(timelineMessages(merged)[1]?.content).toBe('from delta');
expect(merged.next_cursor).toEqual(cachedNext);
expect(merged.previous_cursor).toBeNull();
});
@@ -555,21 +567,156 @@ describe('mergeCatchUpPage', () => {
const delta = createMessage('msg-delta', '2026-09-10T13:20:00Z');
const merged = mergeCatchUpPage(
{
- items: [delta],
+ entries: entries([delta]),
next_cursor: null,
previous_cursor: null,
},
{
- items: [live, cached],
+ entries: entries([live, cached]),
next_cursor: cachedNext,
previous_cursor: null,
}
);
- expect(merged.items.map((item) => item.id)).toEqual([
- 'msg-live',
- 'msg-delta',
- 'msg-1',
+ expect(ids(merged)).toEqual(['msg-live', 'msg-delta', 'msg-1']);
+ });
+});
+
+describe('channel activity entries', () => {
+ const activity = (id: string, occurredAt: string): TimelineActivity => ({
+ id,
+ actor_id: 'user-1',
+ action: 'renamed',
+ occurred_at: occurredAt,
+ payload: { to: 'Planning' },
+ });
+ const keys = (page: { entries: MessageTimelineEntry[] }) =>
+ page.entries.map(timelineEntryKey);
+
+ function mixedPage(): MessageTimelineData {
+ return {
+ pages: [
+ {
+ entries: [
+ {
+ type: 'activity',
+ activity: activity('shared-id', '2026-09-10T15:00:00Z'),
+ },
+ {
+ type: 'message',
+ message: createMessage('shared-id', '2026-09-10T14:00:00Z'),
+ },
+ {
+ type: 'activity',
+ activity: activity('older', '2026-09-10T13:00:00Z'),
+ },
+ ],
+ next_cursor: cachedNext,
+ previous_cursor: null,
+ },
+ ],
+ pageParams: [null],
+ };
+ }
+
+ it('catch-up merges activity newer than the newest cached root', async () => {
+ seedLatestCache([createMessage('msg-1', '2026-09-10T13:19:00Z')]);
+ mocks.timeline.mockResolvedValueOnce({
+ entries: [
+ { type: 'activity', activity: activity('a', '2026-09-10T13:20:00Z') },
+ ],
+ next_cursor: null,
+ previous_cursor: null,
+ });
+
+ const result = await messageTimelineQueryOptions(parent, null).queryFn({
+ pageParam: null,
+ });
+
+ expect(keys(result)).toEqual(['activity:a', 'msg-1']);
+ });
+
+ it('indexes rows oldest first and keeps activity out of message keys', () => {
+ createRoot((dispose) => {
+ const data = mixedPage();
+ const index = createMessageIndex(() => data);
+ expect(index.entryKeys).toEqual([
+ 'activity:older',
+ 'shared-id',
+ 'activity:shared-id',
+ ]);
+ expect(index.keys).toEqual(['shared-id']);
+ expect(index.byId.get('shared-id')?.content).toBe('Message shared-id');
+ expect(index.activityByKey.get('activity:older')?.id).toBe('older');
+ dispose();
+ });
+ });
+
+ it('re-indexing reordered rows never writes into cached entries', () => {
+ const [m, n, b] = entries([
+ createMessage('m', '2026-09-10T15:00:00Z'),
+ createMessage('n', '2026-09-10T14:00:00Z'),
+ createMessage('b', '2026-09-10T16:00:00Z'),
+ ]);
+ const page = (pageEntries: MessageTimelineEntry[]) => [
+ { entries: pageEntries, next_cursor: null, previous_cursor: null },
+ ];
+ // The same store update createMessageIndex applies on every cache change.
+ const [index, setIndex] = createStore(buildMessageIndex(page([m, n])));
+ expect(index.entryKeys).toEqual(['n', 'm']);
+ // Cache updaters copy the entries array but keep its entry objects. Here a
+ // page left out of order gains a row, so surviving entries shift while
+ // another is inserted.
+ setIndex(reconcile(buildMessageIndex(page([b, n, m]))));
+ expect(index.entryKeys).toEqual(['m', 'n', 'b']);
+ expect([m, n, b].map(timelineEntryKey)).toEqual(['m', 'n', 'b']);
+ expect(index.byId.get('n')?.content).toBe('Message n');
+ });
+
+ it('keeps activity in place through message removal and rollback', () => {
+ const data = mixedPage();
+ testQueryClient.setQueryData(getMessageTimelineQueryKey(parent), data);
+ const snapshot = findTopLevelMessageSnapshotInMessageTimeline(
+ parent,
+ 'shared-id'
+ )!;
+ const removed = removeTopLevelMessageFromMessageTimeline(data, 'shared-id');
+ expect(keys(removed!.pages[0])).toEqual([
+ 'activity:shared-id',
+ 'activity:older',
+ ]);
+ expect(restoreTopLevelMessageInMessageTimeline(removed, snapshot)).toEqual(
+ data
+ );
+ });
+
+ it('inserts live activity by position within the loaded span only', () => {
+ const data: MessageTimelineData = {
+ pages: [
+ {
+ entries: entries([createMessage('newest', '2026-09-10T16:00:00Z')]),
+ next_cursor: cursor('newest', '2026-09-10T16:00:00Z'),
+ previous_cursor: null,
+ },
+ mixedPage().pages[0],
+ ],
+ pageParams: [null, null],
+ };
+
+ const inserted = insertActivitiesIntoMessageTimeline(data, [
+ activity('between', '2026-09-10T14:30:00Z'),
+ // Older than every loaded page: it arrives with its own page later.
+ activity('unloaded', '2026-09-10T11:00:00Z'),
+ ]);
+
+ expect(inserted!.pages.map(keys)).toEqual([
+ ['newest'],
+ ['activity:shared-id', 'activity:between', 'shared-id', 'activity:older'],
]);
+ expect(
+ insertActivitiesIntoMessageTimeline(inserted, [
+ activity('between', '2026-09-10T14:30:00Z'),
+ ])
+ ).toEqual(inserted);
});
});
diff --git a/apps/web/src/lib/queries/messages/timeline-entries.ts b/apps/web/src/lib/queries/messages/timeline-entries.ts
new file mode 100644
index 0000000000..0e847ef045
--- /dev/null
+++ b/apps/web/src/lib/queries/messages/timeline-entries.ts
@@ -0,0 +1,84 @@
+import { compareTimelinePositions } from '@core/util/message-timeline';
+import type {
+ MessageCursor,
+ MessageListItem,
+ MessageTimelineEntry,
+ MessageTimelinePage,
+} from '@service-storage/messages';
+import { match } from 'ts-pattern';
+
+type KeyedEntry =
+ | { type: 'message'; message: { id: string } }
+ | { type: 'activity'; activity: { id: string } };
+
+/** Row identity; activity ids live in their own namespace. */
+export function timelineEntryKey(entry: KeyedEntry): string {
+ return match(entry)
+ .with({ type: 'message' }, ({ message }) => message.id)
+ .with({ type: 'activity' }, ({ activity }) => `activity:${activity.id}`)
+ .exhaustive();
+}
+
+function timelineEntryPosition(entry: MessageTimelineEntry) {
+ return match(entry)
+ .with({ type: 'message' }, ({ message }) => ({
+ id: message.id,
+ createdAt: message.created_at,
+ }))
+ .with({ type: 'activity' }, ({ activity }) => ({
+ id: activity.id,
+ createdAt: activity.occurred_at,
+ }))
+ .exhaustive();
+}
+
+/** Message-only projections for thread operations and document annotations. */
+export function timelineMessages(
+ page: Pick<MessageTimelinePage, 'entries'>
+): MessageListItem[] {
+ return page.entries.flatMap((entry) =>
+ entry.type === 'message' ? [entry.message] : []
+ );
+}
+
+/** Merge entries newest-first, deduplicated by key; incoming entries win. */
+export function reconcileTimelineEntries(
+ existing: MessageTimelineEntry[],
+ incoming: MessageTimelineEntry[]
+): MessageTimelineEntry[] {
+ const entries = new Map(
+ [...existing, ...incoming].map((entry) => [timelineEntryKey(entry), entry])
+ );
+ return [...entries.values()].sort((left, right) =>
+ compareTimelinePositions(
+ timelineEntryPosition(right),
+ timelineEntryPosition(left)
+ )
+ );
+}
+
+function cursorPosition(cursor: MessageCursor) {
+ return { id: cursor.id, createdAt: cursor.created_at };
+}
+
+/** The loaded page whose bounds contain the entry, or -1 outside the loaded span. */
+export function pageIndexForEntry(
+ pages: MessageTimelinePage[],
+ entry: MessageTimelineEntry
+) {
+ const position = timelineEntryPosition(entry);
+ if (
+ !pages.length ||
+ (pages[0].previous_cursor &&
+ compareTimelinePositions(
+ position,
+ cursorPosition(pages[0].previous_cursor)
+ ) > 0)
+ )
+ return -1;
+ return pages.findIndex(
+ (page) =>
+ !page.next_cursor ||
+ compareTimelinePositions(position, cursorPosition(page.next_cursor)) >= 0
+ );
+}
diff --git a/apps/web/src/lib/queries/messages/timeline.ts b/apps/web/src/lib/queries/messages/timeline.ts
index 75cd6ee779..03221c431b 100644
--- a/apps/web/src/lib/queries/messages/timeline.ts
+++ b/apps/web/src/lib/queries/messages/timeline.ts
@@ -1,11 +1,14 @@
import { analytics } from '@app/lib/analytics';
+import { compareTimelinePositions } from '@core/util/message-timeline';
import { ThrownResultError, thrownResultErrorHasCode } from '@core/util/result';
import type { ApiChannelWithLatest } from '@service-storage/channel-list-types';
import type {
Message as EntityMessage,
MessageListItem,
MessageParent,
+ MessageTimelineEntry,
MessageTimelinePage,
+ TimelineActivity,
} from '@service-storage/messages';
import {
entityMessagesClient,
@@ -32,6 +35,12 @@ import {
removeReplyFromThreadPreview,
restoreReplyToThreadPreview,
} from './thread-preview';
+import {
+ pageIndexForEntry,
+ reconcileTimelineEntries,
+ timelineEntryKey,
+ timelineMessages,
+} from './timeline-entries';
export type MessageTimelineData = InfiniteData<
MessageTimelinePage,
@@ -43,9 +52,7 @@ type MessageTimelineQueryKey = ReturnType<
>['queryKey'];
export type TopLevelMessageSnapshot = {
- itemIndex: number;
message: MessageListItem;
- pageIndex: number;
};
export type ThreadPreviewReplySnapshot = {
@@ -118,22 +125,15 @@ export type MessageTimelineWatermark =
listAhead: boolean;
};
-function isNewerCreatedAt(candidate: string, current: string): boolean {
- const candidateMs = Date.parse(candidate);
- const currentMs = Date.parse(current);
- if (candidateMs !== currentMs) {
- return candidateMs > currentMs;
- }
- return candidate > current;
-}
-
function newestRoot(items: MessageListItem[]): MessageListItem | null {
let newest: MessageListItem | null = null;
for (const item of items) {
if (
newest === null ||
- isNewerCreatedAt(item.created_at, newest.created_at) ||
- (item.created_at === newest.created_at && item.id > newest.id)
+ compareTimelinePositions(
+ { id: item.id, createdAt: item.created_at },
+ { id: newest.id, createdAt: newest.created_at }
+ ) > 0
) {
newest = item;
}
@@ -152,19 +152,18 @@ export function readMessageTimelineWatermark(
getMessageTimelineQueryKey(parent, null)
);
const firstPage = cached?.pages[0];
- if (!cached || !firstPage || firstPage.items.length === 0) {
+ if (!cached || !firstPage || firstPage.entries.length === 0) {
return { kind: 'no_cache' };
}
if (cached.pageParams[0] != null || firstPage.previous_cursor) {
return { kind: 'cache_not_at_latest' };
}
- const newest = newestRoot(cached.pages.flatMap((page) => page.items));
+ const messages = cached.pages.flatMap(timelineMessages);
+ const newest = newestRoot(messages);
if (!newest) {
return { kind: 'no_cache' };
}
- const cachedIds = new Set(
- cached.pages.flatMap((page) => page.items.map((item) => item.id))
- );
+ const cachedIds = new Set(messages.map((item) => item.id));
const list =
parent.type === 'channel'
? queryClient.getQueryData<ApiChannelWithLatest[]>(
@@ -185,18 +184,8 @@ export function mergeCatchUpPage(
delta: MessageTimelinePage,
firstPage: MessageTimelinePage
): MessageTimelinePage {
- const deltaIds = new Set(delta.items.map((item) => item.id));
- const items = [
- ...delta.items,
- ...firstPage.items.filter((item) => !deltaIds.has(item.id)),
- ];
- items.sort((left, right) => {
- if (isNewerCreatedAt(left.created_at, right.created_at)) return -1;
- if (isNewerCreatedAt(right.created_at, left.created_at)) return 1;
- return 0;
- });
return {
- items,
+ entries: reconcileTimelineEntries(firstPage.entries, delta.entries),
next_cursor: firstPage.next_cursor,
previous_cursor: null,
};
@@ -222,7 +211,7 @@ async function fetchMessageTimelinePage(
pageParam: MessageTimelinePageParam | null,
loadAroundMessageId: string | null
): Promise<MessageTimelinePage> {
- const page = await entityMessagesClient.list(parent, {
+ const page = await entityMessagesClient.timeline(parent, {
limit: pageParam ? 100 : 50,
cursor: pageParam?.next_cursor ?? pageParam?.previous_cursor,
direction: pageParam?.previous_cursor ? 'newer' : 'older',
@@ -276,7 +265,7 @@ export function messageTimelineQueryOptions(
}
try {
const delta = normalizeMessageTimelinePageSenders(
- await entityMessagesClient.list(parent, {
+ await entityMessagesClient.timeline(parent, {
cursor: watermark.after,
direction: 'newer',
limit: 50,
@@ -403,7 +392,13 @@ export function getMessageTimelineQueryKeyPrefix(parent: MessageParent) {
/** Treat a selected root view as one page while applying the same cache operation. */
function rootPage(items: MessageListItem[]): MessageTimelineData {
return {
- pages: [{ items, next_cursor: null, previous_cursor: null }],
+ pages: [
+ {
+ entries: items.map((message) => ({ type: 'message', message })),
+ next_cursor: null,
+ previous_cursor: null,
+ },
+ ],
pageParams: [null],
};
}
@@ -429,7 +424,7 @@ export function setMessageTimelineData(
queryClient.setQueryData(
key,
next.pages
- .flatMap((page) => page.items)
+ .flatMap(timelineMessages)
.filter((item) => selection.messageIds.includes(item.id))
);
}
@@ -449,7 +444,7 @@ function getMessageTimelineEntries(parent: MessageParent) {
];
}
-function mapMessageTimelineItems(
+export function mapMessageTimelineItems(
data: MessageTimelineData,
updater: (message: MessageListItem) => MessageListItem
): MessageTimelineData {
@@ -457,16 +452,16 @@ function mapMessageTimelineItems(
const pages = data.pages.map((page) => {
let pageChanged = false;
- const items = page.items.map((message) => {
- const nextMessage = updater(message);
- if (nextMessage !== message) {
- didChange = true;
- pageChanged = true;
- }
- return nextMessage;
+ const entries = page.entries.map((entry) => {
+ if (entry.type !== 'message') return entry;
+ const message = updater(entry.message);
+ if (message === entry.message) return entry;
+ didChange = true;
+ pageChanged = true;
+ return { ...entry, message };
});
- return pageChanged ? { ...page, items } : page;
+ return pageChanged ? { ...page, entries } : page;
});
return didChange ? { ...data, pages } : data;
@@ -479,13 +474,15 @@ function filterMessageTimelineItems(
let didChange = false;
const pages = data.pages.map((page) => {
- const items = page.items.filter((message) => {
+ const entries = page.entries.filter((entry) => {
+ if (entry.type !== 'message') return true;
+ const message = entry.message;
const keep = predicate(message);
if (!keep) didChange = true;
return keep;
});
- return items.length === page.items.length ? page : { ...page, items };
+ return entries.length === page.entries.length ? page : { ...page, entries };
});
return didChange ? { ...data, pages } : data;
@@ -497,7 +494,9 @@ export function insertTopLevelMessageIntoMessageTimeline(
): MessageTimelineData | undefined {
if (!data?.pages.length) return data;
if (
- data.pages.some((page) => page.items.some((item) => item.id === message.id))
+ data.pages.some((page) =>
+ timelineMessages(page).some((item) => item.id === message.id)
+ )
) {
return data;
}
@@ -518,13 +517,33 @@ export function insertTopLevelMessageIntoMessageTimeline(
pages: [
{
...newestPage,
- items: [message, ...newestPage.items],
+ entries: [{ type: 'message', message }, ...newestPage.entries],
},
...olderPages,
],
};
}
+/** Place live activity within the loaded span; later pages bring the rest. */
+export function insertActivitiesIntoMessageTimeline(
+ data: MessageTimelineData | undefined,
+ activities: TimelineActivity[]
+): MessageTimelineData | undefined {
+ if (!data?.pages.length) return data;
+ let pages = data.pages;
+ for (const activity of activities) {
+ const entry: MessageTimelineEntry = { type: 'activity', activity };
+ const index = pageIndexForEntry(pages, entry);
+ if (index === -1) continue;
+ pages = pages.map((page, pageIndex) =>
+ pageIndex === index
+ ? { ...page, entries: reconcileTimelineEntries(page.entries, [entry]) }
+ : page
+ );
+ }
+ return pages === data.pages ? data : { ...data, pages };
+}
+
export function removeTopLevelMessageFromMessageTimeline(
data: MessageTimelineData | undefined,
messageId: string
@@ -543,16 +562,12 @@ function getTopLevelMessageSnapshot(
): TopLevelMessageSnapshot | undefined {
if (!data) return;
- for (const [pageIndex, page] of data.pages.entries()) {
- const itemIndex = page.items.findIndex(
- (message) => message.id === messageId
+ for (const page of data.pages) {
+ const entry = page.entries.find(
+ (entry) => entry.type === 'message' && entry.message.id === messageId
);
- if (itemIndex === -1) continue;
- return {
- pageIndex,
- itemIndex,
- message: page.items[itemIndex],
- };
+ if (entry?.type !== 'message') continue;
+ return { message: entry.message };
}
}
@@ -563,27 +578,28 @@ export function restoreTopLevelMessageInMessageTimeline(
if (!data) return data;
if (
data.pages.some((page) =>
- page.items.some((message) => message.id === snapshot.message.id)
+ timelineMessages(page).some(
+ (message) => message.id === snapshot.message.id
+ )
)
) {
return data;
}
- const page = data.pages[snapshot.pageIndex];
- if (!page) return data;
-
- const items = [...page.items];
- items.splice(snapshot.itemIndex, 0, snapshot.message);
-
- const pages = [...data.pages];
- pages[snapshot.pageIndex] = {
- ...page,
- items,
+ const entry: MessageTimelineEntry = {
+ type: 'message',
+ message: snapshot.message,
};
+ const pageIndex = pageIndexForEntry(data.pages, entry);
+ if (pageIndex === -1) return data;
return {
...data,
- pages,
+ pages: data.pages.map((page, index) =>
+ index === pageIndex
+ ? { ...page, entries: reconcileTimelineEntries(page.entries, [entry]) }
+ : page
+ ),
};
}
@@ -623,7 +639,7 @@ function getThreadPreviewReplySnapshot(
if (!data) return;
for (const page of data.pages) {
- const thread = page.items.find(
+ const thread = timelineMessages(page).find(
(message) => message.id === threadId
)?.thread;
if (!thread) continue;
@@ -659,7 +675,9 @@ export function findTopLevelMessageInMessageTimeline(
for (const [, data] of getMessageTimelineEntries(parent)) {
if (!data) continue;
for (const page of data.pages) {
- const message = page.items.find((item) => item.id === messageId);
+ const message = timelineMessages(page).find(
+ (item) => item.id === messageId
+ );
if (message) return message;
}
}
@@ -673,7 +691,7 @@ export function findThreadIdInMessageTimeline(
for (const [, data] of getMessageTimelineEntries(parent)) {
if (!data) continue;
for (const page of data.pages) {
- for (const message of page.items) {
+ for (const message of timelineMessages(page)) {
if (message.thread.preview.some((reply) => reply.id === replyId)) {
return message.id;
}
@@ -728,50 +746,65 @@ export function softInvalidateMessageTimelineByIds(parent: MessageParent) {
}
/**
- * Build a single oldest-first message index for display and lookup.
- * Pages arrive newest-first, items within each page are newest-first,
+ * Build a single oldest-first timeline index for display and lookup.
+ * Pages arrive newest-first, entries within each page are newest-first,
* so we reverse both layers in one pass.
*/
-export function createMessageIndex(
- data: Accessor<MessageTimelineData | undefined>
-) {
- const buildIndex = () => {
- const data_ = data();
-
- const pages = data_?.pages;
-
- const items: MessageListItem[] = [];
- const keys: string[] = [];
- const byId = new Map<string, MessageListItem>();
-
- if (!pages?.length) return { items, keys, byId };
-
- const seen = new Set<string>();
- for (let i = pages.length - 1; i >= 0; i--) {
- const pageItems = pages[i].items;
- for (let j = pageItems.length - 1; j >= 0; j--) {
- const message = pageItems[j];
- if (seen.has(message.id)) continue;
- seen.add(message.id);
- items.push(message);
- keys.push(message.id);
- byId.set(message.id, message);
+/** The rows a timeline renders, oldest first, from its cached pages. */
+export function buildMessageIndex(pages: MessageTimelinePage[] | undefined) {
+ /**
+ * New objects carrying their row key as `id`, so `reconcile` pairs each
+ * entry with its own previous copy. Without an `id` it pairs by position
+ * and writes one entry's fields into another, which are the query cache's
+ * own objects.
+ */
+ const entries: (MessageTimelineEntry & { id: string })[] = [];
+ /** Every rendered row, messages and activity. */
+ const entryKeys: string[] = [];
+ /** Message ids only: selection and navigation skip activity. */
+ const keys: string[] = [];
+ const byId = new Map<string, MessageListItem>();
+ const activityByKey = new Map<string, TimelineActivity>();
+
+ if (!pages?.length) return { entries, entryKeys, keys, byId, activityByKey };
+
+ const seen = new Set<string>();
+ for (let i = pages.length - 1; i >= 0; i--) {
+ const pageEntries = pages[i].entries;
+ for (let j = pageEntries.length - 1; j >= 0; j--) {
+ const entry = pageEntries[j];
+ const key = timelineEntryKey(entry);
+ if (seen.has(key)) continue;
+ seen.add(key);
+ entries.push({ ...entry, id: key });
+ entryKeys.push(key);
+ if (entry.type === 'activity') {
+ activityByKey.set(key, entry.activity);
+ continue;
}
+ keys.push(key);
+ byId.set(key, entry.message);
}
+ }
- return { items, keys, byId };
- };
+ return { entries, entryKeys, keys, byId, activityByKey };
+}
- const [messageIndex, setMessageIndex] = createStore(buildIndex());
+/** A reactive index over a timeline query's cached pages. */
+export function createMessageIndex(
+ data: Accessor<MessageTimelineData | undefined>
+) {
+ const [messageIndex, setMessageIndex] = createStore(
+ buildMessageIndex(data()?.pages)
+ );
createEffect(
on(data, () => {
- const next = buildIndex();
// The underlying query can briefly emit undefined data during a refetch
- if (next.items.length === 0 && messageIndex.items.length > 0) {
+ if (!data()) {
return;
}
- setMessageIndex(reconcile(next));
+ setMessageIndex(reconcile(buildMessageIndex(data()?.pages)));
})
);
diff --git a/apps/web/src/lib/queries/sync/SyncProvider.tsx b/apps/web/src/lib/queries/sync/SyncProvider.tsx
index 14baf3b511..3795494710 100644
--- a/apps/web/src/lib/queries/sync/SyncProvider.tsx
+++ b/apps/web/src/lib/queries/sync/SyncProvider.tsx
@@ -32,7 +32,10 @@ import {
import { invalidateContacts } from '@queries/contacts/contacts';
import { handleRefreshEmail } from '@queries/email/sync';
import { invalidateFavorites } from '@queries/favorites/favorites';
-import { handleMessageEvent } from '@queries/messages/sync';
+import {
+ handleMessageEvent,
+ handleTimelineActivity,
+} from '@queries/messages/sync';
import {
applyNotificationStatusUpdate,
notificationStatusUpdatePayloadSchema,
@@ -104,6 +107,13 @@ export function QuerySyncProvider(props: SyncProviderProps) {
.with({ type: 'contacts_invalidation' }, () => {
invalidateContacts();
})
+ .with({ type: 'timeline_activity' }, () => {
+ withParsedWebsocketPayload(
+ data.type,
+ data.data,
+ handleTimelineActivity
+ );
+ })
.with({ type: 'message_update' }, () => {
withParsedWebsocketPayload<Parameters<typeof handleMessageEvent>[0]>(
data.type,
diff --git a/apps/web/src/lib/service-clients/orval.config.ts b/apps/web/src/lib/service-clients/orval.config.ts
index 2839a59936..e68400bad2 100644
--- a/apps/web/src/lib/service-clients/orval.config.ts
+++ b/apps/web/src/lib/service-clients/orval.config.ts
@@ -188,7 +188,7 @@ export default defineConfig({
/^DocumentTopicEvent$/,
/^ChannelTopicEvent$/,
/^Document(Created|Updated|Deleted|Copied)Metadata$/,
- /^Channel(Created|Updated|Deleted)Metadata$/,
+ /^Channel(Created|Updated|Deleted|PictureChanged)Metadata$/,
/^ChannelParticipant(Added|Removed)Metadata$/,
/^MessageTopicEvent$/,
/^Message(Posted|Patched|Deleted|Mentioned)Metadata$/,
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
index d12def2cb2..cc3c81c2c0 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/index.ts
@@ -1208,6 +1208,15 @@ export * from './messageThread';
export * from './messageThreadId';
export * from './messageThreadPreview';
export * from './messageThreadPreviewLatestReplyAt';
+export * from './messageTimelineEntriesParams';
+export * from './messageTimelineEntry';
+export * from './messageTimelineEntryOneOf';
+export * from './messageTimelineEntryOneOfThree';
+export * from './messageTimelineEntryOneOfThreeType';
+export * from './messageTimelineEntryOneOfType';
+export * from './messageTimelinePage';
+export * from './messageTimelinePageNextCursor';
+export * from './messageTimelinePagePreviousCursor';
export * from './messageTimelineParams';
export * from './messageTimelineQuery';
export * from './messageTimelineQueryActivityAfter';
@@ -1882,6 +1891,7 @@ export * from './threadPatchResolved';
export * from './threadState';
export * from './threadStateAnchor';
export * from './threadStateDeletedAt';
+export * from './timelineActivity';
export * from './touchedColumn';
export * from './touchedRow';
export * from './transcribeDictationParams';
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageCursor.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageCursor.ts
index 3eb70354c7..878812a0d9 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageCursor.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageCursor.ts
@@ -9,8 +9,8 @@
* Cursor for a chronological parent timeline.
*/
export interface MessageCursor {
- /** Last root creation time. */
+ /** Last message creation time or activity occurrence time. */
created_at: string;
- /** Last root UUID, used to break timestamp ties. */
+ /** Last entry UUID, used to break timestamp ties across both sources. */
id: string;
}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntriesParams.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntriesParams.ts
new file mode 100644
index 0000000000..fb69de3aad
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntriesParams.ts
@@ -0,0 +1,13 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type MessageTimelineEntriesParams = {
+ /**
+ * Serialized MessageTimelineQuery; absent selects the latest roots.
+ */
+ selection?: string | null;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntry.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntry.ts
new file mode 100644
index 0000000000..8a44cb91bd
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntry.ts
@@ -0,0 +1,15 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { MessageTimelineEntryOneOf } from './messageTimelineEntryOneOf';
+import type { MessageTimelineEntryOneOfThree } from './messageTimelineEntryOneOfThree';
+
+/**
+ * One chronological entry in a parent's timeline.
+ */
+export type MessageTimelineEntry =
+ | MessageTimelineEntryOneOf
+ | MessageTimelineEntryOneOfThree;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOf.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOf.ts
new file mode 100644
index 0000000000..9305c44db7
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOf.ts
@@ -0,0 +1,17 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { MessageListItem } from './messageListItem';
+import type { MessageTimelineEntryOneOfType } from './messageTimelineEntryOneOfType';
+
+/**
+ * A root message with its bounded thread preview.
+ */
+export type MessageTimelineEntryOneOf = {
+ /** The message and thread state. */
+ message: MessageListItem;
+ type: MessageTimelineEntryOneOfType;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfThree.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfThree.ts
new file mode 100644
index 0000000000..70522b4007
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfThree.ts
@@ -0,0 +1,18 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+import type { MessageTimelineEntryOneOfThreeType } from './messageTimelineEntryOneOfThreeType';
+import type { TimelineActivity } from './timelineActivity';
+
+/**
+ * A recorded fact about the parent, such as a rename or a finished call.
+ */
+export type MessageTimelineEntryOneOfThree = {
+ /** The recorded activity. */
+ activity: TimelineActivity;
+ type: MessageTimelineEntryOneOfThreeType;
+};
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfThreeType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfThreeType.ts
new file mode 100644
index 0000000000..d8faccc472
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfThreeType.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type MessageTimelineEntryOneOfThreeType =
+ (typeof MessageTimelineEntryOneOfThreeType)[keyof typeof MessageTimelineEntryOneOfThreeType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const MessageTimelineEntryOneOfThreeType = {
+ activity: 'activity',
+} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfType.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfType.ts
new file mode 100644
index 0000000000..59c8bae434
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelineEntryOneOfType.ts
@@ -0,0 +1,14 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+export type MessageTimelineEntryOneOfType =
+ (typeof MessageTimelineEntryOneOfType)[keyof typeof MessageTimelineEntryOneOfType];
+
+// eslint-disable-next-line @typescript-eslint/no-redeclare
+export const MessageTimelineEntryOneOfType = {
+ message: 'message',
+} as const;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePage.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePage.ts
new file mode 100644
index 0000000000..20ba2f4ee9
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePage.ts
@@ -0,0 +1,20 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { MessageTimelineEntry } from './messageTimelineEntry';
+import type { MessageTimelinePageNextCursor } from './messageTimelinePageNextCursor';
+import type { MessageTimelinePagePreviousCursor } from './messageTimelinePagePreviousCursor';
+
+/**
+ * A bounded, newest-first window of a parent's messages and activity, ordered
+by the server on one `(timestamp, id)` keyset.
+ */
+export interface MessageTimelinePage {
+ /** Messages and activity, newest first. */
+ entries: MessageTimelineEntry[];
+ next_cursor?: MessageTimelinePageNextCursor;
+ previous_cursor?: MessageTimelinePagePreviousCursor;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePageNextCursor.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePageNextCursor.ts
new file mode 100644
index 0000000000..e4dc1e97ed
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePageNextCursor.ts
@@ -0,0 +1,9 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { MessageCursor } from './messageCursor';
+
+export type MessageTimelinePageNextCursor = null | MessageCursor;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePagePreviousCursor.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePagePreviousCursor.ts
new file mode 100644
index 0000000000..785803f4dc
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/messageTimelinePagePreviousCursor.ts
@@ -0,0 +1,9 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { MessageCursor } from './messageCursor';
+
+export type MessageTimelinePagePreviousCursor = null | MessageCursor;
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/schemas/timelineActivity.ts b/apps/web/src/lib/service-clients/service-storage/generated/schemas/timelineActivity.ts
new file mode 100644
index 0000000000..ad3b675582
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/generated/schemas/timelineActivity.ts
@@ -0,0 +1,22 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+
+/**
+ * A displayable fact returned together with a message page.
+ */
+export interface TimelineActivity {
+ /** Durable action tag. Unknown tags remain representable during rollouts. */
+ action: string;
+ /** Principal who performed the action. */
+ actor_id: string;
+ /** Stable activity identity, independent of message ids. */
+ id: string;
+ /** Immutable chronological position. */
+ occurred_at: string;
+ /** The action's stored payload. */
+ payload?: unknown;
+}
diff --git a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
index b59f298ac2..bd207a6991 100644
--- a/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
+++ b/apps/web/src/lib/service-clients/service-storage/generated/zod.ts
@@ -44452,10 +44452,14 @@ export const messageTimelineResponse = zod
.object({
created_at: zod.iso
.datetime({})
- .describe('Last root creation time.'),
+ .describe(
+ 'Last message creation time or activity occurrence time.'
+ ),
id: zod
.uuid()
- .describe('Last root UUID, used to break timestamp ties.'),
+ .describe(
+ 'Last entry UUID, used to break timestamp ties across both sources.'
+ ),
})
.describe('Cursor for a chronological parent timeline.'),
])
@@ -44467,10 +44471,14 @@ export const messageTimelineResponse = zod
.object({
created_at: zod.iso
.datetime({})
- .describe('Last root creation time.'),
+ .describe(
+ 'Last message creation time or activity occurrence time.'
+ ),
id: zod
.uuid()
- .describe('Last root UUID, used to break timestamp ties.'),
+ .describe(
+ 'Last entry UUID, used to break timestamp ties across both sources.'
+ ),
})
.describe('Cursor for a chronological parent timeline.'),
])
@@ -46395,6 +46403,688 @@ export const entityMessagePatchThreadResponse = zod
})
.describe('State belonging to a whole thread, keyed by its root message.');
+/**
+ * @summary Read a bounded window of messages and the parent's activity, ordered by the server.
+ */
+export const messageTimelineEntriesParams = zod.object({
+ parent_type: zod.string(),
+ parent_id: zod.string(),
+});
+
+export const messageTimelineEntriesQueryParams = zod.object({
+ selection: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Serialized MessageTimelineQuery; absent selects the latest roots.'
+ ),
+});
+
+export const messageTimelineEntriesResponse = zod
+ .object({
+ entries: zod
+ .array(
+ zod
+ .union([
+ zod
+ .object({
+ message: zod
+ .object({
+ attachments: zod
+ .array(
+ zod
+ .object({
+ created_at: zod.iso
+ .datetime({})
+ .describe('When the attachment was added.'),
+ entity_id: zod
+ .string()
+ .describe('Attached entity identifier.'),
+ entity_type: zod
+ .string()
+ .describe('Attached entity type.'),
+ height: zod
+ .number()
+ .nullish()
+ .describe('Optional media height.'),
+ id: zod.uuid().describe('Attachment UUID.'),
+ width: zod
+ .number()
+ .nullish()
+ .describe('Optional media width.'),
+ })
+ .describe('An entity attached to a message.')
+ )
+ .describe('Attached entities.'),
+ bot_profile: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ avatar_url: zod
+ .string()
+ .nullish()
+ .describe('Bot avatar URL.'),
+ name: zod.string().describe('Bot display name.'),
+ })
+ .describe(
+ 'Public bot profile attached to bot-authored messages.'
+ ),
+ ])
+ .optional(),
+ content: zod.string().describe('Macro Markdown body.'),
+ created_at: zod.iso.datetime({}).describe('Creation time.'),
+ deleted_at: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'Message tombstone, independent of thread deletion.'
+ ),
+ edited_at: zod.iso
+ .datetime({})
+ .nullish()
+ .describe('Last content edit, if any.'),
+ id: zod.uuid().describe('Message UUID.'),
+ imported_author: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ name: zod
+ .string()
+ .describe(
+ 'Original author text; never interpreted as an authenticated principal.'
+ ),
+ })
+ .describe(
+ 'Display attribution for a comment imported from an external document.'
+ ),
+ ])
+ .optional(),
+ mentions: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod
+ .string()
+ .describe('Mentioned entity identifier.'),
+ entity_type: zod
+ .string()
+ .describe('Mentioned entity type.'),
+ })
+ .describe('A mention tracked in a message body.')
+ )
+ .describe(
+ 'Tracked mentions, retained when a caller changes attachments only.'
+ ),
+ parent: zod
+ .union([
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe(
+ 'A channel, including direct messages.'
+ ),
+ type: zod.enum(['channel']),
+ })
+ .describe('A channel, including direct messages.'),
+ zod
+ .object({
+ id: zod
+ .string()
+ .describe(
+ 'A validated document identifier. Historical document ids need not be UUIDs.'
+ ),
+ type: zod.enum(['document']),
+ })
+ .describe('A document, including tasks and PDFs.'),
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe(
+ 'An initiative, presented as a project in the application.'
+ ),
+ type: zod.enum(['initiative']),
+ })
+ .describe(
+ 'An initiative, presented as a project in the application.'
+ ),
+ zod
+ .object({
+ id: zod.uuid().describe('A CRM company.'),
+ type: zod.enum(['crm_company']),
+ })
+ .describe('A CRM company.'),
+ zod
+ .object({
+ id: zod.uuid().describe('A CRM contact.'),
+ type: zod.enum(['crm_contact']),
+ })
+ .describe('A CRM contact.'),
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe(
+ 'A video call and its persistent chat thread.'
+ ),
+ type: zod.enum(['call']),
+ })
+ .describe(
+ 'A video call and its persistent chat thread.'
+ ),
+ ])
+ .describe(
+ 'The entity whose permissions and lifecycle govern a message.'
+ ),
+ reactions: zod
+ .array(
+ zod
+ .object({
+ emoji: zod
+ .string()
+ .describe('Emoji being reacted with.'),
+ users: zod
+ .array(zod.string())
+ .describe('User identifiers.'),
+ })
+ .describe(
+ 'Reaction emoji and the users who added it.'
+ )
+ )
+ .describe('Aggregated reactions.'),
+ sender_id: zod
+ .string()
+ .describe(
+ 'Authenticated actor or owner of imported content.'
+ ),
+ thread_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'Root message UUID for replies; absent on roots.'
+ ),
+ triggered_by: zod
+ .string()
+ .nullish()
+ .describe('User who triggered a bot-authored message.'),
+ updated_at: zod.iso
+ .datetime({})
+ .describe('Last persisted update.'),
+ })
+ .describe(
+ 'Shared message representation for channel timelines and entity discussions.'
+ )
+ .and(
+ zod.object({
+ state: zod
+ .object({
+ anchor: zod
+ .union([
+ zod.null(),
+ zod
+ .union([
+ zod
+ .object({
+ mark_id: zod
+ .uuid()
+ .describe(
+ 'Mark UUID serialized in the document.'
+ ),
+ marked_text: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The marked text as it read when the discussion was created, already\ntrimmed and bounded. Absent on threads created or imported before\nsnapshots were captured: the text a mark covers cannot be recovered\nfrom the mark id alone.'
+ ),
+ type: zod.enum(['markdown']),
+ })
+ .describe(
+ 'Stable Lexical mark identity, independent of transient node keys.'
+ ),
+ zod
+ .object({
+ anchor_id: zod
+ .uuid()
+ .describe('Highlight annotation UUID.'),
+ marked_text: zod
+ .string()
+ .nullish()
+ .describe(
+ 'The text the highlight covers, trimmed and bounded like a markdown\nsnapshot. The highlight owns it and it can be edited there, so it is\nread from the highlight whenever the thread is, never stored on the\nthread. Absent when the highlight carries no text.'
+ ),
+ type: zod.enum(['pdf_highlight']),
+ })
+ .describe(
+ 'An independently existing PDF highlight.'
+ ),
+ zod
+ .object({
+ anchor_id: zod
+ .uuid()
+ .describe('Placeable annotation UUID.'),
+ type: zod.enum(['pdf_placeable']),
+ })
+ .describe(
+ 'A comment-only placeable PDF annotation. It marks a point on a page,\nnot a span of text, so it has no marked text.'
+ ),
+ zod
+ .object({
+ range: zod
+ .string()
+ .describe(
+ 'A1 cell or range, such as B4 or B4:C9.'
+ ),
+ sheetId: zod
+ .string()
+ .describe(
+ 'Stable sheet identity within the workbook.'
+ ),
+ sheetName: zod
+ .string()
+ .describe(
+ 'Sheet name when the discussion was created.'
+ ),
+ type: zod.enum(['spreadsheet']),
+ })
+ .describe(
+ 'A cell or rectangular range in a native spreadsheet.'
+ ),
+ zod
+ .object({
+ nodeId: zod
+ .string()
+ .nullish()
+ .describe(
+ 'Layer the pin follows; absent for a pin on the bare canvas.'
+ ),
+ pageId: zod
+ .string()
+ .describe(
+ 'Page (canvas) the pin is on.'
+ ),
+ type: zod.enum(['fig']),
+ x: zod
+ .number()
+ .describe(
+ "Horizontal offset from the layer's origin, or the page's when\nthe pin is on no layer, in design units."
+ ),
+ y: zod
+ .number()
+ .describe(
+ 'Vertical offset, measured like `x`.'
+ ),
+ })
+ .describe(
+ 'A point pinned on a design (`.fig`): on a layer, or on the page\ncanvas when no layer was under it.'
+ ),
+ ])
+ .describe(
+ "A thread's location within its document. PDF geometry remains annotation-owned."
+ ),
+ ])
+ .optional(),
+ created_at: zod.iso
+ .datetime({})
+ .describe('Creation time of the discussion.'),
+ deleted_at: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'Explicit deletion of the entire thread, distinct from root deletion.'
+ ),
+ resolved: zod
+ .boolean()
+ .describe(
+ 'Whether this discussion has been resolved.'
+ ),
+ root_id: zod
+ .uuid()
+ .describe(
+ 'Root message UUID; there is no separate thread identity.'
+ ),
+ updated_at: zod.iso
+ .datetime({})
+ .describe('Last state change.'),
+ user_id: zod
+ .string()
+ .describe(
+ 'User who owns this discussion, including imported discussions.'
+ ),
+ })
+ .describe(
+ 'State belonging to a whole thread, keyed by its root message.'
+ ),
+ thread: zod
+ .object({
+ latest_reply_at: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'Creation time of the latest live reply.'
+ ),
+ preview: zod
+ .array(
+ zod
+ .object({
+ attachments: zod
+ .array(
+ zod
+ .object({
+ created_at: zod.iso
+ .datetime({})
+ .describe(
+ 'When the attachment was added.'
+ ),
+ entity_id: zod
+ .string()
+ .describe(
+ 'Attached entity identifier.'
+ ),
+ entity_type: zod
+ .string()
+ .describe('Attached entity type.'),
+ height: zod
+ .number()
+ .nullish()
+ .describe('Optional media height.'),
+ id: zod
+ .uuid()
+ .describe('Attachment UUID.'),
+ width: zod
+ .number()
+ .nullish()
+ .describe('Optional media width.'),
+ })
+ .describe(
+ 'An entity attached to a message.'
+ )
+ )
+ .describe('Attached entities.'),
+ bot_profile: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ avatar_url: zod
+ .string()
+ .nullish()
+ .describe('Bot avatar URL.'),
+ name: zod
+ .string()
+ .describe('Bot display name.'),
+ })
+ .describe(
+ 'Public bot profile attached to bot-authored messages.'
+ ),
+ ])
+ .optional(),
+ content: zod
+ .string()
+ .describe('Macro Markdown body.'),
+ created_at: zod.iso
+ .datetime({})
+ .describe('Creation time.'),
+ deleted_at: zod.iso
+ .datetime({})
+ .nullish()
+ .describe(
+ 'Message tombstone, independent of thread deletion.'
+ ),
+ edited_at: zod.iso
+ .datetime({})
+ .nullish()
+ .describe('Last content edit, if any.'),
+ id: zod.uuid().describe('Message UUID.'),
+ imported_author: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ name: zod
+ .string()
+ .describe(
+ 'Original author text; never interpreted as an authenticated principal.'
+ ),
+ })
+ .describe(
+ 'Display attribution for a comment imported from an external document.'
+ ),
+ ])
+ .optional(),
+ mentions: zod
+ .array(
+ zod
+ .object({
+ entity_id: zod
+ .string()
+ .describe(
+ 'Mentioned entity identifier.'
+ ),
+ entity_type: zod
+ .string()
+ .describe('Mentioned entity type.'),
+ })
+ .describe(
+ 'A mention tracked in a message body.'
+ )
+ )
+ .describe(
+ 'Tracked mentions, retained when a caller changes attachments only.'
+ ),
+ parent: zod
+ .union([
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe(
+ 'A channel, including direct messages.'
+ ),
+ type: zod.enum(['channel']),
+ })
+ .describe(
+ 'A channel, including direct messages.'
+ ),
+ zod
+ .object({
+ id: zod
+ .string()
+ .describe(
+ 'A validated document identifier. Historical document ids need not be UUIDs.'
+ ),
+ type: zod.enum(['document']),
+ })
+ .describe(
+ 'A document, including tasks and PDFs.'
+ ),
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe(
+ 'An initiative, presented as a project in the application.'
+ ),
+ type: zod.enum(['initiative']),
+ })
+ .describe(
+ 'An initiative, presented as a project in the application.'
+ ),
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe('A CRM company.'),
+ type: zod.enum(['crm_company']),
+ })
+ .describe('A CRM company.'),
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe('A CRM contact.'),
+ type: zod.enum(['crm_contact']),
+ })
+ .describe('A CRM contact.'),
+ zod
+ .object({
+ id: zod
+ .uuid()
+ .describe(
+ 'A video call and its persistent chat thread.'
+ ),
+ type: zod.enum(['call']),
+ })
+ .describe(
+ 'A video call and its persistent chat thread.'
+ ),
+ ])
+ .describe(
+ 'The entity whose permissions and lifecycle govern a message.'
+ ),
+ reactions: zod
+ .array(
+ zod
+ .object({
+ emoji: zod
+ .string()
+ .describe(
+ 'Emoji being reacted with.'
+ ),
+ users: zod
+ .array(zod.string())
+ .describe('User identifiers.'),
+ })
+ .describe(
+ 'Reaction emoji and the users who added it.'
+ )
+ )
+ .describe('Aggregated reactions.'),
+ sender_id: zod
+ .string()
+ .describe(
+ 'Authenticated actor or owner of imported content.'
+ ),
+ thread_id: zod
+ .uuid()
+ .nullish()
+ .describe(
+ 'Root message UUID for replies; absent on roots.'
+ ),
+ triggered_by: zod
+ .string()
+ .nullish()
+ .describe(
+ 'User who triggered a bot-authored message.'
+ ),
+ updated_at: zod.iso
+ .datetime({})
+ .describe('Last persisted update.'),
+ })
+ .describe(
+ 'Shared message representation for channel timelines and entity discussions.'
+ )
+ )
+ .describe(
+ 'Bounded preview using the canonical message shape.'
+ ),
+ reply_count: zod
+ .number()
+ .describe('Total live reply count.'),
+ })
+ .describe(
+ 'Thread counts and its oldest three live replies.'
+ ),
+ })
+ )
+ .describe(
+ 'Root message with its small thread preview, independent of its parent type.'
+ ),
+ type: zod.enum(['message']),
+ })
+ .describe('A root message with its bounded thread preview.'),
+ zod
+ .object({
+ activity: zod
+ .object({
+ action: zod
+ .string()
+ .describe(
+ 'Durable action tag. Unknown tags remain representable during rollouts.'
+ ),
+ actor_id: zod
+ .string()
+ .describe('Principal who performed the action.'),
+ id: zod
+ .uuid()
+ .describe(
+ 'Stable activity identity, independent of message ids.'
+ ),
+ occurred_at: zod.iso
+ .datetime({})
+ .describe('Immutable chronological position.'),
+ payload: zod
+ .unknown()
+ .optional()
+ .describe("The action's stored payload."),
+ })
+ .describe(
+ 'A displayable fact returned together with a message page.'
+ ),
+ type: zod.enum(['activity']),
+ })
+ .describe(
+ 'A recorded fact about the parent, such as a rename or a finished call.'
+ ),
+ ])
+ .describe("One chronological entry in a parent's timeline.")
+ )
+ .describe('Messages and activity, newest first.'),
+ next_cursor: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ created_at: zod.iso
+ .datetime({})
+ .describe(
+ 'Last message creation time or activity occurrence time.'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Last entry UUID, used to break timestamp ties across both sources.'
+ ),
+ })
+ .describe('Cursor for a chronological parent timeline.'),
+ ])
+ .optional(),
+ previous_cursor: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ created_at: zod.iso
+ .datetime({})
+ .describe(
+ 'Last message creation time or activity occurrence time.'
+ ),
+ id: zod
+ .uuid()
+ .describe(
+ 'Last entry UUID, used to break timestamp ties across both sources.'
+ ),
+ })
+ .describe('Cursor for a chronological parent timeline.'),
+ ])
+ .optional(),
+ })
+ .describe(
+ "A bounded, newest-first window of a parent's messages and activity, ordered\nby the server on one `(timestamp, id)` keyset."
+ );
+
/**
* @summary Broadcast typing within an authorized discussion.
*/
diff --git a/apps/web/src/lib/service-clients/service-storage/messages.test.ts b/apps/web/src/lib/service-clients/service-storage/messages.test.ts
new file mode 100644
index 0000000000..f033f71bb4
--- /dev/null
+++ b/apps/web/src/lib/service-clients/service-storage/messages.test.ts
@@ -0,0 +1,57 @@
+import { ok } from 'neverthrow';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+const mocks = vi.hoisted(() => ({ dssFetch: vi.fn() }));
+
+vi.mock('./client', () => ({ dssFetch: mocks.dssFetch }));
+
+import { entityMessagesClient } from './messages';
+
+const parent = { type: 'channel', id: 'channel-1' } as const;
+const activity = {
+ id: 'activity-1',
+ actor_id: 'macro|[email protected]',
+ occurred_at: '2026-10-07T12:00:00Z',
+ action: 'renamed',
+ payload: { to: 'Planning' },
+};
+
+beforeEach(() => {
+ mocks.dssFetch.mockReset();
+});
+
+describe('entityMessagesClient.timeline', () => {
+ it('reads the server-ordered timeline route', async () => {
+ mocks.dssFetch.mockResolvedValueOnce(
+ ok({ entries: [], next_cursor: null, previous_cursor: null })
+ );
+
+ await entityMessagesClient.timeline(parent, { limit: 50 });
+
+ expect(mocks.dssFetch).toHaveBeenCalledWith(
+ `/messages/channel/channel-1/timeline?${new URLSearchParams({
+ selection: JSON.stringify({ limit: 50 }),
+ })}`,
+ expect.objectContaining({ method: 'GET' })
+ );
+ });
+
+ it('skips entry kinds a newer server added', async () => {
+ const next_cursor = { id: 'poll-1', created_at: '2026-10-07T11:00:00Z' };
+ mocks.dssFetch.mockResolvedValueOnce(
+ ok({
+ entries: [
+ { type: 'activity', activity },
+ { type: 'poll', poll: { id: 'poll-1' } },
+ ],
+ next_cursor,
+ previous_cursor: null,
+ })
+ );
+
+ const page = await entityMessagesClient.timeline(parent);
+
+ expect(page.entries).toEqual([{ type: 'activity', activity }]);
+ expect(page.next_cursor).toEqual(next_cursor);
+ });
+});
diff --git a/apps/web/src/lib/service-clients/service-storage/messages.ts b/apps/web/src/lib/service-clients/service-storage/messages.ts
index c2a26bee4a..d7f31b93ee 100644
--- a/apps/web/src/lib/service-clients/service-storage/messages.ts
+++ b/apps/web/src/lib/service-clients/service-storage/messages.ts
@@ -41,14 +41,36 @@ export type MessageListItem =
import('./generated/schemas/messageListItem').MessageListItem & {
sender?: MessageSender;
};
-export type MessageTimelinePage = Omit<
+/** Root messages only, for callers that select specific discussions. */
+export type MessageListPage = Omit<
import('./generated/schemas/messagePage').MessagePage,
'items'
> & { items: MessageListItem[] };
+export type MessageTimelineEntry =
+ | { type: 'message'; message: MessageListItem }
+ | { type: 'activity'; activity: TimelineActivity };
+/** Messages and the parent's activity in one server-ordered, newest-first list. */
+export type MessageTimelinePage = Omit<
+ import('./generated/schemas/messageTimelinePage').MessageTimelinePage,
+ 'entries'
+> & { entries: MessageTimelineEntry[] };
+export type TimelineActivity =
+ import('./generated/schemas/timelineActivity').TimelineActivity;
+/** A page as sent: a newer server may add entry kinds this client predates. */
+type ReceivedTimelinePage = Omit<MessageTimelinePage, 'entries'> & {
+ entries: (MessageTimelineEntry | { type: string })[];
+};
+
export type { MessageTimelineQuery } from './generated/schemas/messageTimelineQuery';
import type { MessageTimelineQuery } from './generated/schemas/messageTimelineQuery';
+function isKnownEntry(
+ entry: MessageTimelineEntry | { type: string }
+): entry is MessageTimelineEntry {
+ return entry.type === 'message' || entry.type === 'activity';
+}
+
function path(parent: MessageParent) {
return `/messages/${parent.type}/${encodeURIComponent(parent.id)}`;
}
@@ -68,10 +90,21 @@ async function request<T extends object>(
export const entityMessagesClient = {
list(parent: MessageParent, selection: MessageTimelineQuery = {}) {
- return request<MessageTimelinePage>(
+ return request<MessageListPage>(
`${path(parent)}?${new URLSearchParams({ selection: JSON.stringify(selection) })}`
);
},
+ async timeline(
+ parent: MessageParent,
+ selection: MessageTimelineQuery = {}
+ ): Promise<MessageTimelinePage> {
+ const page = await request<ReceivedTimelinePage>(
+ `${path(parent)}/timeline?${new URLSearchParams({ selection: JSON.stringify(selection) })}`
+ );
+ // Skip kinds this client can't render instead of failing the timeline;
+ // the page's cursors still continue past them.
+ return { ...page, entries: page.entries.filter(isKnownEntry) };
+ },
get(parent: MessageParent, id: string) {
return request<Message>(`${path(parent)}/items/${encodeURIComponent(id)}`);
},
diff --git a/apps/web/src/lib/service-clients/service-storage/openapi.json b/apps/web/src/lib/service-clients/service-storage/openapi.json
index adfa74dc69..ae00aa50a2 100644
--- a/apps/web/src/lib/service-clients/service-storage/openapi.json
+++ b/apps/web/src/lib/service-clients/service-storage/openapi.json
@@ -14516,6 +14516,52 @@
}
}
},
+ "/messages/{parent_type}/{parent_id}/timeline": {
+ "get": {
+ "tags": ["messages::inbound::axum_router"],
+ "summary": "Read a bounded window of messages and the parent's activity, ordered by the server.",
+ "operationId": "message_timeline_entries",
+ "parameters": [
+ {
+ "name": "parent_type",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "parent_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "selection",
+ "in": "query",
+ "description": "Serialized MessageTimelineQuery; absent selects the latest roots.",
+ "required": false,
+ "schema": {
+ "type": ["string", "null"]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageTimelinePage"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/messages/{parent_type}/{parent_id}/typing": {
"post": {
"tags": ["messages::inbound::axum_router"],
@@ -21059,6 +21105,22 @@
}
}
},
+ "ChannelPictureChangedMetadata": {
+ "type": "object",
+ "description": "Metadata for a channel picture update, including removals.",
+ "required": ["channel_id", "actor"],
+ "properties": {
+ "actor": {
+ "$ref": "#/components/schemas/MacroUserIdStr",
+ "description": "User who changed the picture."
+ },
+ "channel_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Channel whose picture changed."
+ }
+ }
+ },
"ChannelPreview": {
"oneOf": [
{
@@ -21199,6 +21261,21 @@
},
"ChannelTopicEvent": {
"oneOf": [
+ {
+ "type": "object",
+ "description": "A channel's profile picture changed.",
+ "required": ["metadata", "event_type"],
+ "properties": {
+ "event_type": {
+ "type": "string",
+ "enum": ["channel.picture_changed"]
+ },
+ "metadata": {
+ "$ref": "#/components/schemas/ChannelPictureChangedMetadata",
+ "description": "A channel's profile picture changed."
+ }
+ }
+ },
{
"type": "object",
"description": "A channel was created.",
@@ -30826,12 +30903,12 @@
"created_at": {
"type": "string",
"format": "date-time",
- "description": "Last root creation time."
+ "description": "Last message creation time or activity occurrence time."
},
"id": {
"type": "string",
"format": "uuid",
- "description": "Last root UUID, used to break timestamp ties."
+ "description": "Last entry UUID, used to break timestamp ties across both sources."
}
}
},
@@ -31321,6 +31398,77 @@
}
}
},
+ "MessageTimelineEntry": {
+ "oneOf": [
+ {
+ "type": "object",
+ "description": "A root message with its bounded thread preview.",
+ "required": ["message", "type"],
+ "properties": {
+ "message": {
+ "$ref": "#/components/schemas/MessageListItem",
+ "description": "The message and thread state."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["message"]
+ }
+ }
+ },
+ {
+ "type": "object",
+ "description": "A recorded fact about the parent, such as a rename or a finished call.",
+ "required": ["activity", "type"],
+ "properties": {
+ "activity": {
+ "$ref": "#/components/schemas/TimelineActivity",
+ "description": "The recorded activity."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["activity"]
+ }
+ }
+ }
+ ],
+ "description": "One chronological entry in a parent's timeline."
+ },
+ "MessageTimelinePage": {
+ "type": "object",
+ "description": "A bounded, newest-first window of a parent's messages and activity, ordered\nby the server on one `(timestamp, id)` keyset.",
+ "required": ["entries"],
+ "properties": {
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MessageTimelineEntry"
+ },
+ "description": "Messages and activity, newest first."
+ },
+ "next_cursor": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/MessageCursor",
+ "description": "Continue to older entries."
+ }
+ ]
+ },
+ "previous_cursor": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/MessageCursor",
+ "description": "Continue to newer entries."
+ }
+ ]
+ }
+ }
+ },
"MessageTimelineQuery": {
"type": "object",
"description": "Root selection shared by channel timelines and document discussions.",
@@ -38291,6 +38439,34 @@
}
}
},
+ "TimelineActivity": {
+ "type": "object",
+ "description": "A displayable fact returned together with a message page.",
+ "required": ["id", "actor_id", "occurred_at", "action"],
+ "properties": {
+ "action": {
+ "type": "string",
+ "description": "Durable action tag. Unknown tags remain representable during rollouts."
+ },
+ "actor_id": {
+ "type": "string",
+ "description": "Principal who performed the action."
+ },
+ "id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Stable activity identity, independent of message ids."
+ },
+ "occurred_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Immutable chronological position."
+ },
+ "payload": {
+ "description": "The action's stored payload."
+ }
+ }
+ },
"TouchedColumn": {
"type": "object",
"description": "A column a table's changes since some version touched.",
diff --git a/crates/activity/Cargo.toml b/crates/activity/Cargo.toml
index 7cc5dfcccb..3fbf0066b0 100644
--- a/crates/activity/Cargo.toml
+++ b/crates/activity/Cargo.toml
@@ -5,6 +5,7 @@ publish = false
version = "0.1.0"
[features]
+schema = ["dep:utoipa"]
ai_tools = ["dep:ai_toolset", "dep:async-trait", "dep:schemars", "dep:tracing"]
consumer = [
"dep:kafka_util",
@@ -27,6 +28,7 @@ realtime = [
]
[dependencies]
+utoipa = { workspace = true, optional = true }
ai_toolset = { path = "../ai_toolset", optional = true }
async-trait = { workspace = true, optional = true }
broadcast = { path = "../broadcast", optional = true }
diff --git a/crates/activity/src/domain/mod.rs b/crates/activity/src/domain/mod.rs
index 168c47d2e0..5d333a66f6 100644
--- a/crates/activity/src/domain/mod.rs
+++ b/crates/activity/src/domain/mod.rs
@@ -9,6 +9,7 @@ pub mod ports;
pub mod realtime;
#[cfg(feature = "ai_tools")]
pub mod service;
+pub mod timeline;
#[cfg(feature = "consumer")]
pub mod announcements;
diff --git a/crates/activity/src/domain/models.rs b/crates/activity/src/domain/models.rs
index 1d713a76c6..75159bc3a1 100644
--- a/crates/activity/src/domain/models.rs
+++ b/crates/activity/src/domain/models.rs
@@ -177,9 +177,11 @@ pub struct InitiativeTaskChange {
#[strum(serialize_all = "snake_case")]
#[strum_discriminants(
name(ActionTag),
- vis(pub(crate)),
- derive(strum::EnumString),
- strum(serialize_all = "snake_case")
+ vis(pub),
+ derive(Hash, strum::EnumString, strum::IntoStaticStr),
+ strum(serialize_all = "snake_case"),
+ doc = "An [`Action`] without its payload: the stored `action` tag, for",
+ doc = "selecting which actions a read returns."
)]
pub enum Action {
/// The entity was created.
@@ -205,12 +207,36 @@ pub enum Action {
ParticipantRemoved(ParticipantChange),
/// A call was started in the entity (channel).
CallStarted(CallStart),
+ /// The entity was renamed.
+ Renamed(NameChange),
+ /// The entity's profile picture was set or removed.
+ PictureChanged,
+ /// A call finished in the entity.
+ CallEnded(CallEnd),
/// A task was added to an initiative.
TaskAdded(InitiativeTaskChange),
/// A task was removed from an initiative.
TaskRemoved(InitiativeTaskChange),
}
+/// The names captured when an entity is renamed.
+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
+pub struct NameChange {
+ /// Previous display name.
+ pub from: Option<String>,
+ /// New display name.
+ pub to: Option<String>,
+}
+
+/// Completed call facts, independent of recording availability.
+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
+pub struct CallEnd {
+ /// Call identifier.
+ pub call_id: String,
+ /// Duration in milliseconds.
+ pub duration_ms: i64,
+}
+
impl From<CommonAction> for Action {
fn from(action: CommonAction) -> Self {
match action {
@@ -256,12 +282,15 @@ impl Action {
| Action::Deleted
| Action::Messaged
| Action::Sent
+ | Action::PictureChanged
| Action::Responded => None,
Action::PropertyChanged(change) => payload(change),
Action::ParticipantAdded(change) | Action::ParticipantRemoved(change) => {
payload(change)
}
Action::CallStarted(start) => payload(start),
+ Action::Renamed(change) => payload(change),
+ Action::CallEnded(end) => payload(end),
Action::TaskAdded(change) | Action::TaskRemoved(change) => payload(change),
};
(tag, payload)
@@ -273,8 +302,8 @@ impl Action {
/// A payload on a payload-free tag is ignored — a newer writer may have
/// started attaching one, and old readers must keep decoding the tag they
/// know. The tag vocabulary is the same strum derivation `to_columns`
- /// writes with (the crate-private `ActionTag` discriminant enum, derived
- /// from the variant names), and the match below is exhaustive on it — a
+ /// writes with (the [`ActionTag`] discriminant enum, derived from the
+ /// variant names), and the match below is exhaustive on it — a
/// new variant fails compilation here until its decode is written.
pub fn from_columns(tag: &str, payload: Option<&Value>) -> Result<Self, ActionDecodeError> {
// Deserializing from `&Value` borrows; no payload clone on the read
@@ -301,6 +330,9 @@ impl Action {
ActionTag::ParticipantAdded => Ok(Action::ParticipantAdded(parsed(payload)?)),
ActionTag::ParticipantRemoved => Ok(Action::ParticipantRemoved(parsed(payload)?)),
ActionTag::CallStarted => Ok(Action::CallStarted(parsed(payload)?)),
+ ActionTag::Renamed => Ok(Action::Renamed(parsed(payload)?)),
+ ActionTag::PictureChanged => Ok(Action::PictureChanged),
+ ActionTag::CallEnded => Ok(Action::CallEnded(parsed(payload)?)),
ActionTag::TaskAdded => Ok(Action::TaskAdded(parsed(payload)?)),
ActionTag::TaskRemoved => Ok(Action::TaskRemoved(parsed(payload)?)),
}
diff --git a/crates/activity/src/domain/models/test.rs b/crates/activity/src/domain/models/test.rs
index 75510f6b51..14a2e61289 100644
--- a/crates/activity/src/domain/models/test.rs
+++ b/crates/activity/src/domain/models/test.rs
@@ -19,6 +19,23 @@ fn every_action_maps_to_stable_columns() {
(Action::Deleted, "deleted", None),
(Action::Messaged, "messaged", None),
(Action::Sent, "sent", None),
+ (Action::PictureChanged, "picture_changed", None),
+ (
+ Action::Renamed(NameChange {
+ from: Some("Old".into()),
+ to: Some("New".into()),
+ }),
+ "renamed",
+ Some(json!({"from":"Old", "to":"New"})),
+ ),
+ (
+ Action::CallEnded(CallEnd {
+ call_id: "call-1".into(),
+ duration_ms: 480_000,
+ }),
+ "call_ended",
+ Some(json!({"call_id":"call-1", "duration_ms":480_000})),
+ ),
(Action::Responded, "responded", None),
(
Action::TaskAdded(InitiativeTaskChange {
@@ -67,6 +84,9 @@ fn every_action_maps_to_stable_columns() {
for (action, expected_tag, expected_payload) in cases {
let (tag, payload) = action.to_columns();
assert_eq!(tag, expected_tag, "tag for {action:?}");
+ // Reads select by `ActionTag`; it must name the same stored string.
+ let selected: &str = ActionTag::from(&action).into();
+ assert_eq!(selected, expected_tag, "ActionTag for {action:?}");
assert_eq!(payload, expected_payload, "payload for {action:?}");
// VIEW_ACTION_TAGS is the SQL-side mirror of is_view: every variant
// must agree so tag-filtering queries classify rows identically.
@@ -88,12 +108,13 @@ fn every_action_maps_to_stable_columns() {
fn unknown_tags_decode_to_recorded_unknown_preserving_the_row() {
let payload = Some(json!({ "novel": true }));
- let (recorded, error) = RecordedAction::from_columns("renamed".to_string(), payload.clone());
+ let (recorded, error) =
+ RecordedAction::from_columns("future_action".to_string(), payload.clone());
assert_eq!(
recorded,
RecordedAction::Unknown {
- tag: "renamed".to_string(),
+ tag: "future_action".to_string(),
payload,
}
);
diff --git a/crates/activity/src/domain/ports.rs b/crates/activity/src/domain/ports.rs
index 5a882e4ba4..890c60a39a 100644
--- a/crates/activity/src/domain/ports.rs
+++ b/crates/activity/src/domain/ports.rs
@@ -79,6 +79,21 @@ pub trait ActivityRealtimePublisher: Send + Sync {
fn publish_invalidated(&self) -> impl Future<Output = ()> + Send;
}
+/// Announce through both publishers, in order; each remains best-effort.
+impl<A: ActivityRealtimePublisher, B: ActivityRealtimePublisher> ActivityRealtimePublisher
+ for (A, B)
+{
+ async fn publish_recorded(&self, activities: &[Activity]) {
+ self.0.publish_recorded(activities).await;
+ self.1.publish_recorded(activities).await;
+ }
+
+ async fn publish_invalidated(&self) {
+ self.0.publish_invalidated().await;
+ self.1.publish_invalidated().await;
+ }
+}
+
/// Resolves who may currently see an entity's activity.
///
/// Used at publish time to widen realtime delivery beyond the acting
diff --git a/crates/activity/src/domain/timeline.rs b/crates/activity/src/domain/timeline.rs
new file mode 100644
index 0000000000..f1b87bcb4a
--- /dev/null
+++ b/crates/activity/src/domain/timeline.rs
@@ -0,0 +1,138 @@
+//! Bounded activity reads for chronological timelines owned by other domains.
+use std::{future::Future, pin::Pin};
+
+use chrono::{DateTime, Utc};
+use serde::{Deserialize, Serialize};
+use uuid::Uuid;
+
+use super::models::{Action, ActionTag, Activity, EntityType};
+
+#[cfg(test)]
+mod test;
+
+/// A displayable fact returned together with a message page.
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+pub struct TimelineActivity {
+ /// Stable activity identity, independent of message ids.
+ pub id: Uuid,
+ /// Principal who performed the action.
+ pub actor_id: String,
+ /// Immutable chronological position.
+ pub occurred_at: DateTime<Utc>,
+ /// Durable action tag. Unknown tags remain representable during rollouts.
+ pub action: String,
+ /// The action's stored payload.
+ pub payload: Option<serde_json::Value>,
+}
+
+impl From<&Activity> for TimelineActivity {
+ /// The same projection a timeline read returns for the stored row.
+ fn from(activity: &Activity) -> Self {
+ let (action, payload) = activity.action.to_columns();
+ Self {
+ id: activity.id,
+ actor_id: activity.actor.as_ref().to_owned(),
+ occurred_at: activity.occurred_at,
+ action: action.to_owned(),
+ payload,
+ }
+ }
+}
+
+/// High-volume actions the timeline index leaves out: every message, view,
+/// content edit and email send records one, and timelines never show them.
+/// Storage repeats this list in the index predicate and in every timeline
+/// query; [`TimelineSelection::new`] refuses them so a selection can't name a
+/// row the index skipped.
+pub const UNINDEXED_TIMELINE_ACTIONS: &[ActionTag] = &[
+ ActionTag::Messaged,
+ ActionTag::Opened,
+ ActionTag::Edited,
+ ActionTag::Sent,
+];
+
+/// Which of an entity's activity a timeline shows. Reads apply it in storage
+/// and live delivery applies [`Self::includes`]; both match the same rows.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct TimelineSelection {
+ actions: &'static [ActionTag],
+ properties: &'static [Uuid],
+}
+
+impl TimelineSelection {
+ /// Show `actions`, with `property_changed` narrowed to `properties` (empty
+ /// keeps every property). Fails to compile in a `const` when an action is
+ /// in [`UNINDEXED_TIMELINE_ACTIONS`].
+ pub const fn new(actions: &'static [ActionTag], properties: &'static [Uuid]) -> Self {
+ let mut i = 0;
+ while i < actions.len() {
+ let mut j = 0;
+ while j < UNINDEXED_TIMELINE_ACTIONS.len() {
+ if actions[i] as usize == UNINDEXED_TIMELINE_ACTIONS[j] as usize {
+ panic!("timelines cannot show messaged, opened, edited or sent activity");
+ }
+ j += 1;
+ }
+ i += 1;
+ }
+ Self {
+ actions,
+ properties,
+ }
+ }
+
+ /// Whether a recorded action belongs in the timeline.
+ pub fn includes(&self, action: &Action) -> bool {
+ self.actions.contains(&ActionTag::from(action))
+ && match action {
+ // Compare the stored text exactly as storage does.
+ Action::PropertyChanged(change) => {
+ self.properties.is_empty()
+ || self
+ .properties
+ .iter()
+ .any(|property| property.to_string() == change.property)
+ }
+ _ => true,
+ }
+ }
+
+ /// Stored action tags, as storage compares them.
+ pub fn action_tags(&self) -> Vec<&'static str> {
+ self.actions.iter().map(|&tag| tag.into()).collect()
+ }
+
+ /// Property definition ids, as stored in `property_changed` payloads.
+ pub fn property_ids(&self) -> Vec<String> {
+ self.properties.iter().map(Uuid::to_string).collect()
+ }
+}
+
+/// Selection authorized by the owning timeline's domain service.
+pub struct ActivityTimelineQuery {
+ /// Parent kind.
+ pub entity_type: EntityType,
+ /// Parent identity.
+ pub entity_id: String,
+ /// The activity the timeline owner chose to show.
+ pub selection: TimelineSelection,
+ /// Exclusive timestamp and UUID boundary shared with messages.
+ pub cursor: Option<(DateTime<Utc>, Uuid)>,
+ /// Read forward from the boundary when true; backward otherwise.
+ pub newer: bool,
+ /// Maximum records to return, including the caller's lookahead.
+ pub limit: u16,
+}
+
+/// Error returned by an activity timeline reader.
+pub type TimelineReadError = Box<dyn std::error::Error + Send + Sync>;
+
+/// Read activity facts without crossing another domain's storage boundary.
+pub trait ActivityTimeline: Send + Sync + 'static {
+ /// Return the nearest matching records on one side of the cursor.
+ fn read<'a>(
+ &'a self,
+ query: ActivityTimelineQuery,
+ ) -> Pin<Box<dyn Future<Output = Result<Vec<TimelineActivity>, TimelineReadError>> + Send + 'a>>;
+}
diff --git a/crates/activity/src/domain/timeline/test.rs b/crates/activity/src/domain/timeline/test.rs
new file mode 100644
index 0000000000..17309c85cd
--- /dev/null
+++ b/crates/activity/src/domain/timeline/test.rs
@@ -0,0 +1,55 @@
+use super::*;
+use crate::domain::models::{NameChange, PropertyChange};
+
+const STATUS: Uuid = Uuid::from_u128(0xab);
+const ASSIGNEE: Uuid = Uuid::from_u128(2);
+
+fn property_changed(property: &str) -> Action {
+ Action::PropertyChanged(PropertyChange {
+ property: property.to_owned(),
+ from: None,
+ to: Some(serde_json::json!("Done")),
+ })
+}
+
+#[test]
+fn selection_includes_only_its_actions() {
+ let selection = TimelineSelection::new(&[ActionTag::Renamed, ActionTag::PictureChanged], &[]);
+ assert!(selection.includes(&Action::PictureChanged));
+ assert!(selection.includes(&Action::Renamed(NameChange {
+ from: None,
+ to: Some("New".into()),
+ })));
+ assert!(!selection.includes(&Action::Edited));
+ assert!(!selection.includes(&property_changed(&STATUS.to_string())));
+ assert_eq!(selection.action_tags(), ["renamed", "picture_changed"]);
+}
+
+#[test]
+fn properties_narrow_property_changes_only() {
+ let selection = TimelineSelection::new(
+ &[ActionTag::PropertyChanged, ActionTag::Created],
+ &[STATUS, ASSIGNEE],
+ );
+ assert!(selection.includes(&property_changed(&STATUS.to_string())));
+ assert!(selection.includes(&property_changed(&ASSIGNEE.to_string())));
+ assert!(!selection.includes(&property_changed(&Uuid::from_u128(3).to_string())));
+ assert!(!selection.includes(&property_changed("not-a-uuid")));
+ // Storage compares text, so a differently formatted id matches neither.
+ assert!(!selection.includes(&property_changed(&STATUS.to_string().to_uppercase())));
+ assert!(selection.includes(&Action::Created));
+ assert_eq!(
+ selection.property_ids(),
+ [STATUS.to_string(), ASSIGNEE.to_string()]
+ );
+
+ let every_property =
+ TimelineSelection::new(&[ActionTag::PropertyChanged, ActionTag::Created], &[]);
+ assert!(every_property.includes(&property_changed("any-property")));
+}
+
+#[test]
+#[should_panic(expected = "timelines cannot show")]
+fn selections_cannot_name_actions_the_index_skips() {
+ TimelineSelection::new(&[ActionTag::Renamed, ActionTag::Edited], &[]);
+}
diff --git a/crates/activity/src/inbound/toolset/read_activity.rs b/crates/activity/src/inbound/toolset/read_activity.rs
index 4e15874b77..2cfa2a22ac 100644
--- a/crates/activity/src/inbound/toolset/read_activity.rs
+++ b/crates/activity/src/inbound/toolset/read_activity.rs
@@ -150,6 +150,15 @@ impl ToolActivityAction {
},
RecordedAction::Known(Action::TaskAdded(_)) => Self::TaskAdded,
RecordedAction::Known(Action::TaskRemoved(_)) => Self::TaskRemoved,
+ RecordedAction::Known(
+ action @ (Action::Renamed(_) | Action::PictureChanged | Action::CallEnded(_)),
+ ) => {
+ let (tag, payload) = action.to_columns();
+ Self::Unknown {
+ tag: tag.to_owned(),
+ payload,
+ }
+ }
RecordedAction::Unknown { tag, payload } => Self::Unknown { tag, payload },
}
}
diff --git a/crates/activity/src/lib.rs b/crates/activity/src/lib.rs
index 6ca8b9ca2e..62b274e87f 100644
--- a/crates/activity/src/lib.rs
+++ b/crates/activity/src/lib.rs
@@ -29,8 +29,8 @@ pub mod outbound;
pub use domain::events::{ActivityMacroEvent, ActivityTopicEvent, ActivityWireRow};
pub use domain::models::{
- Action, ActionDecodeError, Activity, ActivityRecord, ActivitySource, Actor, Attribution,
- CallStart, CommonAction, DomainActivity, EntityType, Ingest, InitiativeTaskChange,
+ Action, ActionDecodeError, ActionTag, Activity, ActivityRecord, ActivitySource, Actor,
+ Attribution, CallStart, CommonAction, DomainActivity, EntityType, Ingest, InitiativeTaskChange,
ParticipantChange, PropertyChange, RecordedAction, VIEW_ACTION_TAGS, activity_id, event_time,
};
pub use domain::overview::{
diff --git a/crates/activity/src/outbound/pg_activity_repo.rs b/crates/activity/src/outbound/pg_activity_repo.rs
index d19fb9d261..14a55275b5 100644
--- a/crates/activity/src/outbound/pg_activity_repo.rs
+++ b/crates/activity/src/outbound/pg_activity_repo.rs
@@ -2,6 +2,7 @@
#[cfg(test)]
mod test;
+mod timeline;
mod entity_history;
diff --git a/crates/activity/src/outbound/pg_activity_repo/test.rs b/crates/activity/src/outbound/pg_activity_repo/test.rs
index 992ca8fc59..add24c4da0 100644
--- a/crates/activity/src/outbound/pg_activity_repo/test.rs
+++ b/crates/activity/src/outbound/pg_activity_repo/test.rs
@@ -4,7 +4,7 @@ use macro_user_id::user_id::MacroUserIdStr;
use uuid::Uuid;
use super::*;
-use crate::domain::models::{Action, Actor, CommonAction};
+use crate::domain::models::{Action, ActionTag, Actor, CommonAction, PropertyChange};
use crate::domain::ports::EntityActivityReads;
fn user(id: &str) -> MacroUserIdStr<'static> {
@@ -782,3 +782,163 @@ async fn subject_overview_includes_first_havana_midnight_when_window_starts_on_f
);
assert_eq!(ending_on_fallback.total(), 1);
}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn timeline_filters_parents_actions_and_pages_both_directions(pool: PgPool) {
+ use crate::domain::timeline::{ActivityTimeline, ActivityTimelineQuery, TimelineSelection};
+ let repo = PgActivityRepo::new(pool);
+ let rows: Vec<_> = [
+ (101, CommonAction::Created, "timeline"),
+ (102, CommonAction::Deleted, "timeline"),
+ (103, CommonAction::Opened, "timeline"),
+ (104, CommonAction::Created, "other"),
+ (105, CommonAction::Created, "timeline"),
+ ]
+ .into_iter()
+ .map(|(id, action, entity)| {
+ Activity::common(
+ Uuid::from_u128(id),
+ 0,
+ Actor::new_from_user(user("macro|[email protected]")),
+ None,
+ EntityType::Document,
+ entity,
+ action,
+ chrono::DateTime::from_timestamp(1_000, 0).unwrap(),
+ )
+ })
+ .collect();
+ repo.insert_activities(&rows).await.unwrap();
+ let mut expected: Vec<_> = rows
+ .iter()
+ .filter(|row| row.entity_id == "timeline" && row.action != Action::Opened)
+ .map(|row| row.id)
+ .collect();
+ expected.sort_by(|a, b| b.cmp(a));
+ let query = |cursor, newer, limit| ActivityTimelineQuery {
+ entity_type: EntityType::Document,
+ entity_id: "timeline".into(),
+ selection: TimelineSelection::new(&[ActionTag::Created, ActionTag::Deleted], &[]),
+ cursor,
+ newer,
+ limit,
+ };
+ let first = repo.read(query(None, false, 2)).await.unwrap();
+ assert_eq!(
+ first.iter().map(|r| r.id).collect::<Vec<_>>(),
+ expected[..2]
+ );
+ let last = first.last().unwrap();
+ let older = repo
+ .read(query(Some((last.occurred_at, last.id)), false, 2))
+ .await
+ .unwrap();
+ assert_eq!(
+ older.iter().map(|r| r.id).collect::<Vec<_>>(),
+ expected[2..]
+ );
+ let newer = repo
+ .read(query(Some((older[0].occurred_at, older[0].id)), true, 2))
+ .await
+ .unwrap();
+ assert_eq!(
+ newer.iter().map(|r| r.id).collect::<Vec<_>>(),
+ vec![expected[1], expected[0]]
+ );
+ let from_start = repo.read(query(None, true, 2)).await.unwrap();
+ assert_eq!(
+ from_start.iter().map(|row| row.id).collect::<Vec<_>>(),
+ vec![expected[2], expected[1]]
+ );
+ for (newer, boundary) in [(true, &first[0]), (false, &older[0])] {
+ assert!(
+ repo.read(query(Some((boundary.occurred_at, boundary.id)), newer, 2))
+ .await
+ .unwrap()
+ .is_empty(),
+ "exhausted cursors never repeat the boundary entry"
+ );
+ }
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn timeline_properties_narrow_property_changes_in_storage(pool: PgPool) {
+ use crate::domain::timeline::{ActivityTimeline, ActivityTimelineQuery, TimelineSelection};
+ const STATUS: Uuid = Uuid::from_u128(1);
+ let repo = PgActivityRepo::new(pool);
+ let changed = |property: Uuid| {
+ CommonAction::PropertyChanged(PropertyChange {
+ property: property.to_string(),
+ from: None,
+ to: Some(serde_json::json!("Done")),
+ })
+ };
+ let rows: Vec<_> = [
+ (201, changed(STATUS)),
+ (202, changed(Uuid::from_u128(2))),
+ (203, CommonAction::Created),
+ (204, CommonAction::Edited),
+ ]
+ .into_iter()
+ .map(|(id, action)| {
+ Activity::common(
+ Uuid::from_u128(id),
+ 0,
+ Actor::new_from_user(user("macro|[email protected]")),
+ None,
+ EntityType::Document,
+ "task",
+ action,
+ chrono::DateTime::from_timestamp(1_000 + id as i64, 0).unwrap(),
+ )
+ })
+ .collect();
+ repo.insert_activities(&rows).await.unwrap();
+ for properties in [&[STATUS][..], &[]] {
+ let selection = TimelineSelection::new(
+ &[ActionTag::PropertyChanged, ActionTag::Created],
+ properties,
+ );
+ let read = repo
+ .read(ActivityTimelineQuery {
+ entity_type: EntityType::Document,
+ entity_id: "task".into(),
+ selection,
+ cursor: None,
+ newer: false,
+ limit: 10,
+ })
+ .await
+ .unwrap();
+ // Storage and live delivery must agree on every row.
+ let mut expected: Vec<_> = rows
+ .iter()
+ .filter(|row| selection.includes(&row.action))
+ .map(|row| row.id)
+ .collect();
+ expected.reverse();
+ assert_eq!(read.iter().map(|row| row.id).collect::<Vec<_>>(), expected);
+ }
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn timeline_index_skips_exactly_the_unindexed_actions(pool: PgPool) {
+ use crate::domain::timeline::UNINDEXED_TIMELINE_ACTIONS;
+ let predicate: String = sqlx::query_scalar(
+ "SELECT pg_get_expr(indpred, indrelid) FROM pg_index
+ WHERE indexrelid = 'idx_activity_events_entity_action_timeline'::regclass",
+ )
+ .fetch_one(&pool)
+ .await
+ .unwrap();
+ // Timeline queries repeat this predicate; a drift would leave them
+ // falling back to the wider entity index.
+ let tags: Vec<String> = UNINDEXED_TIMELINE_ACTIONS
+ .iter()
+ .map(|&tag| format!("'{}'::text", <&str>::from(tag)))
+ .collect();
+ assert_eq!(
+ predicate,
+ format!("(action <> ALL (ARRAY[{}]))", tags.join(", "))
+ );
+}
diff --git a/crates/activity/src/outbound/pg_activity_repo/timeline.rs b/crates/activity/src/outbound/pg_activity_repo/timeline.rs
new file mode 100644
index 0000000000..5208ba99dd
--- /dev/null
+++ b/crates/activity/src/outbound/pg_activity_repo/timeline.rs
@@ -0,0 +1,143 @@
+//! Activity-owned keyset reads for mixed timelines.
+use super::PgActivityRepo;
+use crate::domain::timeline::{
+ ActivityTimeline, ActivityTimelineQuery, TimelineActivity, TimelineReadError,
+};
+
+impl ActivityTimeline for PgActivityRepo {
+ fn read<'a>(
+ &'a self,
+ query: ActivityTimelineQuery,
+ ) -> std::pin::Pin<
+ Box<dyn Future<Output = Result<Vec<TimelineActivity>, TimelineReadError>> + Send + 'a>,
+ > {
+ Box::pin(async move {
+ // Keep cursor predicates separate from the first-page queries so
+ // generic prepared plans seek into the keyset index instead of
+ // scanning and filtering everything on the other side of it. The
+ // property filter only narrows `property_changed` seeks, inside the
+ // limit, so callers' lookahead stays exact. The NOT IN list repeats
+ // the partial index predicate (UNINDEXED_TIMELINE_ACTIONS) so the
+ // planner can prove the index applies.
+ let actions = query.selection.action_tags();
+ let properties = query.selection.property_ids();
+ let rows = match (query.newer, query.cursor) {
+ (true, None) => {
+ sqlx::query_as!(
+ TimelineActivity,
+ r#"
+ SELECT event.id AS "id!", event.actor_id AS "actor_id!",
+ event.occurred_at AS "occurred_at!", event.action AS "action!", event.payload
+ FROM unnest($3::text[]) selected(action)
+ CROSS JOIN LATERAL (
+ SELECT id, actor_id, occurred_at, action, action_payload AS payload
+ FROM activity_events
+ WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action
+ AND action NOT IN ('messaged', 'opened', 'edited', 'sent')
+ AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0
+ OR action_payload->>'property' = ANY($4::text[]))
+ ORDER BY occurred_at ASC, id ASC LIMIT $5
+ ) event
+ ORDER BY event.occurred_at ASC, event.id ASC LIMIT $5
+ "#,
+ query.entity_type.as_ref(),
+ query.entity_id,
+ &actions as &[&str],
+ &properties,
+ i64::from(query.limit)
+ )
+ .fetch_all(&self.pool)
+ .await?
+ }
+ (true, Some((cursor_at, cursor_id))) => {
+ sqlx::query_as!(
+ TimelineActivity,
+ r#"
+ SELECT event.id AS "id!", event.actor_id AS "actor_id!",
+ event.occurred_at AS "occurred_at!", event.action AS "action!", event.payload
+ FROM unnest($3::text[]) selected(action)
+ CROSS JOIN LATERAL (
+ SELECT id, actor_id, occurred_at, action, action_payload AS payload
+ FROM activity_events
+ WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action
+ AND action NOT IN ('messaged', 'opened', 'edited', 'sent')
+ AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0
+ OR action_payload->>'property' = ANY($4::text[]))
+ AND (occurred_at, id) > ($5, $6)
+ ORDER BY occurred_at ASC, id ASC LIMIT $7
+ ) event
+ ORDER BY event.occurred_at ASC, event.id ASC LIMIT $7
+ "#,
+ query.entity_type.as_ref(),
+ query.entity_id,
+ &actions as &[&str],
+ &properties,
+ cursor_at,
+ cursor_id,
+ i64::from(query.limit)
+ )
+ .fetch_all(&self.pool)
+ .await?
+ }
+ (false, None) => {
+ sqlx::query_as!(
+ TimelineActivity,
+ r#"
+ SELECT event.id AS "id!", event.actor_id AS "actor_id!",
+ event.occurred_at AS "occurred_at!", event.action AS "action!", event.payload
+ FROM unnest($3::text[]) selected(action)
+ CROSS JOIN LATERAL (
+ SELECT id, actor_id, occurred_at, action, action_payload AS payload
+ FROM activity_events
+ WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action
+ AND action NOT IN ('messaged', 'opened', 'edited', 'sent')
+ AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0
+ OR action_payload->>'property' = ANY($4::text[]))
+ ORDER BY occurred_at DESC, id DESC LIMIT $5
+ ) event
+ ORDER BY event.occurred_at DESC, event.id DESC LIMIT $5
+ "#,
+ query.entity_type.as_ref(),
+ query.entity_id,
+ &actions as &[&str],
+ &properties,
+ i64::from(query.limit)
+ )
+ .fetch_all(&self.pool)
+ .await?
+ }
+ (false, Some((cursor_at, cursor_id))) => {
+ sqlx::query_as!(
+ TimelineActivity,
+ r#"
+ SELECT event.id AS "id!", event.actor_id AS "actor_id!",
+ event.occurred_at AS "occurred_at!", event.action AS "action!", event.payload
+ FROM unnest($3::text[]) selected(action)
+ CROSS JOIN LATERAL (
+ SELECT id, actor_id, occurred_at, action, action_payload AS payload
+ FROM activity_events
+ WHERE entity_type = $1 AND entity_id = $2 AND action = selected.action
+ AND action NOT IN ('messaged', 'opened', 'edited', 'sent')
+ AND (selected.action <> 'property_changed' OR cardinality($4::text[]) = 0
+ OR action_payload->>'property' = ANY($4::text[]))
+ AND (occurred_at, id) < ($5, $6)
+ ORDER BY occurred_at DESC, id DESC LIMIT $7
+ ) event
+ ORDER BY event.occurred_at DESC, event.id DESC LIMIT $7
+ "#,
+ query.entity_type.as_ref(),
+ query.entity_id,
+ &actions as &[&str],
+ &properties,
+ cursor_at,
+ cursor_id,
+ i64::from(query.limit)
+ )
+ .fetch_all(&self.pool)
+ .await?
+ }
+ };
+ Ok(rows)
+ })
+ }
+}
diff --git a/crates/call/src/domain/activity.rs b/crates/call/src/domain/activity.rs
index 564d218561..dea2d404b2 100644
--- a/crates/call/src/domain/activity.rs
+++ b/crates/call/src/domain/activity.rs
@@ -41,6 +41,22 @@ impl DomainActivity for CallStartedActivity {
}
}
+/// Channel-targeted completion of a call.
+struct CallEndedActivity {
+ channel_id: String,
+ end: ::activity::domain::models::CallEnd,
+}
+
+impl DomainActivity for CallEndedActivity {
+ const ENTITY_TYPE: EntityType = EntityType::Channel;
+ fn entity_id(&self) -> &str {
+ &self.channel_id
+ }
+ fn into_action(self) -> Action {
+ Action::CallEnded(self.end)
+ }
+}
+
impl ActivitySource for CallTopicEvent {
/// Maps one `macro.calls` event to its ingest outcome.
///
@@ -48,6 +64,27 @@ impl ActivitySource for CallTopicEvent {
/// until someone classifies it or explicitly drops it.
fn ingest(&self, event_id: Uuid) -> Ingest {
match self {
+ // Only channel calls have a timeline to record the ending in.
+ CallTopicEvent::RecordArchived(m) => match m.channel_id {
+ None => Ingest::Ignore,
+ Some(channel_id) => Ingest::Insert(vec![Activity::from_domain(
+ event_id,
+ 0,
+ Actor::new_from_user(m.created_by.clone()),
+ None,
+ CallEndedActivity {
+ channel_id: channel_id.to_string(),
+ end: ::activity::domain::models::CallEnd {
+ call_id: m.call_id.to_string(),
+ duration_ms: m
+ .duration_ms
+ .unwrap_or_else(|| (m.ended_at - m.started_at).num_milliseconds())
+ .max(0),
+ },
+ },
+ m.ended_at,
+ )]),
+ },
// Two activities: the call happened in the channel (timeline/feed),
// and the call itself is a new entity (soup item).
CallTopicEvent::Started(m) => {
@@ -94,8 +131,7 @@ impl ActivitySource for CallTopicEvent {
Ingest::Purge(vec![(EntityType::Call, m.call_id.to_string())])
}
// Archival/processing pipeline, not user activity.
- CallTopicEvent::RecordArchived(_)
- | CallTopicEvent::RecordUpdated(_)
+ CallTopicEvent::RecordUpdated(_)
| CallTopicEvent::RecordSummarized(_)
| CallTopicEvent::RecordingReady(_) => Ingest::Ignore,
}
diff --git a/crates/call/src/domain/activity/test.rs b/crates/call/src/domain/activity/test.rs
index ef8ac8c0f5..4b2979784e 100644
--- a/crates/call/src/domain/activity/test.rs
+++ b/crates/call/src/domain/activity/test.rs
@@ -8,6 +8,53 @@ use macro_event_broker::Event;
use super::*;
use crate::domain::events::{CallRecordDeletedMetadata, CallStartedMetadata};
+fn archived(
+ channel_id: Option<Uuid>,
+ duration_ms: Option<i64>,
+ ended_at: chrono::DateTime<Utc>,
+) -> Event<CallTopicEvent> {
+ Event::with_event_id(
+ Uuid::now_v7(),
+ CallTopicEvent::RecordArchived(crate::domain::events::CallRecordArchivedMetadata {
+ call_id: Uuid::from_u128(5),
+ channel_id,
+ created_by: "macro|[email protected]".to_string().try_into().unwrap(),
+ started_at: ended_at - chrono::Duration::minutes(8),
+ ended_at,
+ duration_ms,
+ participant_count: 2,
+ has_recording: false,
+ archive_reason: crate::domain::events::CallArchiveReason::LastParticipantLeft,
+ }),
+ )
+}
+
+#[test]
+fn archived_calls_without_a_channel_have_no_timeline() {
+ let event = archived(None, Some(480_000), Utc::now());
+ assert!(matches!(event.event.ingest(event.event_id), Ingest::Ignore));
+}
+
+#[test]
+fn archived_calls_record_duration_without_requiring_a_recording() {
+ for duration_ms in [Some(480_000), None, Some(-1)] {
+ let ended_at = Utc::now();
+ let event = archived(Some(Uuid::from_u128(6)), duration_ms, ended_at);
+ let Ingest::Insert(rows) = event.event.ingest(event.event_id) else {
+ panic!("expected completed call");
+ };
+ assert_eq!(rows.len(), 1);
+ assert_eq!(rows[0].occurred_at, ended_at);
+ assert_eq!(
+ rows[0].action,
+ Action::CallEnded(::activity::domain::models::CallEnd {
+ call_id: Uuid::from_u128(5).to_string(),
+ duration_ms: duration_ms.unwrap_or(480_000).max(0),
+ })
+ );
+ }
+}
+
#[test]
fn call_started_yields_channel_and_call_activities() {
let call_id = Uuid::from_u128(5);
diff --git a/crates/channels/examples/channels_consumer.rs b/crates/channels/examples/channels_consumer.rs
index f94e13bdbc..1a526e2c31 100644
--- a/crates/channels/examples/channels_consumer.rs
+++ b/crates/channels/examples/channels_consumer.rs
@@ -67,6 +67,7 @@ fn event_type(event: &ChannelTopicEvent) -> &'static str {
match event {
ChannelTopicEvent::Created(_) => "channel.created",
ChannelTopicEvent::Updated(_) => "channel.updated",
+ ChannelTopicEvent::PictureChanged(_) => "channel.picture_changed",
ChannelTopicEvent::Deleted(_) => "channel.deleted",
ChannelTopicEvent::ParticipantAdded(_) => "channel.participant_added",
ChannelTopicEvent::ParticipantRemoved(_) => "channel.participant_removed",
diff --git a/crates/channels/src/domain/activity.rs b/crates/channels/src/domain/activity.rs
index f9f925eae5..d5b6b8b6ec 100644
--- a/crates/channels/src/domain/activity.rs
+++ b/crates/channels/src/domain/activity.rs
@@ -25,6 +25,10 @@ use messages::outbound::broker::MessageTopicEvent;
pub enum ChannelAction {
/// A message was posted in the channel.
Messaged,
+ /// A channel's display name changed.
+ Renamed(::activity::domain::models::NameChange),
+ /// A channel's profile picture changed.
+ PictureChanged,
/// A principal was added to the channel.
ParticipantAdded {
/// The added principal.
@@ -57,6 +61,8 @@ impl DomainActivity for ChannelActivity {
fn into_action(self) -> Action {
match self.action {
ChannelAction::Messaged => Action::Messaged,
+ ChannelAction::Renamed(change) => Action::Renamed(change),
+ ChannelAction::PictureChanged => Action::PictureChanged,
ChannelAction::ParticipantAdded { participant } => {
Action::ParticipantAdded(ParticipantChange { participant })
}
@@ -225,12 +231,28 @@ impl ActivitySource for ChannelTopicEvent {
CommonAction::Created,
now(),
)]),
- ChannelTopicEvent::Updated(m) => common(
+ ChannelTopicEvent::Updated(m) if m.previous_name == m.channel_name => Ingest::Ignore,
+ ChannelTopicEvent::Updated(m) => Ingest::Insert(vec![exclusive(
+ event_id,
+ 0,
Actor::new_from_user(m.actor.clone()),
- CommonAction::Edited,
+ None,
m.channel_id,
+ ChannelAction::Renamed(::activity::domain::models::NameChange {
+ from: m.previous_name.clone(),
+ to: m.channel_name.clone(),
+ }),
now(),
- ),
+ )]),
+ ChannelTopicEvent::PictureChanged(m) => Ingest::Insert(vec![exclusive(
+ event_id,
+ 0,
+ Actor::new_from_user(m.actor.clone()),
+ None,
+ m.channel_id,
+ ChannelAction::PictureChanged,
+ now(),
+ )]),
ChannelTopicEvent::Deleted(m) => {
common(m.actor.clone(), CommonAction::Deleted, m.channel_id, now())
}
diff --git a/crates/channels/src/domain/activity/test.rs b/crates/channels/src/domain/activity/test.rs
index b572df5da5..e9fd6925f7 100644
--- a/crates/channels/src/domain/activity/test.rs
+++ b/crates/channels/src/domain/activity/test.rs
@@ -37,6 +37,52 @@ fn posted(parent: MessageParent, created_at: chrono::DateTime<Utc>) -> MessagePo
}
}
+#[test]
+fn rename_preserves_names_and_skips_noops() {
+ let metadata = crate::domain::broker_events::ChannelUpdatedMetadata {
+ channel_id: CHANNEL_ID,
+ actor: user("macro|[email protected]"),
+ previous_name: Some("Before".into()),
+ channel_name: Some("After".into()),
+ };
+ let event = envelope(ChannelTopicEvent::Updated(metadata.clone()));
+ let Ingest::Insert(rows) = event.event.ingest(event.event_id) else {
+ panic!("expected rename");
+ };
+ assert_eq!(
+ rows[0].action,
+ Action::Renamed(::activity::domain::models::NameChange {
+ from: Some("Before".into()),
+ to: Some("After".into()),
+ })
+ );
+ let unchanged = envelope(ChannelTopicEvent::Updated(
+ crate::domain::broker_events::ChannelUpdatedMetadata {
+ channel_name: metadata.previous_name.clone(),
+ ..metadata
+ },
+ ));
+ assert_eq!(unchanged.event.ingest(unchanged.event_id), Ingest::Ignore);
+}
+
+#[test]
+fn picture_changes_are_attributed_and_replay_stable() {
+ let event = envelope(ChannelTopicEvent::PictureChanged(
+ crate::domain::broker_events::ChannelPictureChangedMetadata {
+ channel_id: CHANNEL_ID,
+ actor: user("macro|[email protected]"),
+ },
+ ));
+ let first = event.event.ingest(event.event_id);
+ assert_eq!(first, event.event.ingest(event.event_id));
+ let Ingest::Insert(rows) = first else {
+ panic!("expected picture activity");
+ };
+ assert_eq!(rows[0].action, Action::PictureChanged);
+ assert_eq!(rows[0].actor.as_ref(), "macro|[email protected]");
+ assert_eq!(rows[0].entity_id, CHANNEL_ID.to_string());
+}
+
#[test]
fn message_posted_maps_to_messaged_with_triggered_by_as_subject() {
let created_at = Utc::now();
diff --git a/crates/channels/src/domain/broker_events.rs b/crates/channels/src/domain/broker_events.rs
index 799260ca51..ae912c22b3 100644
--- a/crates/channels/src/domain/broker_events.rs
+++ b/crates/channels/src/domain/broker_events.rs
@@ -65,6 +65,16 @@ pub struct ChannelUpdatedMetadata {
pub channel_name: Option<String>,
}
+/// Metadata for a channel picture update, including removals.
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+pub struct ChannelPictureChangedMetadata {
+ /// Channel whose picture changed.
+ pub channel_id: Uuid,
+ /// User who changed the picture.
+ pub actor: MacroUserIdStr<'static>,
+}
+
/// Metadata for [`ChannelTopicEvent::Deleted`].
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
@@ -141,6 +151,9 @@ pub struct ChannelParticipantRemovedMetadata {
#[serde(tag = "event_type", content = "metadata")]
#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
pub enum ChannelTopicEvent {
+ /// A channel's profile picture changed.
+ #[serde(rename = "channel.picture_changed")]
+ PictureChanged(ChannelPictureChangedMetadata),
/// A channel was created.
#[serde(rename = "channel.created")]
Created(ChannelCreatedMetadata),
@@ -171,6 +184,13 @@ pub struct ChannelMacroEvent {
}
impl ChannelMacroEvent {
+ /// Build a picture update event keyed by the channel id.
+ pub fn picture_changed(metadata: ChannelPictureChangedMetadata) -> Self {
+ Self::new(
+ metadata.channel_id,
+ ChannelTopicEvent::PictureChanged(metadata),
+ )
+ }
/// Build a created event keyed by the created channel id.
pub fn created(metadata: ChannelCreatedMetadata) -> Self {
Self::new(metadata.channel_id, ChannelTopicEvent::Created(metadata))
diff --git a/crates/channels/src/domain/broker_events/test.rs b/crates/channels/src/domain/broker_events/test.rs
index 9914139e0e..a1fa40315f 100644
--- a/crates/channels/src/domain/broker_events/test.rs
+++ b/crates/channels/src/domain/broker_events/test.rs
@@ -120,6 +120,13 @@ fn event_type_strings_follow_dot_convention() {
let channel_id = Uuid::nil();
let cases = vec![
+ (
+ ChannelMacroEvent::picture_changed(ChannelPictureChangedMetadata {
+ channel_id,
+ actor: user_id("macro|[email protected]"),
+ }),
+ "channel.picture_changed",
+ ),
(
ChannelMacroEvent::updated(ChannelUpdatedMetadata {
channel_id,
diff --git a/crates/channels/src/domain/events.rs b/crates/channels/src/domain/events.rs
index b5ea1f9e5b..1279911647 100644
--- a/crates/channels/src/domain/events.rs
+++ b/crates/channels/src/domain/events.rs
@@ -28,6 +28,8 @@ pub struct ReactionNotificationContext {
pub enum ChannelEvent {
/// A channel picture was set, replaced, or removed.
PictureChanged {
+ /// User who changed the picture.
+ actor: MacroUserIdStr<'static>,
/// Channel whose picture changed.
channel_id: Uuid,
/// Active participants whose sessions should refresh the picture.
diff --git a/crates/channels/src/domain/ports.rs b/crates/channels/src/domain/ports.rs
index 515d1ba32f..8f7bb8c43b 100644
--- a/crates/channels/src/domain/ports.rs
+++ b/crates/channels/src/domain/ports.rs
@@ -162,12 +162,13 @@ pub trait HistoricalChannelRepo: Send + Sync + 'static {
/// Repository for channel persistence and query data.
#[cfg_attr(test, mockall::automock(type Err = anyhow::Error;))]
pub trait ChannelRepo: Send + Sync + 'static {
- /// Replace or remove the channel's static-file picture reference.
+ /// Replace or remove the channel's static-file picture reference atomically.
+ /// Returns whether the stored reference changed.
fn set_channel_picture(
&self,
channel_id: Uuid,
picture_id: Option<Uuid>,
- ) -> impl Future<Output = Result<(), Self::Err>> + Send;
+ ) -> impl Future<Output = Result<bool, Self::Err>> + Send;
/// Error type for repo operations.
type Err: Into<anyhow::Error> + Send;
diff --git a/crates/channels/src/domain/service.rs b/crates/channels/src/domain/service.rs
index e3331bc4e4..05dedd5278 100644
--- a/crates/channels/src/domain/service.rs
+++ b/crates/channels/src/domain/service.rs
@@ -854,14 +854,18 @@ where
.get_participants(channel_id)
.await
.map_err(|error| ChannelMutationErr::Repo(error.into()))?;
- self.repo
+ let changed = self
+ .repo
.set_channel_picture(channel_id, picture_id)
.await
.map_err(|error| ChannelMutationErr::Repo(error.into()))?;
- self.events.dispatch(ChannelEvent::PictureChanged {
- channel_id,
- recipients: participant_ids(&participants),
- });
+ if changed {
+ self.events.dispatch(ChannelEvent::PictureChanged {
+ actor: actor.clone(),
+ channel_id,
+ recipients: participant_ids(&participants),
+ });
+ }
Ok(())
}
diff --git a/crates/channels/src/domain/service/test.rs b/crates/channels/src/domain/service/test.rs
index a9e9b068d6..4336b71278 100644
--- a/crates/channels/src/domain/service/test.rs
+++ b/crates/channels/src/domain/service/test.rs
@@ -37,6 +37,7 @@ struct FakeMutationRepo {
struct FakeMutationRepoState {
channel_id: Uuid,
+ channel_picture_id: Option<Uuid>,
channel_name: Option<String>,
channel_type: ChannelType,
channel_team_id: Option<Uuid>,
@@ -60,6 +61,7 @@ impl FakeMutationRepo {
picture_updates: Arc::default(),
state: Arc::new(Mutex::new(FakeMutationRepoState {
channel_id,
+ channel_picture_id: None,
channel_name: Some("Project".to_string()),
channel_type: ChannelType::Private,
channel_team_id: None,
@@ -101,12 +103,15 @@ impl ChannelRepo for FakeMutationRepo {
&self,
channel_id: Uuid,
picture_id: Option<Uuid>,
- ) -> Result<(), Self::Err> {
+ ) -> Result<bool, Self::Err> {
self.picture_updates
.lock()
.unwrap()
.push((channel_id, picture_id));
- Ok(())
+ let mut state = self.state.lock().unwrap();
+ let changed = state.channel_picture_id != picture_id;
+ state.channel_picture_id = picture_id;
+ Ok(changed)
}
type Err = anyhow::Error;
@@ -1771,12 +1776,37 @@ async fn channel_picture_can_be_set_replaced_and_removed_by_admins_and_owners()
let events = events.events.lock().unwrap();
assert_eq!(events.len(), 3);
assert!(events.iter().all(|event| matches!(event,
- ChannelEvent::PictureChanged { channel_id: id, recipients }
+ ChannelEvent::PictureChanged { channel_id: id, recipients, actor }
if *id == channel_id && recipients.contains(&macro_id("macro|[email protected]"))
+ && actor == &macro_id("macro|[email protected]")
)));
}
}
+#[tokio::test]
+async fn repeated_channel_picture_updates_do_not_publish_false_activity() {
+ use entity_access::domain::models::AdminParticipantRole;
+ let channel_id = Uuid::new_v4();
+ let repo = FakeMutationRepo::new(channel_id, "macro|[email protected]");
+ let events = FakeEvents::default();
+ let svc = mutation_service(repo, events.clone(), FakeReferenceSharing::default())
+ .with_picture_files(FakePictureFiles {
+ file: Some(owned_picture_file()),
+ fail: false,
+ });
+ let picture = Some(Uuid::new_v4());
+ for (value, expected_events) in [(None, 0), (picture, 1), (picture, 1), (None, 2), (None, 2)] {
+ let access =
+ EntityAccessReceipt::<AdminParticipantRole>::dangerously_assert_authenticated_user(
+ macro_id("macro|[email protected]"),
+ &channel_id.to_string(),
+ EntityType::Channel,
+ );
+ svc.set_channel_picture(access, value).await.unwrap();
+ assert_eq!(events.events.lock().unwrap().len(), expected_events);
+ }
+}
+
#[test]
fn channel_members_cannot_obtain_picture_write_access() {
use entity_access::domain::models::{
diff --git a/crates/channels/src/domain/side_effects.rs b/crates/channels/src/domain/side_effects.rs
index 4c786b0c77..12b2d5b4b2 100644
--- a/crates/channels/src/domain/side_effects.rs
+++ b/crates/channels/src/domain/side_effects.rs
@@ -322,6 +322,7 @@ where
ChannelEvent::PictureChanged {
channel_id,
recipients,
+ ..
} => {
if let Err(error) = self
.realtime
@@ -967,6 +968,14 @@ fn contact_sync_users_for_event(event: &ChannelEvent) -> Option<HashSet<MacroUse
/// `macro.channels` topic.
fn broker_events_for_event(event: &ChannelEvent) -> Vec<ChannelMacroEvent> {
match event {
+ ChannelEvent::PictureChanged {
+ channel_id, actor, ..
+ } => vec![ChannelMacroEvent::picture_changed(
+ super::broker_events::ChannelPictureChangedMetadata {
+ channel_id: *channel_id,
+ actor: actor.clone(),
+ },
+ )],
ChannelEvent::ChannelCreated {
channel_id,
actor,
@@ -1046,7 +1055,6 @@ fn broker_events_for_event(event: &ChannelEvent) -> Vec<ChannelMacroEvent> {
removed_user_ids: removed_user_ids.clone(),
},
)],
- ChannelEvent::PictureChanged { .. } => Vec::new(),
ChannelEvent::EntityMentionCreated { .. } | ChannelEvent::EntityMentionDeleted { .. } => {
Vec::new()
}
diff --git a/crates/channels/src/domain/side_effects/test.rs b/crates/channels/src/domain/side_effects/test.rs
index 767d3673ca..ccb0985d0d 100644
--- a/crates/channels/src/domain/side_effects/test.rs
+++ b/crates/channels/src/domain/side_effects/test.rs
@@ -151,6 +151,7 @@ async fn picture_changes_refresh_all_participant_sessions_without_notifications(
let recipients = users(&["[email protected]", "[email protected]"]);
service
.handle(ChannelEvent::PictureChanged {
+ actor: user("[email protected]"),
channel_id,
recipients: recipients.clone(),
})
@@ -1275,6 +1276,7 @@ fn mention_broker_events_map_entity_mention_created_and_deleted() {
#[test]
fn mention_broker_events_skip_unrelated_events() {
let events = mention_broker_events_for_event(&ChannelEvent::PictureChanged {
+ actor: user("[email protected]"),
channel_id: Uuid::new_v4(),
recipients: Vec::new(),
});
diff --git a/crates/channels/src/inbound/toolset/test.rs b/crates/channels/src/inbound/toolset/test.rs
index ceb850977c..7c239519ee 100644
--- a/crates/channels/src/inbound/toolset/test.rs
+++ b/crates/channels/src/inbound/toolset/test.rs
@@ -169,6 +169,14 @@ impl messages::domain::api::MessageReader for RecordingMessages {
) -> Result<messages::domain::ports::MessagePage, messages::domain::ports::MessageError> {
unimplemented!("read path unused by mutation tools")
}
+ async fn timeline_entries(
+ &self,
+ _: EntityAccessReceipt<messages::domain::service::MessageView>,
+ _: messages::domain::ports::MessageTimelineQuery,
+ ) -> Result<messages::domain::ports::MessageTimelinePage, messages::domain::ports::MessageError>
+ {
+ unimplemented!("read path unused by mutation tools")
+ }
async fn preceding(
&self,
_: EntityAccessReceipt<messages::domain::service::MessageView>,
diff --git a/crates/channels/src/outbound/pg_channels_repo.rs b/crates/channels/src/outbound/pg_channels_repo.rs
index e19ba8dd79..bf27c5b0ce 100644
--- a/crates/channels/src/outbound/pg_channels_repo.rs
+++ b/crates/channels/src/outbound/pg_channels_repo.rs
@@ -1648,16 +1648,16 @@ impl ChannelRepo for PgChannelsRepo {
&self,
channel_id: Uuid,
picture_id: Option<Uuid>,
- ) -> Result<(), Self::Err> {
- sqlx::query!(
- "UPDATE comms_channels SET profile_picture_id = $2, updated_at = NOW() WHERE id = $1",
+ ) -> Result<bool, Self::Err> {
+ let result = sqlx::query!(
+ "UPDATE comms_channels SET profile_picture_id = $2, updated_at = NOW() WHERE id = $1 AND profile_picture_id IS DISTINCT FROM $2",
channel_id,
picture_id,
)
.execute(&self.pool)
.await
.context("unable to update channel picture")?;
- Ok(())
+ Ok(result.rows_affected() > 0)
}
type Err = anyhow::Error;
diff --git a/crates/channels/src/outbound/pg_channels_repo/tests.rs b/crates/channels/src/outbound/pg_channels_repo/tests.rs
index a3da6803c0..bd4f71c852 100644
--- a/crates/channels/src/outbound/pg_channels_repo/tests.rs
+++ b/crates/channels/src/outbound/pg_channels_repo/tests.rs
@@ -2439,8 +2439,14 @@ async fn delete_channel_cascades_contacts_backfill_outbox_rows(pool: Pool<Postgr
)]
async fn channel_picture_round_trips_through_batched_previews(pool: Pool<Postgres>) {
let repo = repo(pool);
+ assert!(!repo.set_channel_picture(CH1, None).await.unwrap());
for picture in [Some(Uuid::new_v4()), Some(Uuid::new_v4()), None] {
- repo.set_channel_picture(CH1, picture).await.unwrap();
+ let (first, concurrent) = tokio::join!(
+ repo.set_channel_picture(CH1, picture),
+ repo.set_channel_picture(CH1, picture),
+ );
+ assert_ne!(first.unwrap(), concurrent.unwrap());
+ assert!(!repo.set_channel_picture(CH1, picture).await.unwrap());
let previews = repo
.batch_get_channel_previews(&[CH1.to_string()], USER_A, None)
.await
diff --git a/crates/documents/src/inbound/toolset/comment_test.rs b/crates/documents/src/inbound/toolset/comment_test.rs
index 1be9d03acc..8a91ab0ecb 100644
--- a/crates/documents/src/inbound/toolset/comment_test.rs
+++ b/crates/documents/src/inbound/toolset/comment_test.rs
@@ -12,7 +12,7 @@ use messages::domain::{
Message, MessageAttribution, MessageParent, MessageThread, NewThreadAnchor, PostMessage,
PostMessageNotificationPolicy, ThreadPatch, ThreadState,
},
- ports::{MessageError, MessagePage, MessagePatch, MessageTimelineQuery},
+ ports::{MessageError, MessagePage, MessagePatch, MessageTimelinePage, MessageTimelineQuery},
service::{MessageView, MessageWrite},
};
use models_permissions::share_permission::access_level::AccessLevel;
@@ -77,6 +77,13 @@ impl MessageReader for FakeMessages {
) -> Result<MessagePage, MessageError> {
panic!("unexpected timeline call")
}
+ async fn timeline_entries(
+ &self,
+ _access: EntityAccessReceipt<MessageView>,
+ _query: MessageTimelineQuery,
+ ) -> Result<MessageTimelinePage, MessageError> {
+ panic!("unexpected timeline call")
+ }
async fn preceding(
&self,
_access: EntityAccessReceipt<MessageView>,
diff --git a/crates/graphql_activity/src/objects.rs b/crates/graphql_activity/src/objects.rs
index bc4d7e57d7..ad57d1f4fc 100644
--- a/crates/graphql_activity/src/objects.rs
+++ b/crates/graphql_activity/src/objects.rs
@@ -190,6 +190,15 @@ impl From<RecordedAction> for GraphqlActivityAction {
}
RecordedAction::Known(Action::TaskAdded(_)) => Self::TaskAdded(Default::default()),
RecordedAction::Known(Action::TaskRemoved(_)) => Self::TaskRemoved(Default::default()),
+ RecordedAction::Known(
+ action @ (Action::Renamed(_) | Action::PictureChanged | Action::CallEnded(_)),
+ ) => {
+ let (tag, payload) = action.to_columns();
+ Self::Unknown(GraphqlActivityUnknownAction {
+ tag: tag.to_owned(),
+ payload: payload.map(Json),
+ })
+ }
RecordedAction::Unknown { tag, payload } => {
Self::Unknown(GraphqlActivityUnknownAction {
tag,
diff --git a/crates/macro_db_client/migrations/20260919231151_activity_timeline_action_keyset.sql b/crates/macro_db_client/migrations/20260919231151_activity_timeline_action_keyset.sql
new file mode 100644
index 0000000000..c611000f57
--- /dev/null
+++ b/crates/macro_db_client/migrations/20260919231151_activity_timeline_action_keyset.sql
@@ -0,0 +1,9 @@
+-- no-transaction
+
+-- System timelines seek a bounded page per selected action. Messages, views,
+-- content edits and email sends are most of the table and never appear in a
+-- timeline, so the index leaves them out and their inserts don't maintain it.
+-- Keep the predicate in sync with activity's UNINDEXED_TIMELINE_ACTIONS.
+CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_activity_events_entity_action_timeline
+ ON activity_events (entity_type, entity_id, action, occurred_at DESC, id DESC)
+ WHERE action NOT IN ('messaged', 'opened', 'edited', 'sent');
diff --git a/crates/messages/Cargo.toml b/crates/messages/Cargo.toml
index 391d8ca935..4985871cdb 100644
--- a/crates/messages/Cargo.toml
+++ b/crates/messages/Cargo.toml
@@ -28,13 +28,15 @@ inbound = [
]
json-schema = ["dep:schemars"]
outbound = ["dep:initiative", "dep:macro_uuid", "dep:sqlx", "ports"]
-ports = ["dep:async-trait", "dep:entity_access", "dep:rootcause", "entity_access/ports"]
-schema = ["channel_sender/schema", "dep:utoipa"]
+ports = ["dep:async-trait", "dep:entity_access", "dep:futures", "dep:rootcause", "entity_access/ports"]
+schema = ["channel_sender/schema", "dep:utoipa", "activity/schema"]
test-utils = ["dep:mockall", "ports"]
[dependencies]
+activity = { path = "../activity", default-features = false }
async-trait = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
+futures = { workspace = true, optional = true }
bot_id = { path = "../bot_id" }
channel_sender = { path = "../channel_sender" }
chrono = { workspace = true }
diff --git a/crates/messages/src/domain/api.rs b/crates/messages/src/domain/api.rs
index 3fffe80740..8a4b6d3f55 100644
--- a/crates/messages/src/domain/api.rs
+++ b/crates/messages/src/domain/api.rs
@@ -26,6 +26,12 @@ pub trait MessageReader: Send + Sync + 'static {
access: EntityAccessReceipt<MessageView>,
query: MessageTimelineQuery,
) -> Result<MessagePage, MessageError>;
+ /// Read a parent's discussions and timeline activity as one ordered page.
+ async fn timeline_entries(
+ &self,
+ access: EntityAccessReceipt<MessageView>,
+ query: MessageTimelineQuery,
+ ) -> Result<MessageTimelinePage, MessageError>;
/// Read live history preceding a prompt, scoped by its parent.
async fn preceding(
@@ -140,6 +146,13 @@ impl<R: MessageRepository, E: MessageEventPublisher> MessageReader for MessageSe
) -> Result<MessagePage, MessageError> {
MessageService::timeline(self, access, query).await
}
+ async fn timeline_entries(
+ &self,
+ access: EntityAccessReceipt<MessageView>,
+ query: MessageTimelineQuery,
+ ) -> Result<MessageTimelinePage, MessageError> {
+ MessageService::timeline_entries(self, access, query).await
+ }
async fn preceding(
&self,
@@ -256,6 +269,12 @@ mockall::mock! {
access: EntityAccessReceipt<MessageView>,
query: MessageTimelineQuery,
) -> Result<MessagePage, MessageError>;
+ /// Read a parent's discussions and timeline activity as one ordered page.
+ async fn timeline_entries(
+ &self,
+ access: EntityAccessReceipt<MessageView>,
+ query: MessageTimelineQuery,
+ ) -> Result<MessageTimelinePage, MessageError>;
/// Read live history preceding a prompt, scoped by its parent.
async fn preceding(
diff --git a/crates/messages/src/domain/ports.rs b/crates/messages/src/domain/ports.rs
index 636137ff56..ad584a3e5b 100644
--- a/crates/messages/src/domain/ports.rs
+++ b/crates/messages/src/domain/ports.rs
@@ -1,9 +1,13 @@
use super::models::*;
+use activity::{ActionTag, domain::timeline::TimelineSelection};
use channel_sender::ChannelSender;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
+#[cfg(test)]
+mod test;
+
/// Message use-case failure.
#[derive(Debug, thiserror::Error)]
pub enum MessageError {
@@ -28,9 +32,9 @@ pub enum MessageError {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
pub struct MessageCursor {
- /// Last root creation time.
+ /// Last message creation time or activity occurrence time.
pub created_at: DateTime<Utc>,
- /// Last root UUID, used to break timestamp ties.
+ /// Last entry UUID, used to break timestamp ties across both sources.
pub id: Uuid,
}
@@ -87,6 +91,68 @@ pub struct MessagePage {
pub previous_cursor: Option<MessageCursor>,
}
+/// One chronological entry in a parent's timeline.
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(tag = "type", rename_all = "snake_case")]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+pub enum MessageTimelineEntry {
+ /// A root message with its bounded thread preview.
+ Message {
+ /// The message and thread state.
+ message: Box<MessageListItem>,
+ },
+ /// A recorded fact about the parent, such as a rename or a finished call.
+ Activity {
+ /// The recorded activity.
+ activity: activity::domain::timeline::TimelineActivity,
+ },
+}
+
+impl MessageTimelineEntry {
+ /// Position on the `(timestamp, id)` keyset shared by both kinds.
+ pub fn position(&self) -> (DateTime<Utc>, Uuid) {
+ match self {
+ Self::Message { message } => (message.message.created_at, message.message.id),
+ Self::Activity { activity } => (activity.occurred_at, activity.id),
+ }
+ }
+
+ /// Continue reading on either side of this entry.
+ pub fn cursor(&self) -> MessageCursor {
+ let (created_at, id) = self.position();
+ MessageCursor { created_at, id }
+ }
+}
+
+/// A bounded, newest-first window of a parent's messages and activity, ordered
+/// by the server on one `(timestamp, id)` keyset.
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[cfg_attr(feature = "schema", derive(utoipa::ToSchema))]
+pub struct MessageTimelinePage {
+ /// Messages and activity, newest first.
+ pub entries: Vec<MessageTimelineEntry>,
+ /// Continue to older entries.
+ pub next_cursor: Option<MessageCursor>,
+ /// Continue to newer entries.
+ pub previous_cursor: Option<MessageCursor>,
+}
+
+impl From<MessagePage> for MessageTimelinePage {
+ fn from(page: MessagePage) -> Self {
+ Self {
+ entries: page
+ .items
+ .into_iter()
+ .map(|message| MessageTimelineEntry::Message {
+ message: Box::new(message),
+ })
+ .collect(),
+ next_cursor: page.next_cursor,
+ previous_cursor: page.previous_cursor,
+ }
+ }
+}
+
/// Authenticated create command; attribution fields are never client controlled.
#[derive(Debug, Clone)]
pub struct CreateMessage {
@@ -456,6 +522,55 @@ impl MessageGroupRecipients for NoMessageGroups {
}
}
+/// Channel facts displayed inline; message/view actions would duplicate content.
+pub const CHANNEL_TIMELINE: TimelineSelection = TimelineSelection::new(
+ &[
+ ActionTag::Renamed,
+ ActionTag::PictureChanged,
+ ActionTag::ParticipantAdded,
+ ActionTag::ParticipantRemoved,
+ ActionTag::CallEnded,
+ ],
+ &[],
+);
+
+/// The activity a parent's timeline shows next to its messages.
+#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+pub struct TimelineActivitySource {
+ /// Activity entity type that records facts about the parent.
+ pub entity_type: activity::EntityType,
+ /// What is shown inline; anything else stays in the activity feed.
+ pub selection: TimelineSelection,
+}
+
+/// Which activity, if any, belongs in a parent's timeline. Parents without a
+/// source read message-only timelines; adding one is a deliberate choice here.
+pub fn timeline_activity(parent: &MessageParent) -> Option<TimelineActivitySource> {
+ match parent {
+ MessageParent::Channel(_) => Some(TimelineActivitySource {
+ entity_type: activity::EntityType::Channel,
+ selection: CHANNEL_TIMELINE,
+ }),
+ MessageParent::Document(_)
+ | MessageParent::Initiative(_)
+ | MessageParent::CrmCompany(_)
+ | MessageParent::CrmContact(_)
+ | MessageParent::Call(_) => None,
+ }
+}
+
+/// The timeline, if any, that shows this activity: the same declaration as
+/// [`timeline_activity`], so live delivery and reads never disagree.
+pub fn timeline_parent(activity: &activity::Activity) -> Option<MessageParent> {
+ let parent = match activity.entity_type {
+ activity::EntityType::Channel => MessageParent::Channel(activity.entity_id.parse().ok()?),
+ _ => return None,
+ };
+ let source = timeline_activity(&parent)?;
+ (source.entity_type == activity.entity_type && source.selection.includes(&activity.action))
+ .then_some(parent)
+}
+
/// Identity of a CRM company or contact that hosts a discussion.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CrmParentFacts {
diff --git a/crates/messages/src/domain/ports/test.rs b/crates/messages/src/domain/ports/test.rs
new file mode 100644
index 0000000000..de778166ca
--- /dev/null
+++ b/crates/messages/src/domain/ports/test.rs
@@ -0,0 +1,71 @@
+use super::*;
+use activity::domain::models::NameChange;
+use activity::{Action, Activity, Actor, CommonAction, DomainActivity, EntityType};
+
+const CHANNEL: Uuid = Uuid::from_u128(10);
+
+/// A channel fact as the channels domain would record it.
+struct ChannelFact(String, Action);
+
+impl DomainActivity for ChannelFact {
+ const ENTITY_TYPE: EntityType = EntityType::Channel;
+
+ fn entity_id(&self) -> &str {
+ &self.0
+ }
+
+ fn into_action(self) -> Action {
+ self.1
+ }
+}
+
+fn actor() -> Actor<'static> {
+ Actor::new_from_user("macro|[email protected]".to_owned().try_into().unwrap())
+}
+
+fn channel_fact(channel: &str, action: Action) -> Activity {
+ Activity::from_domain(
+ Uuid::from_u128(1),
+ 0,
+ actor(),
+ None,
+ ChannelFact(channel.to_owned(), action),
+ chrono::Utc::now(),
+ )
+}
+
+#[test]
+fn live_activity_finds_the_timeline_its_reads_would_show() {
+ let renamed = || {
+ Action::Renamed(NameChange {
+ from: None,
+ to: Some("New".into()),
+ })
+ };
+ assert_eq!(
+ timeline_parent(&channel_fact(&CHANNEL.to_string(), renamed())),
+ Some(MessageParent::Channel(CHANNEL))
+ );
+ assert_eq!(
+ timeline_parent(&channel_fact(&CHANNEL.to_string(), Action::Edited)),
+ None,
+ "edits are not timeline facts"
+ );
+ assert_eq!(
+ timeline_parent(&channel_fact("not-a-channel", renamed())),
+ None
+ );
+
+ // Parents without a timeline source never receive live activity.
+ let task = Activity::common(
+ Uuid::from_u128(2),
+ 0,
+ actor(),
+ None,
+ EntityType::Document,
+ "task-1",
+ CommonAction::Created,
+ chrono::Utc::now(),
+ );
+ assert_eq!(timeline_parent(&task), None);
+}
diff --git a/crates/messages/src/domain/service.rs b/crates/messages/src/domain/service.rs
index 89d7d3d191..3e382e7b32 100644
--- a/crates/messages/src/domain/service.rs
+++ b/crates/messages/src/domain/service.rs
@@ -9,6 +9,7 @@ use uuid::Uuid;
#[cfg(test)]
mod test;
+mod timeline;
/// Minimum view permission for any supported message parent.
#[derive(Debug, Clone, Copy)]
@@ -34,6 +35,7 @@ impl RequiredPermission for MessageWrite {
/// Shared message use cases. Parent management and delivery are separate capabilities.
#[derive(Clone)]
pub struct MessageService<R, E> {
+ activity: Option<std::sync::Arc<dyn activity::domain::timeline::ActivityTimeline>>,
repo: R,
events: E,
references: std::sync::Arc<dyn MessageReferenceAccess>,
@@ -45,6 +47,7 @@ impl<R: MessageRepository, E: MessageEventPublisher> MessageService<R, E> {
/// Compose a service from persistence and delivery ports.
pub fn new(repo: R, events: E) -> Self {
Self {
+ activity: None,
repo,
events,
references: std::sync::Arc::new(DenyMessageReferences),
@@ -53,6 +56,15 @@ impl<R: MessageRepository, E: MessageEventPublisher> MessageService<R, E> {
}
}
+ /// Supply the activity owner's read boundary for mixed parent timelines.
+ pub fn with_activity(
+ mut self,
+ activity: impl activity::domain::timeline::ActivityTimeline,
+ ) -> Self {
+ self.activity = Some(std::sync::Arc::new(activity));
+ self
+ }
+
/// Supply current channel membership for authored group mentions.
pub fn with_group_recipients(mut self, groups: impl MessageGroupRecipients) -> Self {
self.groups = std::sync::Arc::new(groups);
@@ -76,8 +88,45 @@ impl<R: MessageRepository, E: MessageEventPublisher> MessageService<R, E> {
pub async fn timeline(
&self,
access: EntityAccessReceipt<MessageView>,
- mut query: MessageTimelineQuery,
+ query: MessageTimelineQuery,
) -> Result<MessagePage, MessageError> {
+ let (parent, query) = self.timeline_selection(&access, query).await?;
+ self.repo.timeline(&parent, query).await
+ }
+
+ /// Read a parent's messages and its timeline activity as one ordered page.
+ /// Parents without a timeline activity source return their messages only.
+ #[tracing::instrument(err, skip(self, access))]
+ pub async fn timeline_entries(
+ &self,
+ access: EntityAccessReceipt<MessageView>,
+ query: MessageTimelineQuery,
+ ) -> Result<MessageTimelinePage, MessageError> {
+ let (parent, query) = self.timeline_selection(&access, query).await?;
+ let Some(source) = timeline_activity(&parent) else {
+ return self.repo.timeline(&parent, query).await.map(Into::into);
+ };
+ // These filters select a subset of roots, and activity has no matching
+ // filter, so the merged window would be wrong. Including deleted threads
+ // only adds tombstones on the same keyset, so it combines with activity.
+ if !query.ids.is_empty()
+ || query.anchored.is_some()
+ || query.activity_after.is_some()
+ || query.activity_before.is_some()
+ {
+ return Err(MessageError::Invalid(
+ "activity timelines cannot be combined with message filters",
+ ));
+ }
+ self.activity_timeline(&parent, source, query).await
+ }
+
+ /// Validate a selection and resolve the parent it reads.
+ async fn timeline_selection(
+ &self,
+ access: &EntityAccessReceipt<MessageView>,
+ mut query: MessageTimelineQuery,
+ ) -> Result<(MessageParent, MessageTimelineQuery), MessageError> {
if query
.activity_after
.zip(query.activity_before)
@@ -95,13 +144,13 @@ impl<R: MessageRepository, E: MessageEventPublisher> MessageService<R, E> {
"centered windows cannot have filters",
));
}
- let parent = parent_from_receipt(&access)?;
+ let parent = parent_from_receipt(access)?;
self.ensure_parent(&parent).await?;
query.limit = Some(query.limit.unwrap_or(50).clamp(1, 100));
if query.ids.len() > 100 || (query.around.is_some() && query.cursor.is_some()) {
return Err(MessageError::Invalid("invalid timeline selection"));
}
- self.repo.timeline(&parent, query).await
+ Ok((parent, query))
}
/// Read a message and its canonical root for navigation.
diff --git a/crates/messages/src/domain/service/test.rs b/crates/messages/src/domain/service/test.rs
index 24c1a19eee..c97d4a7ff9 100644
--- a/crates/messages/src/domain/service/test.rs
+++ b/crates/messages/src/domain/service/test.rs
@@ -111,7 +111,15 @@ impl MessageRepository for Repo {
query: MessageTimelineQuery,
) -> Result<MessagePage, MessageError> {
let included = self.message.parent == *parent
- && (query.ids.is_empty() || query.ids.contains(&self.message.id));
+ && (query.ids.is_empty() || query.ids.contains(&self.message.id))
+ && query.cursor.as_ref().is_none_or(|cursor| {
+ let key = (self.message.created_at, self.message.id);
+ let boundary = (cursor.created_at, cursor.id);
+ match query.direction {
+ MessageDirection::Older => key < boundary,
+ MessageDirection::Newer => key > boundary,
+ }
+ });
Ok(MessagePage {
items: if included {
vec![MessageListItem {
@@ -1469,6 +1477,300 @@ async fn display_only_mention_kinds_are_stored_without_authorization() {
);
}
+#[derive(Clone)]
+struct TimelineFacts(Vec<activity::domain::timeline::TimelineActivity>);
+impl activity::domain::timeline::ActivityTimeline for TimelineFacts {
+ fn read<'a>(
+ &'a self,
+ query: activity::domain::timeline::ActivityTimelineQuery,
+ ) -> std::pin::Pin<
+ Box<
+ dyn Future<
+ Output = Result<
+ Vec<activity::domain::timeline::TimelineActivity>,
+ activity::domain::timeline::TimelineReadError,
+ >,
+ > + Send
+ + 'a,
+ >,
+ > {
+ Box::pin(async move {
+ assert_eq!(query.entity_type, activity::EntityType::Channel);
+ assert_eq!(query.entity_id, Uuid::from_u128(20).to_string());
+ assert_eq!(query.selection, CHANNEL_TIMELINE);
+ let mut rows: Vec<_> = self
+ .0
+ .iter()
+ .filter(|row| {
+ query.cursor.is_none_or(|cursor| {
+ let key = (row.occurred_at, row.id);
+ if query.newer {
+ key > cursor
+ } else {
+ key < cursor
+ }
+ })
+ })
+ .cloned()
+ .collect();
+ rows.sort_by_key(|row| (row.occurred_at, row.id));
+ if !query.newer {
+ rows.reverse();
+ }
+ rows.truncate(usize::from(query.limit));
+ Ok(rows)
+ })
+ }
+}
+
+/// Records each activity read's limit, to show how much a window reads.
+#[derive(Clone)]
+struct CountedFacts(TimelineFacts, Arc<Mutex<Vec<u16>>>);
+impl activity::domain::timeline::ActivityTimeline for CountedFacts {
+ fn read<'a>(
+ &'a self,
+ query: activity::domain::timeline::ActivityTimelineQuery,
+ ) -> std::pin::Pin<
+ Box<
+ dyn Future<
+ Output = Result<
+ Vec<activity::domain::timeline::TimelineActivity>,
+ activity::domain::timeline::TimelineReadError,
+ >,
+ > + Send
+ + 'a,
+ >,
+ > {
+ self.1.lock().unwrap().push(query.limit);
+ self.0.read(query)
+ }
+}
+
+/// A channel message with system activity at the given second offsets.
+fn centered_channel(
+ offsets: impl IntoIterator<Item = i64>,
+) -> (Repo, Vec<activity::domain::timeline::TimelineActivity>) {
+ let mut repo = fixture();
+ repo.message.parent = MessageParent::Channel(Uuid::from_u128(20));
+ repo.state.anchor = None;
+ let facts = offsets
+ .into_iter()
+ .enumerate()
+ .map(
+ |(id, seconds)| activity::domain::timeline::TimelineActivity {
+ id: Uuid::from_u128(1_000 + id as u128),
+ actor_id: "macro|[email protected]".into(),
+ occurred_at: repo.message.created_at + chrono::Duration::seconds(seconds),
+ action: "picture_changed".into(),
+ payload: None,
+ },
+ )
+ .collect();
+ (repo, facts)
+}
+
+async fn around(
+ repo: &Repo,
+ facts: Vec<activity::domain::timeline::TimelineActivity>,
+ limit: u16,
+) -> (MessageTimelinePage, Vec<u16>) {
+ let reads = Arc::new(Mutex::new(Vec::new()));
+ let service = MessageService::new(repo.clone(), Events::default())
+ .with_activity(CountedFacts(TimelineFacts(facts), reads.clone()));
+ let page = service
+ .timeline_entries(
+ channel_access()
+ .try_into_requirement::<MessageView>()
+ .unwrap(),
+ MessageTimelineQuery {
+ around: Some(repo.message.id),
+ limit: Some(limit),
+ ..Default::default()
+ },
+ )
+ .await
+ .unwrap();
+ let reads = reads.lock().unwrap().clone();
+ (page, reads)
+}
+
+#[tokio::test]
+async fn centered_window_reads_each_sides_share_not_a_page_per_side() {
+ let (repo, facts) = centered_channel((-40..=-1).chain(1..=40));
+ let (page, reads) = around(&repo, facts, 51).await;
+ let ids = entry_ids(&page);
+ assert_eq!(ids.len(), 51);
+ assert_eq!(ids[25], repo.message.id, "anchor sits in the middle");
+ assert!(page.next_cursor.is_some() && page.previous_cursor.is_some());
+ // 25 per side plus one lookahead, instead of 51 per side.
+ assert_eq!(reads, [26, 26]);
+}
+
+#[tokio::test]
+async fn a_short_side_lends_its_room_to_the_other() {
+ let (repo, facts) = centered_channel(-10..=-1);
+ let (page, reads) = around(&repo, facts, 7).await;
+ let ids = entry_ids(&page);
+ assert_eq!(ids.len(), 7);
+ assert_eq!(ids[0], repo.message.id, "nothing is newer than the anchor");
+ assert!(page.next_cursor.is_some() && page.previous_cursor.is_none());
+ assert_eq!(reads, [4, 4, 4], "only the older side reads further");
+
+ let (repo, facts) = centered_channel(1..=10);
+ let (page, _) = around(&repo, facts, 7).await;
+ let ids = entry_ids(&page);
+ assert_eq!(ids.len(), 7);
+ assert_eq!(ids[6], repo.message.id, "nothing is older than the anchor");
+ assert!(page.previous_cursor.is_some() && page.next_cursor.is_none());
+
+ // Both sides short: everything fits and neither side continues.
+ let (repo, facts) = centered_channel([-2, -1, 1]);
+ let (page, _) = around(&repo, facts, 7).await;
+ assert_eq!(entry_ids(&page).len(), 4);
+ assert!(page.next_cursor.is_none() && page.previous_cursor.is_none());
+}
+
+fn entry_ids(page: &MessageTimelinePage) -> Vec<Uuid> {
+ page.entries
+ .iter()
+ .map(|entry| entry.position().1)
+ .collect()
+}
+
+#[tokio::test]
+async fn centered_mixed_timeline_preserves_anchor_and_pages_to_both_ends() {
+ let mut repo = fixture();
+ repo.message.parent = MessageParent::Channel(Uuid::from_u128(20));
+ repo.state.anchor = None;
+ let facts: Vec<_> = [-2, -1, 1, 2]
+ .into_iter()
+ .enumerate()
+ .map(
+ |(id, seconds)| activity::domain::timeline::TimelineActivity {
+ id: Uuid::from_u128(100 + id as u128),
+ actor_id: "macro|[email protected]".into(),
+ occurred_at: repo.message.created_at + chrono::Duration::seconds(seconds),
+ action: "picture_changed".into(),
+ payload: None,
+ },
+ )
+ .collect();
+ let service = MessageService::new(repo.clone(), Events::default())
+ .with_activity(TimelineFacts(facts.clone()));
+ let view = || {
+ channel_access()
+ .try_into_requirement::<MessageView>()
+ .unwrap()
+ };
+ let center = service
+ .timeline_entries(
+ view(),
+ MessageTimelineQuery {
+ around: Some(repo.message.id),
+ limit: Some(3),
+ ..Default::default()
+ },
+ )
+ .await
+ .unwrap();
+ assert_eq!(
+ entry_ids(&center),
+ [facts[2].id, repo.message.id, facts[1].id]
+ );
+ let older = service
+ .timeline_entries(
+ view(),
+ MessageTimelineQuery {
+ cursor: center.next_cursor,
+ limit: Some(3),
+ ..Default::default()
+ },
+ )
+ .await
+ .unwrap();
+ assert_eq!(entry_ids(&older), [facts[0].id]);
+ assert!(older.next_cursor.is_none());
+ let newer = service
+ .timeline_entries(
+ view(),
+ MessageTimelineQuery {
+ direction: MessageDirection::Newer,
+ cursor: center.previous_cursor,
+ limit: Some(3),
+ ..Default::default()
+ },
+ )
+ .await
+ .unwrap();
+ assert_eq!(entry_ids(&newer), [facts[3].id]);
+ assert!(newer.previous_cursor.is_none());
+ let anchor = service
+ .timeline_entries(
+ view(),
+ MessageTimelineQuery {
+ around: Some(repo.message.id),
+ limit: Some(1),
+ ..Default::default()
+ },
+ )
+ .await
+ .unwrap();
+ assert_eq!(entry_ids(&anchor), [repo.message.id]);
+ assert!(anchor.next_cursor.is_some() && anchor.previous_cursor.is_some());
+
+ // The message list stays message-only for clients that never asked for activity.
+ let messages = service
+ .timeline(view(), MessageTimelineQuery::default())
+ .await
+ .unwrap();
+ assert_eq!(messages.items.len(), 1);
+ assert!(messages.next_cursor.is_none());
+}
+
+#[tokio::test]
+async fn system_timeline_rejects_message_filters_and_keeps_discussions_message_only() {
+ let service =
+ MessageService::new(fixture(), Events::default()).with_activity(TimelineFacts(vec![]));
+ let result = service
+ .timeline_entries(
+ channel_access()
+ .try_into_requirement::<MessageView>()
+ .unwrap(),
+ MessageTimelineQuery {
+ ids: vec![Uuid::from_u128(1)],
+ ..Default::default()
+ },
+ )
+ .await;
+ assert!(matches!(result, Err(MessageError::Invalid(_))));
+ // Tombstones sit on the same keyset, so they combine with activity.
+ let result = service
+ .timeline_entries(
+ channel_access()
+ .try_into_requirement::<MessageView>()
+ .unwrap(),
+ MessageTimelineQuery {
+ include_deleted_threads: true,
+ ..Default::default()
+ },
+ )
+ .await;
+ assert!(result.is_ok());
+ let result = service
+ .timeline_entries(
+ access("macro|[email protected]", "doc", AccessLevel::Comment)
+ .try_into_requirement::<MessageView>()
+ .unwrap(),
+ MessageTimelineQuery::default(),
+ )
+ .await
+ .unwrap();
+ assert!(matches!(
+ result.entries[..],
+ [MessageTimelineEntry::Message { .. }]
+ ));
+}
+
#[test]
fn client_ids_must_be_recent_uuid_v7() {
let now = Utc::now();
diff --git a/crates/messages/src/domain/service/timeline.rs b/crates/messages/src/domain/service/timeline.rs
new file mode 100644
index 0000000000..d3559ad07a
--- /dev/null
+++ b/crates/messages/src/domain/service/timeline.rs
@@ -0,0 +1,221 @@
+//! Merge independently owned, bounded sources under one chronological cursor.
+use super::*;
+use activity::domain::timeline::{ActivityTimelineQuery, TimelineActivity};
+
+#[cfg(test)]
+mod test;
+
+fn page(
+ mut entries: Vec<MessageTimelineEntry>,
+ more_older: bool,
+ more_newer: bool,
+) -> MessageTimelinePage {
+ entries.sort_by_key(|entry| std::cmp::Reverse(entry.position()));
+ let next_cursor = more_older
+ .then(|| entries.last().map(MessageTimelineEntry::cursor))
+ .flatten();
+ let previous_cursor = more_newer
+ .then(|| entries.first().map(MessageTimelineEntry::cursor))
+ .flatten();
+ MessageTimelinePage {
+ entries,
+ next_cursor,
+ previous_cursor,
+ }
+}
+
+fn merge(
+ messages: MessagePage,
+ activities: Vec<TimelineActivity>,
+ query: &MessageTimelineQuery,
+) -> MessageTimelinePage {
+ let limit = usize::from(query.limit.unwrap_or(50));
+ let newer = matches!(query.direction, MessageDirection::Newer);
+ let source_has_more = if newer {
+ messages.previous_cursor.is_some()
+ } else {
+ messages.next_cursor.is_some()
+ };
+ let mut merged = MessageTimelinePage::from(messages).entries;
+ merged.extend(
+ activities
+ .into_iter()
+ .map(|activity| MessageTimelineEntry::Activity { activity }),
+ );
+ merged.sort_by_key(MessageTimelineEntry::position);
+ if !newer {
+ merged.reverse();
+ }
+ let more = source_has_more || merged.len() > limit;
+ merged.truncate(limit);
+ let opposite = query.cursor.is_some();
+ page(
+ merged,
+ if newer { opposite } else { more },
+ if newer { more } else { opposite },
+ )
+}
+
+impl<R: MessageRepository, E: MessageEventPublisher> MessageService<R, E> {
+ pub(super) async fn activity_timeline(
+ &self,
+ parent: &MessageParent,
+ source: TimelineActivitySource,
+ mut query: MessageTimelineQuery,
+ ) -> Result<MessageTimelinePage, MessageError> {
+ let Some(anchor) = query.around.take() else {
+ return self.activity_side(parent, source, query).await;
+ };
+ // The repository resolves replies to their root and validates thread
+ // visibility. Keep the anchor even for a one-entry window.
+ let anchor = self
+ .repo
+ .timeline(
+ parent,
+ MessageTimelineQuery {
+ around: Some(anchor),
+ limit: Some(1),
+ include_deleted_threads: query.include_deleted_threads,
+ ..Default::default()
+ },
+ )
+ .await?
+ .items
+ .into_iter()
+ .next()
+ .ok_or(MessageError::NotFound)?;
+ query.cursor = Some(MessageCursor {
+ created_at: anchor.message.created_at,
+ id: anchor.message.id,
+ });
+ // Read each side's share of the window rather than a full page per
+ // side; only a side that runs short makes the other read further.
+ let remaining = query.limit.unwrap_or(50) - 1;
+ let older_share = remaining / 2;
+ let newer_share = remaining - older_share;
+ let side = |direction, share: u16| MessageTimelineQuery {
+ direction,
+ // A zero share still reads one entry to learn whether that side continues.
+ limit: Some(share.max(1)),
+ ..query.clone()
+ };
+ let (mut before, mut after) = futures::try_join!(
+ self.activity_side(parent, source, side(MessageDirection::Older, older_share)),
+ self.activity_side(parent, source, side(MessageDirection::Newer, newer_share))
+ )?;
+ if after.entries.len() < usize::from(newer_share) {
+ let want = usize::from(remaining) - after.entries.len();
+ self.extend_side(
+ parent,
+ source,
+ &query,
+ &mut before,
+ MessageDirection::Older,
+ want,
+ )
+ .await?;
+ } else if before.entries.len() < usize::from(older_share) {
+ let want = usize::from(remaining) - before.entries.len();
+ self.extend_side(
+ parent,
+ source,
+ &query,
+ &mut after,
+ MessageDirection::Newer,
+ want,
+ )
+ .await?;
+ }
+ let before_more = before.next_cursor.is_some();
+ let after_more = after.previous_cursor.is_some();
+ let mut before = before.entries;
+ let mut after = after.entries;
+ before.sort_by_key(|entry| std::cmp::Reverse(entry.position()));
+ after.sort_by_key(MessageTimelineEntry::position);
+ let remaining = usize::from(remaining);
+ let take_before = before.len().min(remaining / 2);
+ let take_after = after.len().min(remaining - take_before);
+ let take_before = before.len().min(remaining - take_after);
+ let more_older = before_more || before.len() > take_before;
+ let more_newer = after_more || after.len() > take_after;
+ before.truncate(take_before);
+ after.truncate(take_after);
+ before.push(MessageTimelineEntry::Message {
+ message: Box::new(anchor),
+ });
+ before.extend(after);
+ Ok(page(before, more_older, more_newer))
+ }
+
+ /// Continue one side of a centered window from where it stopped, until it
+ /// holds `want` entries or that side of the timeline runs out.
+ async fn extend_side(
+ &self,
+ parent: &MessageParent,
+ source: TimelineActivitySource,
+ query: &MessageTimelineQuery,
+ side: &mut MessageTimelinePage,
+ direction: MessageDirection,
+ want: usize,
+ ) -> Result<(), MessageError> {
+ let older = matches!(direction, MessageDirection::Older);
+ let cursor = if older {
+ side.next_cursor.clone()
+ } else {
+ side.previous_cursor.clone()
+ };
+ let missing = want.saturating_sub(side.entries.len());
+ let (Some(cursor), Ok(missing @ 1..)) = (cursor, u16::try_from(missing)) else {
+ return Ok(());
+ };
+ let rest = self
+ .activity_side(
+ parent,
+ source,
+ MessageTimelineQuery {
+ direction,
+ cursor: Some(cursor),
+ limit: Some(missing),
+ ..query.clone()
+ },
+ )
+ .await?;
+ side.entries.extend(rest.entries);
+ if older {
+ side.next_cursor = rest.next_cursor;
+ } else {
+ side.previous_cursor = rest.previous_cursor;
+ }
+ Ok(())
+ }
+
+ async fn activity_side(
+ &self,
+ parent: &MessageParent,
+ source: TimelineActivitySource,
+ query: MessageTimelineQuery,
+ ) -> Result<MessageTimelinePage, MessageError> {
+ let activity = self.activity.as_ref().ok_or_else(|| {
+ MessageError::Repository(rootcause::report!(
+ "activity timeline reader is not configured"
+ ))
+ })?;
+ let activity_query = ActivityTimelineQuery {
+ entity_type: source.entity_type,
+ entity_id: parent.entity_id(),
+ selection: source.selection,
+ cursor: query.cursor.as_ref().map(|c| (c.created_at, c.id)),
+ newer: matches!(query.direction, MessageDirection::Newer),
+ limit: query.limit.unwrap_or(50) + 1,
+ };
+ let (messages, activities) =
+ futures::try_join!(self.repo.timeline(parent, query.clone()), async {
+ activity.read(activity_query).await.map_err(|error| {
+ MessageError::Repository(rootcause::report!(
+ "activity timeline read failed: {error}"
+ ))
+ })
+ })?;
+ Ok(merge(messages, activities, &query))
+ }
+}
diff --git a/crates/messages/src/domain/service/timeline/test.rs b/crates/messages/src/domain/service/timeline/test.rs
new file mode 100644
index 0000000000..09ab4feb75
--- /dev/null
+++ b/crates/messages/src/domain/service/timeline/test.rs
@@ -0,0 +1,174 @@
+use super::*;
+use chrono::DateTime;
+
+fn activity(id: u128) -> TimelineActivity {
+ TimelineActivity {
+ id: Uuid::from_u128(id),
+ actor_id: "macro|[email protected]".into(),
+ occurred_at: DateTime::from_timestamp(1_000, 0).unwrap(),
+ action: "picture_changed".into(),
+ payload: None,
+ }
+}
+
+fn message(id: u128) -> MessageListItem {
+ let at = activity(id).occurred_at;
+ let id = Uuid::from_u128(id);
+ MessageListItem {
+ message: Message {
+ id,
+ parent: MessageParent::Channel(Uuid::from_u128(100)),
+ thread_id: None,
+ sender_id: ChannelSender::try_from("macro|[email protected]".to_owned()).unwrap(),
+ bot_profile: None,
+ mentions: vec![],
+ imported_author: None,
+ triggered_by: None,
+ content: "hello".into(),
+ created_at: at,
+ updated_at: at,
+ edited_at: None,
+ deleted_at: None,
+ attachments: vec![],
+ reactions: vec![],
+ },
+ state: ThreadState {
+ root_id: id,
+ user_id: "macro|[email protected]".into(),
+ resolved: false,
+ anchor: None,
+ created_at: at,
+ updated_at: at,
+ deleted_at: None,
+ },
+ thread: MessageThreadPreview {
+ reply_count: 0,
+ latest_reply_at: None,
+ preview: vec![],
+ },
+ }
+}
+
+/// Page ids in server order.
+fn ids(page: &MessageTimelinePage) -> Vec<u128> {
+ page.entries
+ .iter()
+ .map(|entry| entry.position().1.as_u128())
+ .collect()
+}
+
+fn roots(items: Vec<MessageListItem>, more: bool) -> MessagePage {
+ let cursor = |item: &MessageListItem| MessageCursor {
+ created_at: item.message.created_at,
+ id: item.message.id,
+ };
+ MessagePage {
+ next_cursor: more.then(|| cursor(items.last().unwrap())),
+ previous_cursor: more.then(|| cursor(items.first().unwrap())),
+ items,
+ }
+}
+
+#[test]
+fn mixed_pages_share_uuid_ties_and_bounds() {
+ let messages = roots(vec![message(2), message(4)], false);
+ let query = MessageTimelineQuery {
+ limit: Some(3),
+ ..Default::default()
+ };
+ let result = merge(
+ messages,
+ vec![activity(1), activity(3), activity(5)],
+ &query,
+ );
+ assert_eq!(ids(&result), [5, 4, 3]);
+ assert_eq!(result.next_cursor.unwrap().id.as_u128(), 3);
+ assert!(result.previous_cursor.is_none());
+}
+
+#[test]
+fn forward_page_keeps_nearest_items_and_returns_newest_first() {
+ let query = MessageTimelineQuery {
+ limit: Some(2),
+ direction: MessageDirection::Newer,
+ cursor: Some(MessageCursor {
+ id: Uuid::nil(),
+ created_at: activity(1).occurred_at,
+ }),
+ ..Default::default()
+ };
+ let result = merge(
+ roots(vec![message(2), message(4)], true),
+ vec![activity(1), activity(3)],
+ &query,
+ );
+ assert_eq!(ids(&result), [2, 1]);
+ assert_eq!(result.next_cursor.unwrap().id.as_u128(), 1);
+ assert_eq!(result.previous_cursor.unwrap().id.as_u128(), 2);
+}
+
+#[test]
+fn activity_only_pages_can_continue_without_messages() {
+ let query = MessageTimelineQuery {
+ limit: Some(1),
+ ..Default::default()
+ };
+ let result = merge(roots(vec![], false), vec![activity(1), activity(2)], &query);
+ assert!(matches!(
+ result.entries[..],
+ [MessageTimelineEntry::Activity { .. }]
+ ));
+ assert_eq!(ids(&result), [2]);
+ assert_eq!(result.next_cursor.unwrap().id.as_u128(), 2);
+}
+
+#[test]
+fn message_source_lookahead_survives_full_merged_page() {
+ let query = MessageTimelineQuery {
+ limit: Some(1),
+ ..Default::default()
+ };
+ let result = merge(roots(vec![message(2)], true), vec![], &query);
+ assert_eq!(result.next_cursor.unwrap().id.as_u128(), 2);
+}
+
+#[test]
+fn exhausted_activity_only_page_has_no_next_cursor() {
+ let query = MessageTimelineQuery {
+ limit: Some(2),
+ ..Default::default()
+ };
+ let result = merge(roots(vec![], false), vec![activity(1)], &query);
+ assert_eq!(ids(&result), [1]);
+ assert!(result.next_cursor.is_none());
+}
+
+#[test]
+fn response_tags_each_entry_with_its_kind() {
+ let response = merge(
+ roots(vec![message(2)], false),
+ vec![activity(1), activity(3)],
+ &MessageTimelineQuery::default(),
+ );
+ let json = serde_json::to_value(response).unwrap();
+ let entries = json["entries"].as_array().unwrap();
+ let shape: Vec<_> = entries
+ .iter()
+ .map(|entry| {
+ let kind = entry["type"].as_str().unwrap();
+ (
+ kind.to_owned(),
+ entry[kind]["id"].as_str().unwrap().to_owned(),
+ )
+ })
+ .collect();
+ assert_eq!(
+ shape,
+ [
+ ("activity".to_owned(), Uuid::from_u128(3).to_string()),
+ ("message".to_owned(), Uuid::from_u128(2).to_string()),
+ ("activity".to_owned(), Uuid::from_u128(1).to_string()),
+ ]
+ );
+ assert_eq!(entries[1]["message"]["thread"]["reply_count"], 0);
+}
diff --git a/crates/messages/src/inbound/axum_router.rs b/crates/messages/src/inbound/axum_router.rs
index 88c6234087..53d5a199fd 100644
--- a/crates/messages/src/inbound/axum_router.rs
+++ b/crates/messages/src/inbound/axum_router.rs
@@ -55,6 +55,10 @@ where
"/{parent_type}/{parent_id}",
get(timeline::<A, Auth>).post(create::<A, Auth>),
)
+ .route(
+ "/{parent_type}/{parent_id}/timeline",
+ get(timeline_entries::<A, Auth>),
+ )
.route(
"/{parent_type}/{parent_id}/items/{id}",
get(get_message::<A, Auth>)
@@ -86,6 +90,17 @@ pub struct TimelineQuery {
pub selection: Option<String>,
}
+impl TimelineQuery {
+ fn selection(&self) -> Result<MessageTimelineQuery, MessageError> {
+ self.selection
+ .as_deref()
+ .map(serde_json::from_str::<MessageTimelineQuery>)
+ .transpose()
+ .map_err(|_| MessageError::Invalid("invalid timeline query"))
+ .map(Option::unwrap_or_default)
+ }
+}
+
#[utoipa::path(operation_id = "message_timeline", get, path = "/messages/{parent_type}/{parent_id}", params(("parent_type" = String, Path), ("parent_id" = String, Path), TimelineQuery), responses((status = 200, body = MessagePage)))]
/// Read a bounded timeline with lazy thread previews.
pub async fn timeline<A: EntityAccessService, Auth: MacroAuthorizationService>(
@@ -94,13 +109,7 @@ pub async fn timeline<A: EntityAccessService, Auth: MacroAuthorizationService>(
Path(path): Path<ParentPath>,
Query(query): Query<TimelineQuery>,
) -> Result<Json<MessagePage>, MessageHttpError> {
- let query = query
- .selection
- .as_deref()
- .map(serde_json::from_str::<MessageTimelineQuery>)
- .transpose()
- .map_err(|_| MessageError::Invalid("invalid timeline query"))?
- .unwrap_or_default();
+ let query = query.selection()?;
Ok(Json(
state
.service
@@ -109,6 +118,23 @@ pub async fn timeline<A: EntityAccessService, Auth: MacroAuthorizationService>(
))
}
+#[utoipa::path(operation_id = "message_timeline_entries", get, path = "/messages/{parent_type}/{parent_id}/timeline", params(("parent_type" = String, Path), ("parent_id" = String, Path), TimelineQuery), responses((status = 200, body = MessageTimelinePage)))]
+/// Read a bounded window of messages and the parent's activity, ordered by the server.
+pub async fn timeline_entries<A: EntityAccessService, Auth: MacroAuthorizationService>(
+ State(state): State<MessagesRouterState<A, Auth>>,
+ user: MacroAuthorizationExtractor<Auth, AnyPrincipal>,
+ Path(path): Path<ParentPath>,
+ Query(query): Query<TimelineQuery>,
+) -> Result<Json<MessageTimelinePage>, MessageHttpError> {
+ let query = query.selection()?;
+ Ok(Json(
+ state
+ .service
+ .timeline_entries(receipt(state.access.as_ref(), &user, &path).await?, query)
+ .await?,
+ ))
+}
+
/// Parent path shared by every operation.
#[derive(Debug, Deserialize)]
pub struct ParentPath {
diff --git a/crates/soup_realtime/src/inbound/kafka_consumer.rs b/crates/soup_realtime/src/inbound/kafka_consumer.rs
index c59f007b98..be92bc71fb 100644
--- a/crates/soup_realtime/src/inbound/kafka_consumer.rs
+++ b/crates/soup_realtime/src/inbound/kafka_consumer.rs
@@ -371,6 +371,9 @@ fn push_channel_reference_update(
fn patches_from_channel_event(event: &ChannelTopicEvent) -> Vec<SoupRealtimePatch> {
match event {
+ ChannelTopicEvent::PictureChanged(metadata) => {
+ vec![update(EntityType::Channel, metadata.channel_id)]
+ }
ChannelTopicEvent::Updated(metadata) => {
vec![update(EntityType::Channel, metadata.channel_id)]
}
diff --git a/crates/webhook/src/domain/ingestion.rs b/crates/webhook/src/domain/ingestion.rs
index 953d7dff00..8ffd799937 100644
--- a/crates/webhook/src/domain/ingestion.rs
+++ b/crates/webhook/src/domain/ingestion.rs
@@ -293,6 +293,9 @@ pub(crate) fn normalized_channel_event(
let (event_name, channel_id) = match &event.event {
ChannelTopicEvent::Created(metadata) => ("channel.created", metadata.channel_id),
ChannelTopicEvent::Updated(metadata) => ("channel.updated", metadata.channel_id),
+ ChannelTopicEvent::PictureChanged(metadata) => {
+ ("channel.picture_changed", metadata.channel_id)
+ }
ChannelTopicEvent::Deleted(metadata) => ("channel.deleted", metadata.channel_id),
ChannelTopicEvent::ParticipantAdded(metadata) => {
("channel.participant_added", metadata.channel_id)
diff --git a/docs/AGENT_GUIDE/channels.md b/docs/AGENT_GUIDE/channels.md
index 5ea6381b62..093f133c77 100644
--- a/docs/AGENT_GUIDE/channels.md
+++ b/docs/AGENT_GUIDE/channels.md
@@ -55,6 +55,18 @@ whole thread. Check a thread with more than three consecutive replies from one
sender (all remain visible), then one with four groups (the first three groups
remain visible in full). Standalone thread previews follow the same rule.
+Channel timelines show system updates alongside messages: participant additions
+and removals, renames, profile picture changes, and completed calls with their
+duration. These rows have no reply, edit, or reaction actions. Long descriptions
+stay on one line; hover to read the full text. Dates, message navigation, and
+scrolling through older history include these updates. A call's completed row
+appears when the call ends; active calls retain their existing live indicator.
+To verify live updates, scroll into history and change the channel from another
+session. The visible message should stay at the same position. Return to latest
+and reload to verify that the system entry persists in chronological order.
+Also reload a short channel containing mostly system updates. Every entry should
+remain visible when the entire timeline fits without scrolling.
+
## Agent session entities
The Agents list includes owned and shared sessions. Rows show the shared agent
@@ -376,6 +388,8 @@ else's message. Check both root messages and thread replies from a Home split:
an incoming selection must not mark the Home item done or edit the thread root.
Press `Escape` to clear selection; the parent Home shortcut is then available
again. Typing `e` in the composer or inline editor should still enter text.
+Verify a message link in a fresh browser tab as well as inside an open channel:
+the initial page should center the requested message, including older history.
Returning through split navigation restores the saved message position and expanded
threads. Switching channel tabs and returning restores the Messages position,
expanded threads, and pending reply from when the tab was left. The `Scroll to bottom` control appears when scrolling down through history;
diff --git a/packages/sdk/generated/storage/index.ts b/packages/sdk/generated/storage/index.ts
index a5417c5fb5..1371d308db 100644
--- a/packages/sdk/generated/storage/index.ts
+++ b/packages/sdk/generated/storage/index.ts
@@ -1,4 +1,4 @@
// This file is auto-generated by @hey-api/openapi-ts
export { type Options, Sdk } from './sdk.gen';
-export type { AccessiblePipeline, AccessLevel, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseOp, DatabaseView, DataType, DateOperator, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestId, GuestJoinRequest, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, OpRefusalResponse, OpResult, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestedHarnessScope, RequestedLayout, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResponseStatus, ResponseSummary, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
+export type { AccessiblePipeline, AccessLevel, ActiveCallsResponse, ActiveCallSummary, ActiveMeeting, ActiveMeetingsResponse, ActivityType, AddFavoriteData, AddFavoriteError, AddFavoriteErrors, AddFavoriteRequest, AddFavoriteResponse, AddFavoriteResponses, AddParticipantsData, AddParticipantsError, AddParticipantsErrors, AddParticipantsRequest, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerError, AddPinHandlerErrors, AddPinHandlerResponse, AddPinHandlerResponses, AddPinRequest, Agent, AgentActionId, AgentChannelScope, AgentMcpServer, AgentMcpServers, AgentPullRequestState, AgentSessionFilters, AgentSessionLifecycleEvent, Anchor, AnchorId, AnchorResponse, AnnotationIncrementalUpdate, Answer, ApiActivity, ApiAttachmentChannelReference, ApiAttachmentEntityReference, ApiAttachmentGenericReference, ApiChannelAttachment, ApiChannelAttachmentsPage, ApiChannelDetail, ApiChannelListMessage, ApiChannelListPage, ApiChannelListParticipant, ApiChannelListType, ApiChannelParticipant, ApiChannelWithLatest, ApiEntityFilterAst, ApiGroupByField, ApiGroupMeta, ApiParticipantListRole, ApiParticipantRole, ApiPropertyEntityType, AppliedOps, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponse, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsError, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponse, ApplyDatabaseOpsResponses, ApplyOpsRequest, ApplyOpsResponse, ApproveHarnessPairingData, ApproveHarnessPairingError, ApproveHarnessPairingErrors, ApproveHarnessPairingResponse, ApproveHarnessPairingResponses, ApprovePairingRequest, AttachmentChange, AttendeeResponseStatus, Audience, Awareness, AwarenessRelay, BasicDocument, BasicDocumentSubType, BomPart, BookingTarget, Bot, BotChannel, BotChannelType, BotId, BotKind, BotOwner, BotOwnerProfile, BotSenderProfile, BotToken, BranchNameResponse, BTreeMap, BulkWakeupRequest, BulkWakeupResponse, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponse, BulkWakeupSyncServiceDocumentsResponses, CalendarAttendee, CalendarEvent, CalendarEventFilters, CalendarEventSourceContent, CalendarMentionEvent, CalendarMentionPreviewItem, CalendarMentionPreviewKind, CalendarMentionPreviewRequest, CalendarMentionPreviewRequestItem, CalendarMentionPreviewResponse, CalendarOccurrence, CalendarOccurrenceItem, CalendarOccurrenceResponse, CalendarSyncStatus, CallActiveResponse, CallFilters, CallRecord, CallRecordGuest, CallRecordParticipant, CallRecordPreview, CallRecordPreviewData, CallRecordTranscriptSegment, CallStatus, CallTokenResponse, CallWebhookData, CallWebhookError, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponse, CancelSlackImportResponses, CardPosition, CastVerdict, CellValue, CellWrite, ChangedFileDto, ChangesetDto, ChangesetSourceDto, Channel, ChannelCreatedMetadata, ChannelDeletedMetadata, ChannelFilters, ChannelJoinCodeResponse, ChannelLabel, ChannelLabelRule, ChannelLabelsList, ChannelMessage, ChannelParticipant, ChannelParticipantAddedMetadata, ChannelParticipantRemovedMetadata, ChannelPictureChangedMetadata, ChannelPreview, ChannelPreviewData, ChannelSender, ChannelSharePermission, ChannelThreadFilters, ChannelTopicEvent, ChannelType, ChannelUpdatedMetadata, ChannelWebhookRequest, ChannelWebhookResponse, ChannelWithParticipants, Chat, ChatFilters, CheckActiveCallData, CheckActiveCallError, CheckActiveCallErrors, CheckActiveCallResponse, CheckActiveCallResponses, ClaimedPairing, ClaimHarnessPairingData, ClaimHarnessPairingError, ClaimHarnessPairingErrors, ClaimHarnessPairingResponse, ClaimHarnessPairingResponses, ClaimPairingRequest, ClientOptions, CloudStorageItemType, CollaborateFormData, CollaborateFormError, CollaborateFormErrors, CollaborateFormResponse, CollaborateFormResponses, CollabSurfaceResponse, CollabSurfaceTokenResponse, Column, ColumnCast, ColumnChange, ColumnChangeKind, ColumnConfig, ColumnConversion, ColumnConversionRequest, ColumnDetail, ColumnKind, ColumnProtection, ColumnResult, CommandFailure, CommandRejectedMetadata, CommittedChange, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponse, CompleteSlackImportUploadsResponses, CompleteUploads, ConferenceProvider, Conjunction, ConversationId, ConversationKind, ConversationMetadata, ConversationProgress, ConversationSeal, ConversationStatus, ConvertDatabaseColumnData, ConvertDatabaseColumnError, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponse, ConvertDatabaseColumnResponses, ConvertedCell, CopyDocumentData, CopyDocumentError, CopyDocumentErrors, CopyDocumentQueryParams, CopyDocumentRequest, CopyDocumentResponse, CopyDocumentResponse2, CopyDocumentResponses, CountedReaction, CreateAgentData, CreateAgentError, CreateAgentErrors, CreateAgentRequest, CreateAgentResponse, CreateAgentResponses, CreateAnchorData, CreateAnchorError, CreateAnchorErrors, CreateAnchorResponse, CreateAnchorResponses, CreateBotRequest, CreateBulkDocumentResponse, CreateBulkDocumentResponseData, CreateChannelData, CreateChannelError, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelError, CreateChannelLabelErrors, CreateChannelLabelRequest, CreateChannelLabelResponse, CreateChannelLabelResponses, CreateChannelRequest, CreateChannelResponse, CreateChannelResponse2, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotError, CreateChannelScopedBotErrors, CreateChannelScopedBotRequest, CreateChannelScopedBotResponse, CreateChannelScopedBotResponse2, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenError, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponse, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyError, CreateCrmCompanyErrors, CreateCrmCompanyRequest, CreateCrmCompanyResponse, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactError, CreateCrmContactErrors, CreateCrmContactRequest, CreateCrmContactResponse, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponse, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseError, CreateDatabaseErrors, CreateDatabaseRequest, CreateDatabaseResponse, CreateDatabaseResponses, CreateDocumentData, CreateDocumentError, CreateDocumentErrors, CreateDocumentRequest, CreateDocumentResponse, CreateDocumentResponseData, CreateDocumentResponses, CreatedPairing, CreatedUserApiKey, CreateEntityMentionData, CreateEntityMentionError, CreateEntityMentionErrors, CreateEntityMentionRequest, CreateEntityMentionResponse, CreateEntityMentionResponse2, CreateEntityMentionResponses, CreateForm, CreateFormData, CreateFormError, CreateFormErrors, CreateFormResponse, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingError, CreateHarnessPairingErrors, CreateHarnessPairingResponse, CreateHarnessPairingResponses, CreateImport, CreateInitiativeData, CreateInitiativeError, CreateInitiativeErrors, CreateInitiativeRequest, CreateInitiativeResponse, CreateInitiativeResponses, CreateInstructionsDocumentResponse, CreateInstructionsHandlerData, CreateInstructionsHandlerError, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponse, CreateInstructionsHandlerResponses, CreateMarkdownDocumentRequest, CreateMarkdownDocumentResponse, CreateMarkdownHandlerData, CreateMarkdownHandlerError, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponse, CreateMarkdownHandlerResponses, CreateMeetingRequest, CreatePairingRequest, CreatePipeline, CreateProjectHandlerData, CreateProjectHandlerError, CreateProjectHandlerErrors, CreateProjectHandlerResponse, CreateProjectHandlerResponses, CreateProjectRequest, CreateProjectResponse, CreateSkillHandlerData, CreateSkillHandlerError, CreateSkillHandlerErrors, CreateSkillHandlerResponse, CreateSkillHandlerResponses, CreateSkillRequest, CreateSkillResponse, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponse, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerError, CreateSnippetHandlerErrors, CreateSnippetHandlerResponse, CreateSnippetHandlerResponses, CreateSnippetRequest, CreateSnippetResponse, CreateTaskHandlerData, CreateTaskHandlerError, CreateTaskHandlerErrors, CreateTaskHandlerResponse, CreateTaskHandlerResponses, CreateTaskRequest, CreateTaskResponse, CreateToken, CreateUnthreadedAnchorRequest, CreateUnthreadedAnchorResponse, CreateUnthreadedPdfAnchorRequest, CreateUserApiKeyData, CreateUserApiKeyError, CreateUserApiKeyErrors, CreateUserApiKeyRequest, CreateUserApiKeyResponse, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerError, CreateViewHandlerErrors, CreateViewHandlerResponse, CreateViewHandlerResponses, CreateViewRequest, CreateWebhookData, CreateWebhookError, CreateWebhookErrors, CreateWebhookRequest, CreateWebhookResponse, CreateWebhookResponse2, CreateWebhookResponses, CrmCompanyFilters, CrmCompanyResponse, CrmContactResponse, CrmDomainResponse, CrmPermissionRole, CrmStageInput, CrmStageResponse, CrmStagesResponse, CrmTeamSettingsResponse, CustomSpeakerAssignment, Database, DatabaseDetail, DatabaseOp, DatabaseView, DataType, DateOperator, DeleteAnchorData, DeleteAnchorError, DeleteAnchorErrors, DeleteAnchorResponse, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordError, DeleteCallRecordErrors, DeleteCallRecordResponse, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelError, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelError, DeleteChannelLabelErrors, DeleteChannelLabelResponse, DeleteChannelLabelResponses, DeleteChannelResponse, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceError, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponse, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentError, DeleteDocumentErrors, DeleteDocumentResponse, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionError, DeleteEntityMentionErrors, DeleteEntityMentionResponse, DeleteEntityMentionResponse2, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessError, DeleteHarnessErrors, DeleteHarnessResponse, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerError, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponse, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeError, DeleteInitiativeErrors, DeleteInitiativeResponse, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerError, DeleteProjectHandlerErrors, DeleteProjectHandlerResponse, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessError, DeleteSelfHarnessErrors, DeleteSelfHarnessResponse, DeleteSelfHarnessResponses, DeleteUnthreadedAnchorRequest, DeleteUnthreadedAnchorResponse, DeleteUnthreadedPdfAnchorRequest, DeleteUserApiKeyData, DeleteUserApiKeyError, DeleteUserApiKeyErrors, DeleteUserApiKeyResponse, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationError, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponse, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerError, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookError, DeleteWebhookErrors, DeleteWebhookResponse, DeleteWebhookResponses, DocumentBasic, DocumentContent, DocumentContentLocation, DocumentContentState, DocumentContentUploadedMetadata, DocumentCopiedMetadata, DocumentCreatedMetadata, DocumentDeletedMetadata, DocumentFilters, DocumentId, DocumentInteractionMetadata, DocumentMetadata, DocumentMetadataWithContent, DocumentPermissionsToken, DocumentPermissionsTokenRequest, DocumentPermissionsTokenResponse, DocumentPreview, DocumentPreviewData, DocumentPreviewDataSubType, DocumentPurgedMetadata, DocumentResponse, DocumentResponseMetadata, DocumentResponseMetadataWithContent, DocumentStorageServiceApiVersion, DocumentSubType, DocumentSyncContentUpdatedMetadata, DocumentSyncEditor, DocumentTeamShareResponse, DocumentTopicEvent, DocumentUpdatedMetadata, EditAnchorData, EditAnchorError, EditAnchorErrors, EditAnchorRequest, EditAnchorResponse, EditAnchorResponse2, EditAnchorResponses, EditCallRecordData, EditCallRecordError, EditCallRecordErrors, EditCallRecordRequest, EditCallRecordResponse, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptError, EditCallTranscriptErrors, EditCallTranscriptRequest, EditCallTranscriptResponse, EditCallTranscriptResponses, EditDocumentData, EditDocumentError, EditDocumentErrors, EditDocumentResponse, EditDocumentResponse2, EditDocumentResponses, EditDocumentServiceArgs, EditMyFormResponseData, EditMyFormResponseError, EditMyFormResponseErrors, EditMyFormResponseResponse, EditMyFormResponseResponses, EditPdfAnchorRequest, EditPdfPlaceableCommentAnchorRequest, EditProjectV2Data, EditProjectV2Error, EditProjectV2Errors, EditProjectV2Response, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Error, EditThreadV2Errors, EditThreadV2Response, EditThreadV2Responses, EmailFilters, EmailFollowup, EmailFollowupCommand, EmailFollowupResponse, EmailReminderCondition, EmailReminderPage, EmailReminderSummary, EmptyResponse, EnsureCollabSurfaceData, EnsureCollabSurfaceError, EnsureCollabSurfaceErrors, EnsureCollabSurfaceRequest, EnsureCollabSurfaceResponse, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponse, EnsureStarterHandlerResponses, EntityFilters, EntityKind, EntityMessageCreateData, EntityMessageCreateResponse, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponse, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponse, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponse, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponse, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponse, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponse, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponse, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponse, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponse, EntityMessageTypingResponses, EntityPermission, EntityPermissionResponse, EntityRef, EntityReference, EntityType, ErrorResponse, EventReminderOverride, EventReminders, EventStatus, EventTime, EventTransparency, EventType, EventVisibility, ExcludedDefaultView, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerError, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExcludeDefaultViewRequest, ExportDocumentData, ExportDocumentError, ExportDocumentErrors, ExportDocumentResponse, ExportDocumentResponse2, ExportDocumentResponses, Favorite, FavoriteEntityRef, FavoritesList, FileChangeKindDto, FileSystemNodeWithIds, FileType, FileTypeUpdate, FilterCondition, FilterGroup, FilterNode, FilterTest, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponse, FinalizeSlackImportResponses, FolderItem, FollowupState, ForeignEntity, ForeignEntityFilters, Form, FormAccess, FormCollaboration, FormDetail, FormErrorCode, FormErrorResponse, FormLayout, FormPublicationProblem, FormQuestionDetail, FormResponse, FormSection, FormSectionDetail, FormSource, FormStatus, FormTally, GenericErrorResponse, GenericResponse, GenericSuccessResponse, GetActiveCallsData, GetActiveCallsError, GetActiveCallsErrors, GetActiveCallsResponse, GetActiveCallsResponses, GetActivityData, GetActivityError, GetActivityErrors, GetActivityResponse, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesError, GetAttachmentReferencesErrors, GetAttachmentReferencesResponse, GetAttachmentReferencesResponse2, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewError, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewRequest, GetBatchCallRecordPreviewResponse, GetBatchCallRecordPreviewResponse2, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewError, GetBatchChannelPreviewErrors, GetBatchChannelPreviewRequest, GetBatchChannelPreviewResponse, GetBatchChannelPreviewResponse2, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerError, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponse, GetBatchPreviewHandlerResponses, GetBatchPreviewRequest, GetBatchPreviewResponse, GetBatchProjectPreviewData, GetBatchProjectPreviewError, GetBatchProjectPreviewErrors, GetBatchProjectPreviewRequest, GetBatchProjectPreviewResponse, GetBatchProjectPreviewResponse2, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesError, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponse, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordError, GetCallRecordErrors, GetCallRecordResponse, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsError, GetChannelAttachmentsErrors, GetChannelAttachmentsResponse, GetChannelAttachmentsResponses, GetChannelData, GetChannelError, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkError, GetChannelJoinLinkErrors, GetChannelJoinLinkResponse, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsError, GetChannelParticipantsErrors, GetChannelParticipantsResponse, GetChannelParticipantsResponses, GetChannelResponse, GetChannelResponses, GetChannelsData, GetChannelsError, GetChannelsErrors, GetChannelsResponse, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceError, GetCollabSurfaceErrors, GetCollabSurfaceResponse, GetCollabSurfaceResponses, GetCompanyData, GetCompanyError, GetCompanyErrors, GetCompanyResponse, GetCompanyResponses, GetContactByEmailData, GetContactByEmailError, GetContactByEmailErrors, GetContactByEmailResponse, GetContactByEmailResponse2, GetContactByEmailResponses, GetContactData, GetContactError, GetContactErrors, GetContactResponse, GetContactResponses, GetCrmPipelineData, GetCrmPipelineResponse, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponse, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponse, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsError, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponse, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseError, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsError, GetDatabasePermissionsErrors, GetDatabasePermissionsResponse, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryError, GetDatabaseQueryErrors, GetDatabaseQueryResponse, GetDatabaseQueryResponses, GetDatabaseResponse, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryError, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponse, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesError, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponse, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsError, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponse, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsError, GetDocumentAnchorsErrors, GetDocumentAnchorsResponse, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameError, GetDocumentBranchNameErrors, GetDocumentBranchNameResponse, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugError, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponse, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentError, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsError, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponse, GetDocumentGithubPullRequestsResponses, GetDocumentKeyResponse, GetDocumentKeyResponseData, GetDocumentListHandlerData, GetDocumentListHandlerError, GetDocumentListHandlerErrors, GetDocumentListHandlerResponse, GetDocumentListHandlerResponses, GetDocumentListResult, GetDocumentLocationV3Data, GetDocumentLocationV3Error, GetDocumentLocationV3Errors, GetDocumentLocationV3Response, GetDocumentLocationV3Responses, GetDocumentPermissionsResponseDataV2, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenError, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponse, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Error, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Response, GetDocumentPermissionsV2Responses, GetDocumentProcessingResult, GetDocumentProcessingResultData, GetDocumentProcessingResultError, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponse, GetDocumentProcessingResultResponse2, GetDocumentProcessingResultResponses, GetDocumentResponse, GetDocumentResponse2, GetDocumentResponseData, GetDocumentResponses, GetDocumentSearchResponse, GetDocumentShortIdData, GetDocumentShortIdError, GetDocumentShortIdErrors, GetDocumentShortIdResponse, GetDocumentShortIdResponses, GetDocumentsResponse, GetDocumentTeamShareData, GetDocumentTeamShareError, GetDocumentTeamShareErrors, GetDocumentTeamShareResponse, GetDocumentTeamShareResponses, GetDocumentUserAccessLevelResponse, GetDocumentVersionData, GetDocumentVersionError, GetDocumentVersionErrors, GetDocumentVersionResponse, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerError, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponse, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupError, GetEmailFollowupErrors, GetEmailFollowupResponse, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponse, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceError, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponse, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityError, GetForeignEntityErrors, GetForeignEntityResponse, GetForeignEntityResponses, GetFormData, GetFormError, GetFormErrors, GetFormPermissionsData, GetFormPermissionsError, GetFormPermissionsErrors, GetFormPermissionsResponse, GetFormPermissionsResponses, GetFormResponse, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryError, GetFormResponseSummaryErrors, GetFormResponseSummaryResponse, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyError, GetFormTallyErrors, GetFormTallyResponse, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesError, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchError, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponse, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponse, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestError, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsError, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponse, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponse, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksError, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponse, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingError, GetHarnessPairingErrors, GetHarnessPairingResponse, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerError, GetHistoryHandlerErrors, GetHistoryHandlerResponse, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeError, GetInitiativeErrors, GetInitiativeResponse, GetInitiativeResponses, GetInstructionsDocumentResponse, GetInstructionsHandlerData, GetInstructionsHandlerError, GetInstructionsHandlerErrors, GetInstructionsHandlerResponse, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupError, GetItemsSoupErrors, GetItemsSoupResponse, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerError, GetLocationHandlerErrors, GetLocationHandlerResponse, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseError, GetMyFormResponseErrors, GetMyFormResponseResponse, GetMyFormResponseResponses, GetOrCreateAction, GetOrCreateCallData, GetOrCreateCallError, GetOrCreateCallErrors, GetOrCreateCallResponse, GetOrCreateCallResponses, GetOrCreateChannelResponse, GetOrCreateDmData, GetOrCreateDmError, GetOrCreateDmErrors, GetOrCreateDmRequest, GetOrCreateDmResponse, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateError, GetOrCreatePrivateErrors, GetOrCreatePrivateRequest, GetOrCreatePrivateResponse, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerError, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponse, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerError, GetPinsHandlerErrors, GetPinsHandlerResponse, GetPinsHandlerResponses, GetPinsResponse, GetProjectContentHandlerData, GetProjectContentHandlerError, GetProjectContentHandlerErrors, GetProjectContentHandlerResponse, GetProjectContentHandlerResponses, GetProjectContentResponse, GetProjectHandlerData, GetProjectHandlerError, GetProjectHandlerErrors, GetProjectHandlerResponse, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Error, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Response, GetProjectPermissionsV2Responses, GetProjectResponse, GetProjectResponseData, GetProjectsHandlerData, GetProjectsHandlerError, GetProjectsHandlerErrors, GetProjectsHandlerResponse, GetProjectsHandlerResponses, GetProjectsResponse, GetProjectUserAccessLevelData, GetProjectUserAccessLevelError, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponse, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusError, GetRingStatusErrors, GetRingStatusResponse, GetRingStatusResponses, GetSelfBotData, GetSelfBotError, GetSelfBotErrors, GetSelfBotResponse, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessError, GetSelfHarnessErrors, GetSelfHarnessResponse, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponse, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerError, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponse, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerError, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponse, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationError, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponse, GetUserDocumentViewLocationResponses, GetUserHistoryResponse, GetViewsHandlerData, GetViewsHandlerError, GetViewsHandlerErrors, GetViewsHandlerResponse, GetViewsHandlerResponses, GetWebhookData, GetWebhookError, GetWebhookErrors, GetWebhookResponse, GetWebhookResponses, GithubLabelFacet, GithubPullRequest, GithubPullRequestChangesPatchResponse, GithubPullRequestChangesResponse, GithubPullRequestCheckRun, GithubPullRequestComment, GithubPullRequestFacets, GithubPullRequestLabel, GithubPullRequestReview, GithubPullRequestReviewDecision, GithubPullRequestReviewState, GithubPullRequestsResponse, GithubPullRequestTasks, GithubPullRequestTasksRequest, GithubPullRequestTasksResponse, GithubPullRequestUser, GithubRepositoryFacet, GithubUserFacet, GitRefDto, GroupedInitialParams, GroupedPageParams, GroupedSoupGroupPage, GroupedSoupInitialPage, GroupedSoupPage, GroupedSoupSort, GuestId, GuestJoinRequest, HandlerData, HandlerError, HandlerErrors, HandlerResponse, HandlerResponses, Harness, HarnessAgent, HarnessId, HarnessOwner, HarnessSession, HashMap, HealthHandlerData, HealthHandlerResponse, HealthHandlerResponses, HighlightType, ImportCounters, ImportDatabaseTableData, ImportDatabaseTableError, ImportDatabaseTableErrors, ImportDatabaseTableResponse, ImportDatabaseTableResponses, ImportedAuthor, ImportError, ImportLimits, ImportPage, ImportProgress, ImportTable, ImportWarning, InferColumnTypeOutcome, InferColumnTypeRequest, InferDatabaseColumnTypeData, InferDatabaseColumnTypeError, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponse, InferDatabaseColumnTypeResponses, InFlightTurnSummary, IngestTranscriptData, IngestTranscriptError, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsError, InitializeUserDocumentsErrors, InitializeUserDocumentsResponse, InitializeUserDocumentsResponses, InitialPropertyValue, InitiativeDetail, InitiativeFilters, InitiativeId, InitiativeList, InitiativeSummary, InputReceivedMetadata, InstallSyncData, InstallSyncErrors, InteractionReason, InviteMeetingRequest, InviteMeetingUsersRequest, Item, ItemWithUserAccessLevel, JobId, JobProcessingResultHandlerData, JobProcessingResultHandlerError, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponse, JobProcessingResultHandlerResponses, JobStatus, JoinChannelByCodeData, JoinChannelByCodeError, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelError, JoinChannelErrors, JoinChannelResponses, KeySegment, Lane, LaneKey, LatestMessage, LayoutProblem, LeaveCallResponse, LeaveChannelData, LeaveChannelError, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallError, LeaveOrEndCallErrors, LeaveOrEndCallResponse, LeaveOrEndCallResponses, LinkShare, ListAccessibleFormsData, ListAccessibleFormsError, ListAccessibleFormsErrors, ListAccessibleFormsResponse, ListAccessibleFormsResponses, ListAgentsData, ListAgentsError, ListAgentsErrors, ListAgentsResponse, ListAgentsResponses, ListBotChannelsData, ListBotChannelsError, ListBotChannelsErrors, ListBotChannelsResponse, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsError, ListChannelLabelsErrors, ListChannelLabelsResponse, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsError, ListCompanyContactsErrors, ListCompanyContactsResponse, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponse, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsError, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponse, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesError, ListDatabasesErrors, ListDatabasesResponse, ListDatabasesResponses, ListedDatabase, ListedForm, ListEmailRemindersData, ListEmailRemindersError, ListEmailRemindersErrors, ListEmailRemindersResponse, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesError, ListFavoritesErrors, ListFavoritesResponse, ListFavoritesResponses, ListFormsData, ListFormsError, ListFormsErrors, ListFormsResponse, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsError, ListHarnessAgentsErrors, ListHarnessAgentsResponse, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesError, ListHarnessesErrors, ListHarnessesResponse, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsError, ListHarnessSessionsErrors, ListHarnessSessionsResponse, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesError, ListInitiativesErrors, ListInitiativesResponse, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponse, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponse, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponse, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponse, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysError, ListUserApiKeysErrors, ListUserApiKeysResponse, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksError, ListWebhooksErrors, ListWebhooksResponse, ListWebhooksResponse2, ListWebhooksResponses, LocationResponseData, LocationResponseV3, MacroUserIdStr, Meeting, MeetingCancelData, MeetingCancelError, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationError, MeetingCancelPreparationErrors, MeetingCancelPreparationResponse, MeetingCancelPreparationResponses, MeetingCancelResponse, MeetingCancelResponses, MeetingCreateData, MeetingCreateError, MeetingCreateErrors, MeetingCreateResponse, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinError, MeetingGuestJoinErrors, MeetingGuestJoinResponse, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsError, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponse, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteError, MeetingInviteErrors, MeetingInvitePermissions, MeetingInvitePermissionsData, MeetingInvitePermissionsError, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponse, MeetingInvitePermissionsResponses, MeetingInviteResponse, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersError, MeetingInviteUsersErrors, MeetingInviteUsersResponse, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinError, MeetingJoinErrors, MeetingJoinResponse, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveError, MeetingLeaveErrors, MeetingLeaveResponse, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveError, MeetingListActiveErrors, MeetingListActiveResponse, MeetingListActiveResponses, MeetingListData, MeetingListError, MeetingListErrors, MeetingListResponse, MeetingListResponses, MeetingLookupData, MeetingLookupError, MeetingLookupErrors, MeetingLookupResponse, MeetingLookupResponses, MeetingParticipant, MeetingParticipants, MeetingParticipantsData, MeetingParticipantsError, MeetingParticipantsErrors, MeetingParticipantsResponse, MeetingParticipantsResponses, MeetingPreparation, MeetingPrepareData, MeetingPrepareError, MeetingPrepareErrors, MeetingPrepareResponse, MeetingPrepareResponses, MeetingShareData, MeetingShareError, MeetingShareErrors, MeetingShareResponse, MeetingShareResponses, MeetingsResponse, MeetingToken, MeetingUpdateData, MeetingUpdateError, MeetingUpdateErrors, MeetingUpdateResponse, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponse, MentionPreviewsResponses, Message, MessageAttachment, MessageAttachmentCreatedMetadata, MessageAttachmentRemovedMetadata, MessageChange, MessageCursor, MessageDeletedMetadata, MessageDirection, MessageEvent, MessageEventAttachment, MessageListItem, MessageMentionedMetadata, MessagePage, MessageParent, MessagePatch, MessagePatchedMetadata, MessagePostedMetadata, MessageThread, MessageThreadPreview, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponse, MessageTimelineEntriesResponses, MessageTimelineEntry, MessageTimelinePage, MessageTimelineQuery, MessageTimelineResponse, MessageTimelineResponses, MessageTopicEvent, MyResponse, NewAttachment, NewColumn, NewOption, NewThreadAnchor, NewView, NotificationFilters, NotificationState, NumberOperator, OpBatch, OpRefusalResponse, OpResult, OptionRef, PairingDetails, Params, ParticipantRole, PatchBotRequest, PatchChannelData, PatchChannelError, PatchChannelErrors, PatchChannelRequest, PatchChannelResponse, PatchChannelResponses, PatchMessageNotificationPolicy, PatchProjectRequestV2, PatchThreadRequestV2, PatchViewHandlerData, PatchViewHandlerError, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookError, PatchWebhookErrors, PatchWebhookRequest, PatchWebhookResponse, PatchWebhookResponses, PdfAnchor, PdfAnchorId, PdfHighlightAnchor, PdfHighlightAnchorRequest, PdfHighlightRect, PdfHighlightRectAnchorRequest, PdfPlaceableCommentAnchor, PendingClaimResponse, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentError, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponse, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectError, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponse, PermanentlyDeleteProjectResponses, PinnedItem, PinRequest, Pipeline, PipelineRecordType, PipelineSharing, PostActivityData, PostActivityError, PostActivityErrors, PostActivityRequest, PostActivityResponse, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookError, PostChannelBotWebhookErrors, PostChannelBotWebhookResponse, PostChannelBotWebhookResponses, PostGroupedSoupAstGroupPageRequest, PostGroupedSoupAstInitialRequest, PostGroupedSoupAstRequest, PostItemsSoupAstData, PostItemsSoupAstError, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedError, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponse, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponse, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupError, PostItemsSoupErrors, PostItemsSoupResponse, PostItemsSoupResponses, PostMessage, PostMessageNotificationPolicy, PostSoupAstRequest, PostSoupRequest, PresaveDocumentHandlerData, PresaveDocumentHandlerError, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponse, PresaveDocumentHandlerResponses, PreSaveDocumentRequest, PreSaveDocumentResponse, PreSaveDocumentResponseData, PresenceOperator, PresignedUrl, PreviewSmartTagData, PreviewSmartTagError, PreviewSmartTagErrors, PreviewSmartTagResponse, PreviewSmartTagResponses, Project, ProjectDeleteResponseData, ProjectDocumentStatus, ProjectFilters, ProjectPreview, ProjectPreviewData, PropertyDefinition, PropertyDefinitionWithOptions, PropertyFilter, PropertyInput, PropertyOption, PropertyOptionValue, PropertyOwner, PropertyValue, PutCrmTeamSettingsData, PutCrmTeamSettingsError, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponse, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesError, PutCrmTeamStagesErrors, PutCrmTeamStagesResponse, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutError, PutFormLayoutErrors, PutFormLayoutResponse, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponse, QueryCrmPipelineRowsResponses, QueryDefinition, QuestionLayout, QuestionOption, QuestionTally, ReactionInput, RecentlyDeletedData, RecentlyDeletedError, RecentlyDeletedErrors, RecentlyDeletedResponse, RecentlyDeletedResponseData, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponse, RegisterSlackImportUploadsResponses, RegisterUploads, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotError, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponse, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityError, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsError, RemoveParticipantsErrors, RemoveParticipantsRequest, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerError, RemovePinHandlerErrors, RemovePinHandlerResponse, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelError, RenameChannelLabelErrors, RenameChannelLabelRequest, RenameChannelLabelResponse, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponse, RenameCrmPipelineResponses, RenamePipeline, ReorderFavoritesData, ReorderFavoritesError, ReorderFavoritesErrors, ReorderFavoritesRequest, ReorderFavoritesResponses, ReorderPinRequest, ReorderPinsHandlerData, ReorderPinsHandlerError, ReorderPinsHandlerErrors, ReorderPinsHandlerResponse, ReorderPinsHandlerResponses, ReplaceCrmStagesRequest, RequestedHarnessScope, RequestedLayout, ResetCrmTeamStagesData, ResetCrmTeamStagesError, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponse, ResetCrmTeamStagesResponses, ResponseStatus, ResponseSummary, RevertDeleteDocumentData, RevertDeleteDocumentError, RevertDeleteDocumentErrors, RevertDeleteDocumentResponse, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectError, RevertDeleteProjectErrors, RevertDeleteProjectResponse, RevertDeleteProjectResponses, RingStatus, RingStatusResponse, RowChange, RowChangeKind, RowChanges, RowHistoryEntry, RowHistoryResponse, RowId, RowsChange, RowsResult, S3ObjectInfo, SaveBomPart, SaveDatabaseQueryData, SaveDatabaseQueryError, SaveDatabaseQueryErrors, SaveDatabaseQueryResponse, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerError, SaveDocumentHandlerErrors, SaveDocumentHandlerResponse, SaveDocumentHandlerResponses, SaveDocumentRequest, SaveDocumentResponse, SaveDocumentResponseData, SavedQuery, SaveQueryRequest, SearchContactsData, SearchContactsError, SearchContactsErrors, SearchContactsResponse, SearchContactsResponse2, SearchContactsResponses, SearchState, SectionCount, SessionDeletedMetadata, SessionIdentity, SessionMentionedMetadata, SessionOpenedMetadata, SessionRenamedMetadata, SessionSettledMetadata, SessionStoppedMetadata, SetChannelLabelData, SetChannelLabelError, SetChannelLabelErrors, SetChannelLabelRequest, SetChannelLabelResponse, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureError, SetChannelPictureErrors, SetChannelPictureRequest, SetChannelPictureResponse, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenError, SetCompanyHiddenErrors, SetCompanyHiddenRequest, SetCompanyHiddenResponse, SetCompanyHiddenResponses, SetCompanyNameRequest, SetContactHiddenData, SetContactHiddenError, SetContactHiddenErrors, SetContactHiddenRequest, SetContactHiddenResponse, SetContactHiddenResponses, SetContactNameRequest, SetCrmCompanyNameData, SetCrmCompanyNameError, SetCrmCompanyNameErrors, SetCrmCompanyNameResponse, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameError, SetCrmContactNameErrors, SetCrmContactNameResponse, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareError, SetDocumentTeamShareErrors, SetDocumentTeamShareRequest, SetDocumentTeamShareResponse, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupError, SetEmailFollowupErrors, SetEmailFollowupResponse, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncError, SetEmailSyncErrors, SetEmailSyncRequest, SetEmailSyncResponse, SetEmailSyncResponses, SetOperator, SetPropertyValue, Sha256Digest, ShareCrmPipelineData, ShareCrmPipelineResponse, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessError, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponse, ShareDatabaseAwarenessResponses, SharedEmailFilter, SharePermissionV2, SharePipeline, ShortIdResponse, SimpleMention, SimpleSaveData, SimpleSaveError, SimpleSaveErrors, SimpleSaveResponse, SimpleSaveResponses, SkippedCell, SlackCompleteRequest, SlackCreateRequest, SlackRegisterRequest, SlackTimestamp, SlackUserId, SmartTagChannelMatch, SmartTagPreview, SortDirection, SortKey, SoupAgentSessionSoupPropertiesField, SoupApiItem, SoupApiSort, SoupApiSortDirection, SoupAttachment, SoupCalendarEventSoupPropertiesField, SoupCalendarEventTime, SoupCallRecordGuest, SoupCallRecordParticipant, SoupCallRecordSoupPropertiesField, SoupChannel, SoupChannelThread, SoupChatSoupPropertiesField, SoupContact, SoupCountedReaction, SoupCrmCompanySoupPropertiesField, SoupCrmContactSoupPropertiesField, SoupCrmDomain, SoupDatabaseRowSoupPropertiesField, SoupDocumentSoupPropertiesField, SoupDocumentSubType, SoupEmailThreadPreview, SoupEnrichedEmailThreadPreviewSoupPropertiesField, SoupForeignEntity, SoupInitiativeSoupPropertiesField, SoupItem, SoupLabel, SoupLabelListVisibility, SoupLabelType, SoupMessageAttachment, SoupMessageListVisibility, SoupMessageSender, SoupMessageSenderType, SoupPage, SoupProjectSoupPropertiesField, SoupPropertiesField, SoupProperty, SoupThreadInfo, SoupThreadReply, SourceBinding, SourceId, SourceIdentity, StarterDatabase, StarterDocumentsResponse, StorageRow, StorageRows, StorageRowsQuery, StoredGithubPullRequest, StreamEventsData, StreamEventsError, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, String, Submission, SubmissionOutcome, SubmitFormResponseData, SubmitFormResponseError, SubmitFormResponseErrors, SubmitFormResponseResponse, SubmitFormResponseResponses, SuccessResponse, SurfaceState, SyncServiceVersionId, SystemSkillSummary, Table, TableChange, TableChanged, TableChanges, TableDetail, TableResult, TableVersion, TagFilterMode, TakenId, TallyBucket, TallyValue, TaskFilters, TeamCalendarContent, TeamCalendarCoverage, TeamCalendarDetails, TeamCalendarItem, TeamCalendarMember, TeamCalendarPage, TeamCalendarSharing, TeamOutOfOfficeItem, TeamOutOfOfficeResponse, TeamRole, TextOperator, ThreadAnchor, ThreadOrigin, ThreadPatch, ThreadState, TimelineActivity, ToggleShareWithTeamData, ToggleShareWithTeamError, ToggleShareWithTeamErrors, ToggleShareWithTeamResponse, ToggleShareWithTeamResponses, TouchedColumn, TouchedRow, TranscribeDictationData, TranscribeDictationError, TranscribeDictationErrors, TranscribeDictationResponse, TranscribeDictationResponses, TranscribeResponse, TranscriptSegmentRequest, TrashCrmPipelineData, TrashCrmPipelineResponse, TrashCrmPipelineResponses, TrashPipeline, TurnEndedMetadata, TurnStartedMetadata, TurnSummary, TypedSuccessResponse, TypedSuccessResponseGetDocumentResponseData, TypingInput, UndoChangeResponse, UndoDatabaseChangeData, UndoDatabaseChangeError, UndoDatabaseChangeErrors, UndoDatabaseChangeResponse, UndoDatabaseChangeResponses, UndoOutcome, UndoRefusal, UnlockedBooking, UpdateAgentData, UpdateAgentError, UpdateAgentErrors, UpdateAgentRequest, UpdateAgentResponse, UpdateAgentResponses, UpdateChannelSharePermission, UpdateCrmTeamSettingsRequest, UpdateDatabasePermissionsData, UpdateDatabasePermissionsError, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponse, UpdateDatabasePermissionsResponses, UpdateForm, UpdateFormData, UpdateFormError, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsError, UpdateFormPermissionsErrors, UpdateFormPermissionsResponse, UpdateFormPermissionsResponses, UpdateFormResponse, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeError, UpdateInitiativeErrors, UpdateInitiativeRequest, UpdateInitiativeResponse, UpdateInitiativeResponses, UpdateMeetingRequest, UpdateOperation, UpdateSharePermissionRequestV2, UploadDescriptor, UploadDocumentStatus, UploadExtractFolderHandlerData, UploadExtractFolderHandlerError, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponse, UploadExtractFolderHandlerResponses, UploadExtractFolderRequest, UploadFolderHandlerData, UploadFolderHandlerError, UploadFolderHandlerErrors, UploadFolderHandlerResponse, UploadFolderHandlerResponses, UploadFolderRequest, UploadGrant, UploadId, UpsertHistoryHandlerData, UpsertHistoryHandlerError, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponse, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationError, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationRequest, UpsertUserDocumentViewLocationResponse, UpsertUserDocumentViewLocationResponses, UserApiKeyId, UserApiKeyInfo, UserApiKeysList, UserDocumentsResponse, UserDocumentViewLocation, UserDocumentViewLocationResponse, UserPinsResponse, UserViewsResponse, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenError, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponse, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookError, ValidateWebhookErrors, ValidateWebhookResponse, ValidateWebhookResponse2, ValidateWebhookResponses, Vec, VersionedTable, View, ViewChange, ViewColumn, ViewLayout, ViewPatch, ViewPosition, ViewPositionsResponse, ViewQuery, ViewResult, ViewsResponse, WaitingForInputMetadata, Webhook, WebhookEvent, WebhookFilter, WebhookScope, WebhookStatus, WebhookValidationTestEvent, Widget, WithCallId, WithChannelId, WithDocumentId, WithProjectId } from './types.gen';
diff --git a/packages/sdk/generated/storage/sdk.gen.ts b/packages/sdk/generated/storage/sdk.gen.ts
index c2e6a863c7..9a97b852d6 100644
--- a/packages/sdk/generated/storage/sdk.gen.ts
+++ b/packages/sdk/generated/storage/sdk.gen.ts
@@ -2,7 +2,7 @@
import type { Client, ClientMeta, Options as Options2, RequestResult, ServerSentEventsResult, TDataShape } from './client';
import { client } from './client.gen';
-import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CollaborateFormData, CollaborateFormErrors, CollaborateFormResponses, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponses, ConvertDatabaseColumnData, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelErrors, CreateChannelLabelResponses, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseErrors, CreateDatabaseResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateFormData, CreateFormErrors, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInitiativeData, CreateInitiativeErrors, CreateInitiativeResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelErrors, DeleteChannelLabelResponses, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeErrors, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessErrors, DeleteSelfHarnessResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditMyFormResponseData, EditMyFormResponseErrors, EditMyFormResponseResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponses, EntityMessageCreateData, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmPipelineData, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsErrors, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryErrors, GetDatabaseQueryResponses, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupErrors, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetFormData, GetFormErrors, GetFormPermissionsData, GetFormPermissionsErrors, GetFormPermissionsResponses, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryErrors, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyErrors, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeErrors, GetInitiativeResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseErrors, GetMyFormResponseResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessErrors, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, ImportDatabaseTableData, ImportDatabaseTableErrors, ImportDatabaseTableResponses, InferDatabaseColumnTypeData, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAccessibleFormsData, ListAccessibleFormsErrors, ListAccessibleFormsResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsErrors, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListEmailRemindersData, ListEmailRemindersErrors, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListFormsData, ListFormsErrors, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsErrors, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesErrors, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MeetingCancelData, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationErrors, MeetingCancelPreparationResponses, MeetingCancelResponses, MeetingCreateData, MeetingCreateErrors, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinErrors, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteErrors, MeetingInvitePermissionsData, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponses, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersErrors, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinErrors, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveErrors, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveErrors, MeetingListActiveResponses, MeetingListData, MeetingListErrors, MeetingListResponses, MeetingLookupData, MeetingLookupErrors, MeetingLookupResponses, MeetingParticipantsData, MeetingParticipantsErrors, MeetingParticipantsResponses, MeetingPrepareData, MeetingPrepareErrors, MeetingPrepareResponses, MeetingShareData, MeetingShareErrors, MeetingShareResponses, MeetingUpdateData, MeetingUpdateErrors, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, MessageTimelineData, MessageTimelineResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PreviewSmartTagData, PreviewSmartTagErrors, PreviewSmartTagResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesErrors, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutErrors, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelErrors, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDatabaseQueryData, SaveDatabaseQueryErrors, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SearchContactsData, SearchContactsErrors, SearchContactsResponses, SetChannelLabelData, SetChannelLabelErrors, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureErrors, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupErrors, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, ShareCrmPipelineData, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, StreamEventsData, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, SubmitFormResponseData, SubmitFormResponseErrors, SubmitFormResponseResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, TranscribeDictationData, TranscribeDictationErrors, TranscribeDictationResponses, TrashCrmPipelineData, TrashCrmPipelineResponses, UndoDatabaseChangeData, UndoDatabaseChangeErrors, UndoDatabaseChangeResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateDatabasePermissionsData, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponses, UpdateFormData, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsErrors, UpdateFormPermissionsResponses, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeErrors, UpdateInitiativeResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';
+import type { AddFavoriteData, AddFavoriteErrors, AddFavoriteResponses, AddParticipantsData, AddParticipantsErrors, AddParticipantsResponses, AddPinHandlerData, AddPinHandlerErrors, AddPinHandlerResponses, ApplyCrmPipelineOpsData, ApplyCrmPipelineOpsResponses, ApplyDatabaseOpsData, ApplyDatabaseOpsErrors, ApplyDatabaseOpsResponses, ApproveHarnessPairingData, ApproveHarnessPairingErrors, ApproveHarnessPairingResponses, BulkWakeupSyncServiceDocumentsData, BulkWakeupSyncServiceDocumentsErrors, BulkWakeupSyncServiceDocumentsResponses, CallWebhookData, CallWebhookErrors, CallWebhookResponses, CancelSlackImportData, CancelSlackImportErrors, CancelSlackImportResponses, CheckActiveCallData, CheckActiveCallErrors, CheckActiveCallResponses, ClaimHarnessPairingData, ClaimHarnessPairingErrors, ClaimHarnessPairingResponses, CollaborateFormData, CollaborateFormErrors, CollaborateFormResponses, CompleteSlackImportUploadsData, CompleteSlackImportUploadsErrors, CompleteSlackImportUploadsResponses, ConvertDatabaseColumnData, ConvertDatabaseColumnErrors, ConvertDatabaseColumnResponses, CopyDocumentData, CopyDocumentErrors, CopyDocumentResponses, CreateAgentData, CreateAgentErrors, CreateAgentResponses, CreateAnchorData, CreateAnchorErrors, CreateAnchorResponses, CreateChannelData, CreateChannelErrors, CreateChannelLabelData, CreateChannelLabelErrors, CreateChannelLabelResponses, CreateChannelResponses, CreateChannelScopedBotData, CreateChannelScopedBotErrors, CreateChannelScopedBotResponses, CreateCollabSurfaceTokenData, CreateCollabSurfaceTokenErrors, CreateCollabSurfaceTokenResponses, CreateCrmCompanyData, CreateCrmCompanyErrors, CreateCrmCompanyResponses, CreateCrmContactData, CreateCrmContactErrors, CreateCrmContactResponses, CreateCrmPipelineData, CreateCrmPipelineResponses, CreateDatabaseData, CreateDatabaseErrors, CreateDatabaseResponses, CreateDocumentData, CreateDocumentErrors, CreateDocumentResponses, CreateEntityMentionData, CreateEntityMentionErrors, CreateEntityMentionResponses, CreateFormData, CreateFormErrors, CreateFormResponses, CreateHarnessPairingData, CreateHarnessPairingErrors, CreateHarnessPairingResponses, CreateInitiativeData, CreateInitiativeErrors, CreateInitiativeResponses, CreateInstructionsHandlerData, CreateInstructionsHandlerErrors, CreateInstructionsHandlerResponses, CreateMarkdownHandlerData, CreateMarkdownHandlerErrors, CreateMarkdownHandlerResponses, CreateProjectHandlerData, CreateProjectHandlerErrors, CreateProjectHandlerResponses, CreateSkillHandlerData, CreateSkillHandlerErrors, CreateSkillHandlerResponses, CreateSlackImportData, CreateSlackImportErrors, CreateSlackImportResponses, CreateSnippetHandlerData, CreateSnippetHandlerErrors, CreateSnippetHandlerResponses, CreateTaskHandlerData, CreateTaskHandlerErrors, CreateTaskHandlerResponses, CreateUserApiKeyData, CreateUserApiKeyErrors, CreateUserApiKeyResponses, CreateViewHandlerData, CreateViewHandlerErrors, CreateViewHandlerResponses, CreateWebhookData, CreateWebhookErrors, CreateWebhookResponses, DeleteAnchorData, DeleteAnchorErrors, DeleteAnchorResponses, DeleteCallRecordData, DeleteCallRecordErrors, DeleteCallRecordResponses, DeleteChannelData, DeleteChannelErrors, DeleteChannelLabelData, DeleteChannelLabelErrors, DeleteChannelLabelResponses, DeleteChannelResponses, DeleteCollabSurfaceData, DeleteCollabSurfaceErrors, DeleteCollabSurfaceResponses, DeleteDocumentData, DeleteDocumentErrors, DeleteDocumentResponses, DeleteEntityMentionData, DeleteEntityMentionErrors, DeleteEntityMentionResponses, DeleteHarnessData, DeleteHarnessErrors, DeleteHarnessResponses, DeleteHistoryHandlerData, DeleteHistoryHandlerErrors, DeleteHistoryHandlerResponses, DeleteInitiativeData, DeleteInitiativeErrors, DeleteInitiativeResponses, DeleteProjectHandlerData, DeleteProjectHandlerErrors, DeleteProjectHandlerResponses, DeleteSelfHarnessData, DeleteSelfHarnessErrors, DeleteSelfHarnessResponses, DeleteUserApiKeyData, DeleteUserApiKeyErrors, DeleteUserApiKeyResponses, DeleteUserDocumentViewLocationData, DeleteUserDocumentViewLocationErrors, DeleteUserDocumentViewLocationResponses, DeleteViewHandlerData, DeleteViewHandlerErrors, DeleteViewHandlerResponses, DeleteWebhookData, DeleteWebhookErrors, DeleteWebhookResponses, EditAnchorData, EditAnchorErrors, EditAnchorResponses, EditCallRecordData, EditCallRecordErrors, EditCallRecordResponses, EditCallTranscriptData, EditCallTranscriptErrors, EditCallTranscriptResponses, EditDocumentData, EditDocumentErrors, EditDocumentResponses, EditMyFormResponseData, EditMyFormResponseErrors, EditMyFormResponseResponses, EditProjectV2Data, EditProjectV2Errors, EditProjectV2Responses, EditThreadV2Data, EditThreadV2Errors, EditThreadV2Responses, EnsureCollabSurfaceData, EnsureCollabSurfaceErrors, EnsureCollabSurfaceResponses, EnsureStarterHandlerData, EnsureStarterHandlerErrors, EnsureStarterHandlerResponses, EntityMessageCreateData, EntityMessageCreateResponses, EntityMessageDeleteMessageData, EntityMessageDeleteMessageResponses, EntityMessageDeleteThreadData, EntityMessageDeleteThreadResponses, EntityMessageEditData, EntityMessageEditResponses, EntityMessageGetMessageData, EntityMessageGetMessageResponses, EntityMessageGetThreadData, EntityMessageGetThreadResponses, EntityMessageLegacyData, EntityMessageLegacyResponses, EntityMessagePatchThreadData, EntityMessagePatchThreadResponses, EntityMessageReactData, EntityMessageReactResponses, EntityMessageTypingData, EntityMessageTypingResponses, ExcludeDefaultViewHandlerData, ExcludeDefaultViewHandlerErrors, ExcludeDefaultViewHandlerResponses, ExportDocumentData, ExportDocumentErrors, ExportDocumentResponses, FinalizeSlackImportData, FinalizeSlackImportErrors, FinalizeSlackImportResponses, GetActiveCallsData, GetActiveCallsErrors, GetActiveCallsResponses, GetActivityData, GetActivityErrors, GetActivityResponses, GetAttachmentReferencesData, GetAttachmentReferencesErrors, GetAttachmentReferencesResponses, GetBatchCallRecordPreviewData, GetBatchCallRecordPreviewErrors, GetBatchCallRecordPreviewResponses, GetBatchChannelPreviewData, GetBatchChannelPreviewErrors, GetBatchChannelPreviewResponses, GetBatchPreviewHandlerData, GetBatchPreviewHandlerErrors, GetBatchPreviewHandlerResponses, GetBatchProjectPreviewData, GetBatchProjectPreviewErrors, GetBatchProjectPreviewResponses, GetBotOwnerProfilesData, GetBotOwnerProfilesErrors, GetBotOwnerProfilesResponses, GetCallRecordData, GetCallRecordErrors, GetCallRecordResponses, GetChannelAttachmentsData, GetChannelAttachmentsErrors, GetChannelAttachmentsResponses, GetChannelData, GetChannelErrors, GetChannelJoinLinkData, GetChannelJoinLinkErrors, GetChannelJoinLinkResponses, GetChannelParticipantsData, GetChannelParticipantsErrors, GetChannelParticipantsResponses, GetChannelResponses, GetChannelsData, GetChannelsErrors, GetChannelsResponses, GetCollabSurfaceData, GetCollabSurfaceErrors, GetCollabSurfaceResponses, GetCompanyData, GetCompanyErrors, GetCompanyResponses, GetContactByEmailData, GetContactByEmailErrors, GetContactByEmailResponses, GetContactData, GetContactErrors, GetContactResponses, GetCrmPipelineData, GetCrmPipelineResponses, GetCrmPipelineRowsData, GetCrmPipelineRowsResponses, GetCrmPipelineTableData, GetCrmPipelineTableResponses, GetCrmTeamSettingsData, GetCrmTeamSettingsErrors, GetCrmTeamSettingsResponses, GetDatabaseData, GetDatabaseErrors, GetDatabasePermissionsData, GetDatabasePermissionsErrors, GetDatabasePermissionsResponses, GetDatabaseQueryData, GetDatabaseQueryErrors, GetDatabaseQueryResponses, GetDatabaseResponses, GetDatabaseRowHistoryData, GetDatabaseRowHistoryErrors, GetDatabaseRowHistoryResponses, GetDatabaseTableChangesData, GetDatabaseTableChangesErrors, GetDatabaseTableChangesResponses, GetDatabaseViewPositionsData, GetDatabaseViewPositionsErrors, GetDatabaseViewPositionsResponses, GetDocumentAnchorsData, GetDocumentAnchorsErrors, GetDocumentAnchorsResponses, GetDocumentBranchNameData, GetDocumentBranchNameErrors, GetDocumentBranchNameResponses, GetDocumentByTeamSlugData, GetDocumentByTeamSlugErrors, GetDocumentByTeamSlugResponses, GetDocumentData, GetDocumentErrors, GetDocumentGithubPullRequestsData, GetDocumentGithubPullRequestsErrors, GetDocumentGithubPullRequestsResponses, GetDocumentListHandlerData, GetDocumentListHandlerErrors, GetDocumentListHandlerResponses, GetDocumentLocationV3Data, GetDocumentLocationV3Errors, GetDocumentLocationV3Responses, GetDocumentPermissionsTokenData, GetDocumentPermissionsTokenErrors, GetDocumentPermissionsTokenResponses, GetDocumentPermissionsV2Data, GetDocumentPermissionsV2Errors, GetDocumentPermissionsV2Responses, GetDocumentProcessingResultData, GetDocumentProcessingResultErrors, GetDocumentProcessingResultResponses, GetDocumentResponses, GetDocumentShortIdData, GetDocumentShortIdErrors, GetDocumentShortIdResponses, GetDocumentTeamShareData, GetDocumentTeamShareErrors, GetDocumentTeamShareResponses, GetDocumentVersionData, GetDocumentVersionErrors, GetDocumentVersionResponses, GetDocumentViewsHandlerData, GetDocumentViewsHandlerErrors, GetDocumentViewsHandlerResponses, GetEmailFollowupData, GetEmailFollowupErrors, GetEmailFollowupResponses, GetEntityPermissionData, GetEntityPermissionErrors, GetEntityPermissionResponses, GetForeignEntityBySourceData, GetForeignEntityBySourceErrors, GetForeignEntityBySourceResponses, GetForeignEntityData, GetForeignEntityErrors, GetForeignEntityResponses, GetFormData, GetFormErrors, GetFormPermissionsData, GetFormPermissionsErrors, GetFormPermissionsResponses, GetFormResponses, GetFormResponseSummaryData, GetFormResponseSummaryErrors, GetFormResponseSummaryResponses, GetFormTallyData, GetFormTallyErrors, GetFormTallyResponses, GetGithubPullRequestChangesData, GetGithubPullRequestChangesErrors, GetGithubPullRequestChangesPatchData, GetGithubPullRequestChangesPatchErrors, GetGithubPullRequestChangesPatchResponses, GetGithubPullRequestChangesResponses, GetGithubPullRequestData, GetGithubPullRequestErrors, GetGithubPullRequestFacetsData, GetGithubPullRequestFacetsErrors, GetGithubPullRequestFacetsResponses, GetGithubPullRequestResponses, GetGithubPullRequestTasksData, GetGithubPullRequestTasksErrors, GetGithubPullRequestTasksResponses, GetHarnessPairingData, GetHarnessPairingErrors, GetHarnessPairingResponses, GetHistoryHandlerData, GetHistoryHandlerErrors, GetHistoryHandlerResponses, GetInitiativeData, GetInitiativeErrors, GetInitiativeResponses, GetInstructionsHandlerData, GetInstructionsHandlerErrors, GetInstructionsHandlerResponses, GetItemsSoupData, GetItemsSoupErrors, GetItemsSoupResponses, GetLocationHandlerData, GetLocationHandlerErrors, GetLocationHandlerResponses, GetMyFormResponseData, GetMyFormResponseErrors, GetMyFormResponseResponses, GetOrCreateCallData, GetOrCreateCallErrors, GetOrCreateCallResponses, GetOrCreateDmData, GetOrCreateDmErrors, GetOrCreateDmResponses, GetOrCreatePrivateData, GetOrCreatePrivateErrors, GetOrCreatePrivateResponses, GetPendingProjectsHandlerData, GetPendingProjectsHandlerErrors, GetPendingProjectsHandlerResponses, GetPinsHandlerData, GetPinsHandlerErrors, GetPinsHandlerResponses, GetProjectContentHandlerData, GetProjectContentHandlerErrors, GetProjectContentHandlerResponses, GetProjectHandlerData, GetProjectHandlerErrors, GetProjectHandlerResponses, GetProjectPermissionsV2Data, GetProjectPermissionsV2Errors, GetProjectPermissionsV2Responses, GetProjectsHandlerData, GetProjectsHandlerErrors, GetProjectsHandlerResponses, GetProjectUserAccessLevelData, GetProjectUserAccessLevelErrors, GetProjectUserAccessLevelResponses, GetRingStatusData, GetRingStatusErrors, GetRingStatusResponses, GetSelfBotData, GetSelfBotErrors, GetSelfBotResponses, GetSelfHarnessData, GetSelfHarnessErrors, GetSelfHarnessResponses, GetSlackImportData, GetSlackImportErrors, GetSlackImportResponses, GetSystemSkillsHandlerData, GetSystemSkillsHandlerErrors, GetSystemSkillsHandlerResponses, GetUserDocumentsHandlerData, GetUserDocumentsHandlerErrors, GetUserDocumentsHandlerResponses, GetUserDocumentViewLocationData, GetUserDocumentViewLocationErrors, GetUserDocumentViewLocationResponses, GetViewsHandlerData, GetViewsHandlerErrors, GetViewsHandlerResponses, GetWebhookData, GetWebhookErrors, GetWebhookResponses, HandlerData, HandlerErrors, HandlerResponses, HealthHandlerData, HealthHandlerResponses, ImportDatabaseTableData, ImportDatabaseTableErrors, ImportDatabaseTableResponses, InferDatabaseColumnTypeData, InferDatabaseColumnTypeErrors, InferDatabaseColumnTypeResponses, IngestTranscriptData, IngestTranscriptErrors, IngestTranscriptResponses, InitializeUserDocumentsData, InitializeUserDocumentsErrors, InitializeUserDocumentsResponses, InstallSyncData, InstallSyncErrors, JobProcessingResultHandlerData, JobProcessingResultHandlerErrors, JobProcessingResultHandlerResponses, JoinChannelByCodeData, JoinChannelByCodeErrors, JoinChannelByCodeResponses, JoinChannelData, JoinChannelErrors, JoinChannelResponses, LeaveChannelData, LeaveChannelErrors, LeaveChannelResponses, LeaveOrEndCallData, LeaveOrEndCallErrors, LeaveOrEndCallResponses, ListAccessibleFormsData, ListAccessibleFormsErrors, ListAccessibleFormsResponses, ListAgentsData, ListAgentsErrors, ListAgentsResponses, ListBotChannelsData, ListBotChannelsErrors, ListBotChannelsResponses, ListChannelLabelsData, ListChannelLabelsErrors, ListChannelLabelsResponses, ListCompanyContactsData, ListCompanyContactsErrors, ListCompanyContactsResponses, ListCrmPipelinesData, ListCrmPipelinesResponses, ListDatabaseColumnCastsData, ListDatabaseColumnCastsErrors, ListDatabaseColumnCastsResponses, ListDatabasesData, ListDatabasesErrors, ListDatabasesResponses, ListEmailRemindersData, ListEmailRemindersErrors, ListEmailRemindersResponses, ListFavoritesData, ListFavoritesErrors, ListFavoritesResponses, ListFormsData, ListFormsErrors, ListFormsResponses, ListHarnessAgentsData, ListHarnessAgentsErrors, ListHarnessAgentsResponses, ListHarnessesData, ListHarnessesErrors, ListHarnessesResponses, ListHarnessSessionsData, ListHarnessSessionsErrors, ListHarnessSessionsResponses, ListInitiativesData, ListInitiativesErrors, ListInitiativesResponses, ListOccurrencesData, ListOccurrencesErrors, ListOccurrencesResponses, ListSlackImportsData, ListSlackImportsResponses, ListTeamCalendarData, ListTeamCalendarResponses, ListTeamOutOfOfficeData, ListTeamOutOfOfficeErrors, ListTeamOutOfOfficeResponses, ListUserApiKeysData, ListUserApiKeysErrors, ListUserApiKeysResponses, ListWebhooksData, ListWebhooksErrors, ListWebhooksResponses, MeetingCancelData, MeetingCancelErrors, MeetingCancelPreparationData, MeetingCancelPreparationErrors, MeetingCancelPreparationResponses, MeetingCancelResponses, MeetingCreateData, MeetingCreateErrors, MeetingCreateResponses, MeetingGuestJoinData, MeetingGuestJoinErrors, MeetingGuestJoinResponses, MeetingGuestParticipantsData, MeetingGuestParticipantsErrors, MeetingGuestParticipantsResponses, MeetingInviteData, MeetingInviteErrors, MeetingInvitePermissionsData, MeetingInvitePermissionsErrors, MeetingInvitePermissionsResponses, MeetingInviteResponses, MeetingInviteUsersData, MeetingInviteUsersErrors, MeetingInviteUsersResponses, MeetingJoinData, MeetingJoinErrors, MeetingJoinResponses, MeetingLeaveData, MeetingLeaveErrors, MeetingLeaveResponses, MeetingListActiveData, MeetingListActiveErrors, MeetingListActiveResponses, MeetingListData, MeetingListErrors, MeetingListResponses, MeetingLookupData, MeetingLookupErrors, MeetingLookupResponses, MeetingParticipantsData, MeetingParticipantsErrors, MeetingParticipantsResponses, MeetingPrepareData, MeetingPrepareErrors, MeetingPrepareResponses, MeetingShareData, MeetingShareErrors, MeetingShareResponses, MeetingUpdateData, MeetingUpdateErrors, MeetingUpdateResponses, MentionPreviewsData, MentionPreviewsErrors, MentionPreviewsResponses, MessageTimelineData, MessageTimelineEntriesData, MessageTimelineEntriesResponses, MessageTimelineResponses, PatchChannelData, PatchChannelErrors, PatchChannelResponses, PatchViewHandlerData, PatchViewHandlerErrors, PatchViewHandlerResponses, PatchWebhookData, PatchWebhookErrors, PatchWebhookResponses, PermanentlyDeleteDocumentData, PermanentlyDeleteDocumentErrors, PermanentlyDeleteDocumentResponses, PermanentlyDeleteProjectData, PermanentlyDeleteProjectErrors, PermanentlyDeleteProjectResponses, PostActivityData, PostActivityErrors, PostActivityResponses, PostChannelBotWebhookData, PostChannelBotWebhookErrors, PostChannelBotWebhookResponses, PostItemsSoupAstData, PostItemsSoupAstErrors, PostItemsSoupAstGroupedData, PostItemsSoupAstGroupedErrors, PostItemsSoupAstGroupedResponses, PostItemsSoupAstResponses, PostItemsSoupData, PostItemsSoupErrors, PostItemsSoupResponses, PresaveDocumentHandlerData, PresaveDocumentHandlerErrors, PresaveDocumentHandlerResponses, PreviewSmartTagData, PreviewSmartTagErrors, PreviewSmartTagResponses, PutCrmTeamSettingsData, PutCrmTeamSettingsErrors, PutCrmTeamSettingsResponses, PutCrmTeamStagesData, PutCrmTeamStagesErrors, PutCrmTeamStagesResponses, PutFormLayoutData, PutFormLayoutErrors, PutFormLayoutResponses, QueryCrmPipelineRowsData, QueryCrmPipelineRowsResponses, RecentlyDeletedData, RecentlyDeletedErrors, RecentlyDeletedResponses, RegisterSlackImportUploadsData, RegisterSlackImportUploadsErrors, RegisterSlackImportUploadsResponses, RemoveBotFromChannelByBotData, RemoveBotFromChannelByBotErrors, RemoveBotFromChannelByBotResponses, RemoveFavoriteByEntityData, RemoveFavoriteByEntityErrors, RemoveFavoriteByEntityResponses, RemoveParticipantsData, RemoveParticipantsErrors, RemoveParticipantsResponses, RemovePinHandlerData, RemovePinHandlerErrors, RemovePinHandlerResponses, RenameChannelLabelData, RenameChannelLabelErrors, RenameChannelLabelResponses, RenameCrmPipelineData, RenameCrmPipelineResponses, ReorderFavoritesData, ReorderFavoritesErrors, ReorderFavoritesResponses, ReorderPinsHandlerData, ReorderPinsHandlerErrors, ReorderPinsHandlerResponses, ResetCrmTeamStagesData, ResetCrmTeamStagesErrors, ResetCrmTeamStagesResponses, RevertDeleteDocumentData, RevertDeleteDocumentErrors, RevertDeleteDocumentResponses, RevertDeleteProjectData, RevertDeleteProjectErrors, RevertDeleteProjectResponses, SaveDatabaseQueryData, SaveDatabaseQueryErrors, SaveDatabaseQueryResponses, SaveDocumentHandlerData, SaveDocumentHandlerErrors, SaveDocumentHandlerResponses, SearchContactsData, SearchContactsErrors, SearchContactsResponses, SetChannelLabelData, SetChannelLabelErrors, SetChannelLabelResponses, SetChannelPictureData, SetChannelPictureErrors, SetChannelPictureResponses, SetCompanyHiddenData, SetCompanyHiddenErrors, SetCompanyHiddenResponses, SetContactHiddenData, SetContactHiddenErrors, SetContactHiddenResponses, SetCrmCompanyNameData, SetCrmCompanyNameErrors, SetCrmCompanyNameResponses, SetCrmContactNameData, SetCrmContactNameErrors, SetCrmContactNameResponses, SetDocumentTeamShareData, SetDocumentTeamShareErrors, SetDocumentTeamShareResponses, SetEmailFollowupData, SetEmailFollowupErrors, SetEmailFollowupResponses, SetEmailSyncData, SetEmailSyncErrors, SetEmailSyncResponses, ShareCrmPipelineData, ShareCrmPipelineResponses, ShareDatabaseAwarenessData, ShareDatabaseAwarenessErrors, ShareDatabaseAwarenessResponses, SimpleSaveData, SimpleSaveErrors, SimpleSaveResponses, StreamEventsData, StreamEventsErrors, StreamEventsResponse, StreamEventsResponses, SubmitFormResponseData, SubmitFormResponseErrors, SubmitFormResponseResponses, ToggleShareWithTeamData, ToggleShareWithTeamErrors, ToggleShareWithTeamResponses, TranscribeDictationData, TranscribeDictationErrors, TranscribeDictationResponses, TrashCrmPipelineData, TrashCrmPipelineResponses, UndoDatabaseChangeData, UndoDatabaseChangeErrors, UndoDatabaseChangeResponses, UpdateAgentData, UpdateAgentErrors, UpdateAgentResponses, UpdateDatabasePermissionsData, UpdateDatabasePermissionsErrors, UpdateDatabasePermissionsResponses, UpdateFormData, UpdateFormErrors, UpdateFormPermissionsData, UpdateFormPermissionsErrors, UpdateFormPermissionsResponses, UpdateFormResponses, UpdateInitiativeData, UpdateInitiativeErrors, UpdateInitiativeResponses, UploadExtractFolderHandlerData, UploadExtractFolderHandlerErrors, UploadExtractFolderHandlerResponses, UploadFolderHandlerData, UploadFolderHandlerErrors, UploadFolderHandlerResponses, UpsertHistoryHandlerData, UpsertHistoryHandlerErrors, UpsertHistoryHandlerResponses, UpsertUserDocumentViewLocationData, UpsertUserDocumentViewLocationErrors, UpsertUserDocumentViewLocationResponses, ValidateDocumentPermissionsTokenData, ValidateDocumentPermissionsTokenErrors, ValidateDocumentPermissionsTokenResponses, ValidateWebhookData, ValidateWebhookErrors, ValidateWebhookResponses } from './types.gen';
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
/**
@@ -2452,6 +2452,13 @@ export class Sdk extends HeyApiClient {
});
}
+ /**
+ * Read a bounded window of messages and the parent's activity, ordered by the server.
+ */
+ public messageTimelineEntries<ThrowOnError extends boolean = false>(options: Options<MessageTimelineEntriesData, ThrowOnError>): RequestResult<MessageTimelineEntriesResponses, unknown, ThrowOnError> {
+ return (options.client ?? this.client).get<MessageTimelineEntriesResponses, unknown, ThrowOnError>({ url: '/messages/{parent_type}/{parent_id}/timeline', ...options });
+ }
+
/**
* Broadcast typing within an authorized discussion.
*/
diff --git a/packages/sdk/generated/storage/types.gen.ts b/packages/sdk/generated/storage/types.gen.ts
index 3837e93f55..ac9409d482 100644
--- a/packages/sdk/generated/storage/types.gen.ts
+++ b/packages/sdk/generated/storage/types.gen.ts
@@ -2593,6 +2593,20 @@ export type ChannelParticipantRemovedMetadata = {
removed_user_ids: Array<MacroUserIdStr>;
};
+/**
+ * Metadata for a channel picture update, including removals.
+ */
+export type ChannelPictureChangedMetadata = {
+ /**
+ * User who changed the picture.
+ */
+ actor: MacroUserIdStr;
+ /**
+ * Channel whose picture changed.
+ */
+ channel_id: string;
+};
+
/**
* Preview entry for a single channel id.
*/
@@ -2671,6 +2685,12 @@ export type ChannelThreadFilters = {
* Events that can be published to [`MacroChannelsTopic`].
*/
export type ChannelTopicEvent = {
+ event_type: 'channel.picture_changed';
+ /**
+ * A channel's profile picture changed.
+ */
+ metadata: ChannelPictureChangedMetadata;
+} | {
event_type: 'channel.created';
/**
* A channel was created.
@@ -8714,11 +8734,11 @@ export type MessageChange = {
*/
export type MessageCursor = {
/**
- * Last root creation time.
+ * Last message creation time or activity occurrence time.
*/
created_at: string;
/**
- * Last root UUID, used to break timestamp ties.
+ * Last entry UUID, used to break timestamp ties across both sources.
*/
id: string;
};
@@ -9050,6 +9070,36 @@ export type MessageThreadPreview = {
reply_count: number;
};
+/**
+ * One chronological entry in a parent's timeline.
+ */
+export type MessageTimelineEntry = {
+ /**
+ * The message and thread state.
+ */
+ message: MessageListItem;
+ type: 'message';
+} | {
+ /**
+ * The recorded activity.
+ */
+ activity: TimelineActivity;
+ type: 'activity';
+};
+
+/**
+ * A bounded, newest-first window of a parent's messages and activity, ordered
+ * by the server on one `(timestamp, id)` keyset.
+ */
+export type MessageTimelinePage = {
+ /**
+ * Messages and activity, newest first.
+ */
+ entries: Array<MessageTimelineEntry>;
+ next_cursor?: null | MessageCursor;
+ previous_cursor?: null | MessageCursor;
+};
+
/**
* Root selection shared by channel timelines and document discussions.
*/
@@ -13355,6 +13405,32 @@ export type ThreadState = {
user_id: string;
};
+/**
+ * A displayable fact returned together with a message page.
+ */
+export type TimelineActivity = {
+ /**
+ * Durable action tag. Unknown tags remain representable during rollouts.
+ */
+ action: string;
+ /**
+ * Principal who performed the action.
+ */
+ actor_id: string;
+ /**
+ * Stable activity identity, independent of message ids.
+ */
+ id: string;
+ /**
+ * Immutable chronological position.
+ */
+ occurred_at: string;
+ /**
+ * The action's stored payload.
+ */
+ payload?: unknown;
+};
+
/**
* A column a table's changes since some version touched.
*/
@@ -20320,6 +20396,27 @@ export type EntityMessagePatchThreadResponses = {
export type EntityMessagePatchThreadResponse = EntityMessagePatchThreadResponses[keyof EntityMessagePatchThreadResponses];
+export type MessageTimelineEntriesData = {
+ body?: never;
+ path: {
+ parent_type: string;
+ parent_id: string;
+ };
+ query?: {
+ /**
+ * Serialized MessageTimelineQuery; absent selects the latest roots.
+ */
+ selection?: string | null;
+ };
+ url: '/messages/{parent_type}/{parent_id}/timeline';
+};
+
+export type MessageTimelineEntriesResponses = {
+ 200: MessageTimelinePage;
+};
+
+export type MessageTimelineEntriesResponse = MessageTimelineEntriesResponses[keyof MessageTimelineEntriesResponses];
+
export type EntityMessageTypingData = {
body: TypingInput;
path: {
diff --git a/packages/sdk/specs/storage.json b/packages/sdk/specs/storage.json
index adfa74dc69..ae00aa50a2 100644
--- a/packages/sdk/specs/storage.json
+++ b/packages/sdk/specs/storage.json
@@ -14516,6 +14516,52 @@
}
}
},
+ "/messages/{parent_type}/{parent_id}/timeline": {
+ "get": {
+ "tags": ["messages::inbound::axum_router"],
+ "summary": "Read a bounded window of messages and the parent's activity, ordered by the server.",
+ "operationId": "message_timeline_entries",
+ "parameters": [
+ {
+ "name": "parent_type",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "parent_id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "selection",
+ "in": "query",
+ "description": "Serialized MessageTimelineQuery; absent selects the latest roots.",
+ "required": false,
+ "schema": {
+ "type": ["string", "null"]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MessageTimelinePage"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/messages/{parent_type}/{parent_id}/typing": {
"post": {
"tags": ["messages::inbound::axum_router"],
@@ -21059,6 +21105,22 @@
}
}
},
+ "ChannelPictureChangedMetadata": {
+ "type": "object",
+ "description": "Metadata for a channel picture update, including removals.",
+ "required": ["channel_id", "actor"],
+ "properties": {
+ "actor": {
+ "$ref": "#/components/schemas/MacroUserIdStr",
+ "description": "User who changed the picture."
+ },
+ "channel_id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Channel whose picture changed."
+ }
+ }
+ },
"ChannelPreview": {
"oneOf": [
{
@@ -21199,6 +21261,21 @@
},
"ChannelTopicEvent": {
"oneOf": [
+ {
+ "type": "object",
+ "description": "A channel's profile picture changed.",
+ "required": ["metadata", "event_type"],
+ "properties": {
+ "event_type": {
+ "type": "string",
+ "enum": ["channel.picture_changed"]
+ },
+ "metadata": {
+ "$ref": "#/components/schemas/ChannelPictureChangedMetadata",
+ "description": "A channel's profile picture changed."
+ }
+ }
+ },
{
"type": "object",
"description": "A channel was created.",
@@ -30826,12 +30903,12 @@
"created_at": {
"type": "string",
"format": "date-time",
- "description": "Last root creation time."
+ "description": "Last message creation time or activity occurrence time."
},
"id": {
"type": "string",
"format": "uuid",
- "description": "Last root UUID, used to break timestamp ties."
+ "description": "Last entry UUID, used to break timestamp ties across both sources."
}
}
},
@@ -31321,6 +31398,77 @@
}
}
},
+ "MessageTimelineEntry": {
+ "oneOf": [
+ {
+ "type": "object",
+ "description": "A root message with its bounded thread preview.",
+ "required": ["message", "type"],
+ "properties": {
+ "message": {
+ "$ref": "#/components/schemas/MessageListItem",
+ "description": "The message and thread state."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["message"]
+ }
+ }
+ },
+ {
+ "type": "object",
+ "description": "A recorded fact about the parent, such as a rename or a finished call.",
+ "required": ["activity", "type"],
+ "properties": {
+ "activity": {
+ "$ref": "#/components/schemas/TimelineActivity",
+ "description": "The recorded activity."
+ },
+ "type": {
+ "type": "string",
+ "enum": ["activity"]
+ }
+ }
+ }
+ ],
+ "description": "One chronological entry in a parent's timeline."
+ },
+ "MessageTimelinePage": {
+ "type": "object",
+ "description": "A bounded, newest-first window of a parent's messages and activity, ordered\nby the server on one `(timestamp, id)` keyset.",
+ "required": ["entries"],
+ "properties": {
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/MessageTimelineEntry"
+ },
+ "description": "Messages and activity, newest first."
+ },
+ "next_cursor": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/MessageCursor",
+ "description": "Continue to older entries."
+ }
+ ]
+ },
+ "previous_cursor": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/MessageCursor",
+ "description": "Continue to newer entries."
+ }
+ ]
+ }
+ }
+ },
"MessageTimelineQuery": {
"type": "object",
"description": "Root selection shared by channel timelines and document discussions.",
@@ -38291,6 +38439,34 @@
}
}
},
+ "TimelineActivity": {
+ "type": "object",
+ "description": "A displayable fact returned together with a message page.",
+ "required": ["id", "actor_id", "occurred_at", "action"],
+ "properties": {
+ "action": {
+ "type": "string",
+ "description": "Durable action tag. Unknown tags remain representable during rollouts."
+ },
+ "actor_id": {
+ "type": "string",
+ "description": "Principal who performed the action."
+ },
+ "id": {
+ "type": "string",
+ "format": "uuid",
+ "description": "Stable activity identity, independent of message ids."
+ },
+ "occurred_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Immutable chronological position."
+ },
+ "payload": {
+ "description": "The action's stored payload."
+ }
+ }
+ },
"TouchedColumn": {
"type": "object",
"description": "A column a table's changes since some version touched.",
diff --git a/packages/sdk/src/coverage/skipped.ts b/packages/sdk/src/coverage/skipped.ts
index a8e5e424de..92ebd2c068 100644
--- a/packages/sdk/src/coverage/skipped.ts
+++ b/packages/sdk/src/coverage/skipped.ts
@@ -465,6 +465,8 @@ export const storageBacklog = [
'meetingLookup',
'meetingShare',
'meetingUpdate',
+ // Mixed message and activity timelines; Channel.messages() reads messages only.
+ 'messageTimelineEntries',
'postActivity',
'presaveDocumentHandler',
'saveDocumentHandler',
diff --git a/packages/sdk/src/events/hydrate/channel.ts b/packages/sdk/src/events/hydrate/channel.ts
index 0c8905c2ab..747563f2f3 100644
--- a/packages/sdk/src/events/hydrate/channel.ts
+++ b/packages/sdk/src/events/hydrate/channel.ts
@@ -48,6 +48,12 @@ export function hydrateChannelEvent(client: MacroClient, event: ChannelEvent) {
channel: Channel.byId(client, metadata.channel_id),
actor: userFromPrincipal(client, metadata.actor),
}))
+ .with({ event_type: 'channel.picture_changed' }, ({ metadata }) => ({
+ event_type: 'channel.picture_changed' as const,
+ metadata,
+ channel: Channel.byId(client, metadata.channel_id),
+ actor: userFromPrincipal(client, metadata.actor),
+ }))
.with({ event_type: 'channel.participant_added' }, ({ metadata }) => ({
event_type: 'channel.participant_added' as const,
metadata,
diff --git a/services/document_storage_service/src/api/swagger.rs b/services/document_storage_service/src/api/swagger.rs
index cdccdd7642..c51dc72c13 100644
--- a/services/document_storage_service/src/api/swagger.rs
+++ b/services/document_storage_service/src/api/swagger.rs
@@ -292,6 +292,7 @@ use utoipa::OpenApi;
// messages (channels and documents)
messages::inbound::axum_router::timeline,
+ messages::inbound::axum_router::timeline_entries,
messages::inbound::axum_router::create,
messages::inbound::axum_router::get_message,
messages::inbound::axum_router::edit,
@@ -798,6 +799,8 @@ use utoipa::OpenApi;
messages::domain::ports::MessageDirection,
messages::domain::ports::MessageTimelineQuery,
messages::domain::ports::MessagePage,
+ messages::domain::ports::MessageTimelinePage,
+ messages::domain::ports::MessageTimelineEntry,
messages::domain::ports::MessagePatch,
messages::domain::ports::AttachmentChange,
messages::domain::ports::MessageEvent,
diff --git a/services/document_storage_service/src/server.rs b/services/document_storage_service/src/server.rs
index 7754a16229..6ebca4e57a 100644
--- a/services/document_storage_service/src/server.rs
+++ b/services/document_storage_service/src/server.rs
@@ -968,6 +968,24 @@ pub async fn run() -> anyhow::Result<()> {
}
});
+ let (timeline_publisher, timeline_delivery) = crate::service::activity::TimelinePublisher::new(
+ conn_gateway_client.clone(),
+ messages::outbound::connection_gateway::ConnectionGatewayMessages(Arc::new(
+ conn_gateway_client.clone(),
+ )),
+ messages::outbound::entity_access_audience::EntityAccessMessageAudience(
+ (*entity_access_service).clone(),
+ ),
+ );
+ consumer_tracker.spawn({
+ let cancellation_token = consumer_cancellation_token.clone();
+ async move {
+ tokio::select! {
+ _ = cancellation_token.cancelled() => {},
+ _ = timeline_delivery => {},
+ }
+ }
+ });
let activity_consumer_brokers = config.kafka_brokers.as_ref().to_string();
let editing_activity = Arc::new(
documents_hex::outbound::editing_activity::RedisEditingActivityStore::new(
@@ -997,7 +1015,7 @@ pub async fn run() -> anyhow::Result<()> {
crate::service::activity::ingest(event, editing_activity.as_ref()).await
}
},
- activity_realtime,
+ (activity_realtime, timeline_publisher),
);
loop {
if cancellation_token.is_cancelled() {
@@ -1209,6 +1227,9 @@ pub async fn run() -> anyhow::Result<()> {
),
),
)
+ .with_activity(activity::outbound::pg_activity_repo::PgActivityRepo::new(
+ db.clone(),
+ ))
.with_group_recipients(channels::domain::group_mentions::ChannelGroupRecipients(
PgChannelsRepo::new(db.clone()),
))
diff --git a/services/document_storage_service/src/service/activity.rs b/services/document_storage_service/src/service/activity.rs
index c2f08c450f..0672864da1 100644
--- a/services/document_storage_service/src/service/activity.rs
+++ b/services/document_storage_service/src/service/activity.rs
@@ -40,6 +40,9 @@ mod source {
}
pub(crate) use source::ActivitySourceEvent;
+mod timeline;
+pub(crate) use timeline::TimelinePublisher;
+
/// Dispatches each event to its owning domain. Document editing sessions use
/// the shared inactivity store; all classification and debounce policy stays
/// in the documents domain.
diff --git a/services/document_storage_service/src/service/activity/timeline.rs b/services/document_storage_service/src/service/activity/timeline.rs
new file mode 100644
index 0000000000..5e4fee97e0
--- /dev/null
+++ b/services/document_storage_service/src/service/activity/timeline.rs
@@ -0,0 +1,131 @@
+//! Best-effort realtime delivery is isolated from durable activity ingestion.
+use activity::domain::timeline::TimelineActivity;
+use connection_gateway_client::client::ConnectionGatewayClient;
+use futures::StreamExt;
+use messages::domain::delivery::{MessageAudienceAccess, MessageRealtime};
+use messages::domain::models::MessageParent;
+use std::collections::{HashMap, HashSet};
+use tokio::sync::mpsc;
+
+const QUEUE_CAPACITY: usize = 256;
+const DELIVERY_CONCURRENCY: usize = 16;
+
+/// One timeline's newly committed activity.
+type TimelineActivities = (MessageParent, Vec<TimelineActivity>);
+
+/// Enqueues committed timeline activity; delivery reaches the same audience as
+/// live messages on that parent.
+pub(crate) struct TimelinePublisher(mpsc::Sender<TimelineActivities>);
+
+impl TimelinePublisher {
+ /// Compose a bounded delivery worker for the service's tracked task lifecycle.
+ pub(crate) fn new<R: MessageRealtime, A: MessageAudienceAccess>(
+ client: ConnectionGatewayClient,
+ realtime: R,
+ access: A,
+ ) -> (Self, impl Future<Output = ()> + Send) {
+ let (sender, receiver) = mpsc::channel(QUEUE_CAPACITY);
+ (Self(sender), deliver(receiver, client, realtime, access))
+ }
+}
+
+impl activity::domain::ports::ActivityRealtimePublisher for TimelinePublisher {
+ async fn publish_recorded(&self, activities: &[activity::Activity]) {
+ // The messages domain decides which timeline, if any, shows a fact.
+ let timeline = activities.iter().filter_map(|event| {
+ let parent = messages::domain::ports::timeline_parent(event)?;
+ Some((parent, vec![TimelineActivity::from(event)]))
+ });
+ for (parent, activities) in by_parent(timeline) {
+ // Storage must keep progressing even when realtime delivery is unavailable.
+ if let Err(error) = self.0.try_send((parent.clone(), activities)) {
+ tracing::warn!(
+ ?error,
+ ?parent,
+ "activity persisted but timeline delivery could not be queued"
+ );
+ }
+ }
+ }
+
+ /// Purges accompany entity deletion; no timeline remains to update.
+ async fn publish_invalidated(&self) {}
+}
+
+fn by_parent(
+ items: impl IntoIterator<Item = TimelineActivities>,
+) -> HashMap<MessageParent, Vec<TimelineActivity>> {
+ let mut parents = HashMap::<_, Vec<_>>::new();
+ for (parent, activities) in items {
+ parents.entry(parent).or_default().extend(activities);
+ }
+ parents
+}
+
+async fn deliver<R: MessageRealtime, A: MessageAudienceAccess>(
+ mut receiver: mpsc::Receiver<TimelineActivities>,
+ client: ConnectionGatewayClient,
+ realtime: R,
+ access: A,
+) {
+ let mut batch = Vec::with_capacity(QUEUE_CAPACITY);
+ while receiver.recv_many(&mut batch, QUEUE_CAPACITY).await > 0 {
+ futures::stream::iter(by_parent(batch.drain(..)))
+ .for_each_concurrent(DELIVERY_CONCURRENCY, |(parent, activities)| {
+ deliver_to_viewers(&client, &realtime, &access, parent, activities)
+ })
+ .await;
+ }
+}
+
+/// Users watching the parent who can still view it.
+async fn viewers<R: MessageRealtime, A: MessageAudienceAccess>(
+ realtime: &R,
+ access: &A,
+ parent: &MessageParent,
+) -> Result<HashSet<String>, rootcause::Report> {
+ let candidates = realtime.subscribers(parent).await?;
+ if candidates.is_empty() {
+ return Ok(candidates);
+ }
+ access.viewers(parent, candidates).await
+}
+
+/// Like `message_update`, only users watching the parent who can still view it
+/// receive the facts. Anyone else reads them with the timeline.
+async fn deliver_to_viewers<R: MessageRealtime, A: MessageAudienceAccess>(
+ client: &ConnectionGatewayClient,
+ realtime: &R,
+ access: &A,
+ parent: MessageParent,
+ activities: Vec<TimelineActivity>,
+) {
+ let viewers = match viewers(realtime, access, &parent).await {
+ Ok(viewers) if viewers.is_empty() => return,
+ Ok(viewers) => viewers,
+ Err(error) => {
+ tracing::warn!(
+ ?error,
+ ?parent,
+ "failed to resolve timeline activity viewers"
+ );
+ return;
+ }
+ };
+ let _ = client
+ .batch_send_message(
+ "timeline_activity".into(),
+ serde_json::json!({ "parent": parent, "activities": activities }),
+ viewers
+ .into_iter()
+ .map(|user| model_entity::EntityType::User.with_entity_string(user))
+ .collect(),
+ )
+ .await
+ .inspect_err(|error| {
+ tracing::warn!(?error, ?parent, "failed to deliver timeline activity");
+ });
+}
+
+#[cfg(test)]
+mod test;
diff --git a/services/document_storage_service/src/service/activity/timeline/test.rs b/services/document_storage_service/src/service/activity/timeline/test.rs
new file mode 100644
index 0000000000..40697bf17f
--- /dev/null
+++ b/services/document_storage_service/src/service/activity/timeline/test.rs
@@ -0,0 +1,129 @@
+use super::*;
+use activity::domain::ports::ActivityRealtimePublisher;
+use activity::{Activity, Actor};
+use channels::domain::activity::{ChannelAction, ChannelActivity};
+use uuid::Uuid;
+
+const CHANNEL: Uuid = Uuid::from_u128(10);
+
+fn picture(channel: Uuid, ordinal: u32) -> Activity {
+ Activity::from_domain(
+ Uuid::from_u128(1),
+ ordinal,
+ Actor::new_from_user("macro|[email protected]".to_owned().try_into().unwrap()),
+ None,
+ ChannelActivity {
+ channel_id: channel.to_string(),
+ action: ChannelAction::PictureChanged,
+ },
+ chrono::Utc::now(),
+ )
+}
+
+#[tokio::test]
+async fn queue_groups_one_channels_facts_and_ignores_non_timeline_activity() {
+ let (sender, mut receiver) = mpsc::channel(QUEUE_CAPACITY);
+ let publisher = TimelinePublisher(sender);
+ let ignored = Activity::common(
+ Uuid::from_u128(2),
+ 0,
+ Actor::new_from_user("macro|[email protected]".to_owned().try_into().unwrap()),
+ None,
+ activity::EntityType::Channel,
+ &CHANNEL.to_string(),
+ activity::CommonAction::Edited,
+ chrono::Utc::now(),
+ );
+ let (first, second) = (picture(CHANNEL, 0), picture(CHANNEL, 1));
+ publisher
+ .publish_recorded(&[first.clone(), second.clone(), ignored])
+ .await;
+ let (parent, activities) = receiver.try_recv().unwrap();
+ assert_eq!(parent, MessageParent::Channel(CHANNEL));
+ assert_eq!(
+ activities.iter().map(|a| a.id).collect::<Vec<_>>(),
+ [first.id, second.id]
+ );
+ assert_eq!(activities[0].action, "picture_changed");
+ assert_eq!(activities[0].actor_id, "macro|[email protected]");
+ assert!(receiver.try_recv().is_err());
+}
+
+#[tokio::test]
+async fn full_or_closed_delivery_queue_never_blocks_persistence() {
+ let (sender, receiver) = mpsc::channel(1);
+ let publisher = TimelinePublisher(sender);
+ publisher.publish_recorded(&[picture(CHANNEL, 0)]).await;
+ tokio::time::timeout(
+ std::time::Duration::from_millis(100),
+ publisher.publish_recorded(&[picture(Uuid::from_u128(11), 0)]),
+ )
+ .await
+ .unwrap();
+ drop(receiver);
+ tokio::time::timeout(
+ std::time::Duration::from_millis(100),
+ publisher.publish_recorded(&[picture(Uuid::from_u128(12), 0)]),
+ )
+ .await
+ .unwrap();
+}
+
+/// Subscribers of one parent, recording that access was consulted.
+struct Watching(HashSet<String>);
+impl MessageRealtime for Watching {
+ async fn subscribers(&self, _: &MessageParent) -> Result<HashSet<String>, rootcause::Report> {
+ Ok(self.0.clone())
+ }
+ async fn send(
+ &self,
+ _: &messages::domain::ports::MessageEvent,
+ _: HashSet<String>,
+ ) -> Result<(), rootcause::Report> {
+ unreachable!("timeline activity has its own payload")
+ }
+}
+
+/// Only `allowed` can still view the parent.
+struct Access {
+ allowed: HashSet<String>,
+ asked: std::sync::Mutex<usize>,
+}
+impl MessageAudienceAccess for Access {
+ async fn viewers(
+ &self,
+ _: &MessageParent,
+ candidates: HashSet<String>,
+ ) -> Result<HashSet<String>, rootcause::Report> {
+ *self.asked.lock().unwrap() += 1;
+ Ok(candidates.intersection(&self.allowed).cloned().collect())
+ }
+}
+
+fn users(ids: &[&str]) -> HashSet<String> {
+ ids.iter().map(|id| (*id).to_owned()).collect()
+}
+
+#[tokio::test]
+async fn live_activity_reaches_watchers_who_can_still_view() {
+ let parent = MessageParent::Channel(CHANNEL);
+ let access = Access {
+ allowed: users(&["member", "team-viewer"]),
+ asked: Default::default(),
+ };
+ let watching = Watching(users(&["member", "team-viewer", "removed"]));
+ assert_eq!(
+ viewers(&watching, &access, &parent).await.unwrap(),
+ users(&["member", "team-viewer"])
+ );
+
+ // Nobody watching: nothing to authorize.
+ let asked = *access.asked.lock().unwrap();
+ assert!(
+ viewers(&Watching(HashSet::new()), &access, &parent)
+ .await
+ .unwrap()
+ .is_empty()
+ );
+ assert_eq!(*access.asked.lock().unwrap(), asked);
+}
diff --git a/services/search_processing_service/src/inbound/kafka_consumer/channel.rs b/services/search_processing_service/src/inbound/kafka_consumer/channel.rs
index 735f974be2..34610dc98e 100644
--- a/services/search_processing_service/src/inbound/kafka_consumer/channel.rs
+++ b/services/search_processing_service/src/inbound/kafka_consumer/channel.rs
@@ -24,6 +24,11 @@ pub(super) struct ChannelEventDescription {
pub(super) fn describe_channel_event(event: &ChannelTopicEvent) -> ChannelEventDescription {
match event {
+ ChannelTopicEvent::PictureChanged(metadata) => ChannelEventDescription {
+ action: ChannelIndexAction::Ignore,
+ channel_id: metadata.channel_id,
+ event_type: "channel.picture_changed",
+ },
ChannelTopicEvent::Created(metadata) => ChannelEventDescription {
action: ChannelIndexAction::Ignore,
channel_id: metadata.channel_id,