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.

fix(channel): channel unread notification behavior (#7189)

Peter Chinmanc022f4a3349b
diff --git a/.sqlx/query-832d565dc038656d47fa311836b1eae36c54b3a6da5aece778e9f069729db618.json b/.sqlx/query-85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28.json
similarity index 89%
rename from .sqlx/query-832d565dc038656d47fa311836b1eae36c54b3a6da5aece778e9f069729db618.json
rename to .sqlx/query-85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28.json
index 7ddef8f479..4027eb1e45 100644
--- a/.sqlx/query-832d565dc038656d47fa311836b1eae36c54b3a6da5aece778e9f069729db618.json
+++ b/.sqlx/query-85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT requested.entity_id AS \"requested_id!\",\n requested.entity_type AS \"requested_type!\",\n matched.notification_id AS \"notification_id!\",\n matched.event_item_id AS \"event_item_id!\",\n matched.event_item_type AS \"event_item_type!\",\n matched.notification_event_type AS \"notification_event_type!\",\n matched.sent AS \"sent!\",\n matched.state AS \"state!: NotificationState\",\n matched.created_at AS \"created_at!\",\n matched.viewed_at,\n matched.notification_metadata,\n matched.sender_id\n FROM unnest($2::text[], $3::text[]) requested(entity_id, entity_type)\n CROSS JOIN LATERAL (\n SELECT un.notification_id, n.event_item_id, n.event_item_type,\n n.notification_event_type, un.sent, un.state,\n un.created_at::timestamptz AS created_at,\n un.seen_at::timestamptz AS viewed_at,\n n.metadata AS notification_metadata, n.sender_id\n FROM (\n SELECT n.id FROM notification n\n WHERE n.event_item_id = requested.entity_id AND n.event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE n.secondary_event_item_id = requested.entity_id AND n.secondary_event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE requested.entity_type = 'channel_message'\n AND COALESCE(n.metadata->>'messageId', n.metadata->>'message_id', '') = requested.entity_id\n ) candidates\n JOIN notification n ON n.id = candidates.id\n JOIN user_notification un ON un.notification_id = n.id\n WHERE un.user_id = $1\n AND un.deleted_at IS NULL\n AND un.state = ANY($4::notification_state[])\n AND (cardinality($5::text[]) = 0 OR n.notification_event_type = ANY($5))\n ORDER BY un.created_at DESC, un.notification_id DESC\n LIMIT $6\n ) matched\n ",
+ "query": "\n SELECT requested.entity_id AS \"requested_id!\",\n requested.entity_type AS \"requested_type!\",\n matched.notification_id AS \"notification_id!\",\n matched.event_item_id AS \"event_item_id!\",\n matched.event_item_type AS \"event_item_type!\",\n matched.notification_event_type AS \"notification_event_type!\",\n matched.sent AS \"sent!\",\n matched.state AS \"state!: NotificationState\",\n matched.created_at AS \"created_at!\",\n matched.viewed_at,\n matched.notification_metadata,\n matched.sender_id\n FROM unnest($2::text[], $3::text[]) requested(entity_id, entity_type)\n CROSS JOIN LATERAL (\n SELECT un.notification_id, n.event_item_id, n.event_item_type,\n n.notification_event_type, un.sent, un.state,\n un.created_at::timestamptz AS created_at,\n un.seen_at::timestamptz AS viewed_at,\n n.metadata AS notification_metadata, n.sender_id\n FROM (\n SELECT n.id FROM notification n\n WHERE n.event_item_id = requested.entity_id AND n.event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE n.secondary_event_item_id = requested.entity_id AND n.secondary_event_item_type = requested.entity_type\n UNION\n SELECT n.id FROM notification n\n WHERE requested.entity_type = 'channel_message'\n AND COALESCE(n.metadata->>'messageId', n.metadata->>'message_id', '') = requested.entity_id\n ) candidates\n JOIN notification n ON n.id = candidates.id\n JOIN user_notification un ON un.notification_id = n.id\n WHERE un.user_id = $1\n AND un.deleted_at IS NULL\n AND un.state = ANY($4::notification_state[])\n AND (cardinality($5::text[]) = 0 OR n.notification_event_type = ANY($5))\n AND (NOT $7::bool OR (\n n.notification_event_type IN ('channel_message_send', 'channel_mention', 'document_mention')\n AND COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') IS NULL\n ))\n ORDER BY un.created_at DESC, un.notification_id DESC\n LIMIT $6\n ) matched\n ",
"describe": {
"columns": [
{
@@ -100,7 +100,8 @@
}
},
"TextArray",
- "Int8"
+ "Int8",
+ "Bool"
]
},
"nullable": [
@@ -118,5 +119,5 @@
true
]
},
- "hash": "832d565dc038656d47fa311836b1eae36c54b3a6da5aece778e9f069729db618"
+ "hash": "85228310ed99c234c9541676f99c0e94d3fbf11473978471a6c52459f6a8ed28"
}
diff --git a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts
index 3d33781e66..d509cff247 100644
--- a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts
+++ b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.test.ts
@@ -223,6 +223,41 @@ describe('sidebar unread presence', () => {
expect(unread('channels')).toBe(false);
});
+ it('badges top-level mentions but not thread mentions or reactions', () => {
+ const { unread, setNotifications } = setup();
+ const mention = (threadId?: string): UnifiedNotification => ({
+ ...message,
+ notification_metadata: {
+ tag: 'channel_mention',
+ content: {
+ channelType: 'directMessage',
+ messageId: 'message',
+ messageContent: 'Hello',
+ threadId,
+ },
+ },
+ });
+ setNotifications([mention('parent')]);
+ expect(unread('channels')).toBe(false);
+ setNotifications([
+ {
+ ...message,
+ notification_metadata: {
+ tag: 'channel_message_reaction',
+ content: {
+ channelType: 'directMessage',
+ messageId: 'message',
+ emoji: '👍',
+ messageContent: 'Hello',
+ },
+ },
+ },
+ ]);
+ expect(unread('channels')).toBe(false);
+ setNotifications([mention()]);
+ expect(unread('channels')).toBe(true);
+ });
+
it('uses unread channel messages, ignoring seen, completed, and other entities', () => {
const { unread, setNotifications } = setup();
setNotifications([message]);
diff --git a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts
index b63eee203e..78c75a8177 100644
--- a/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts
+++ b/apps/web/src/components/app/sidebar-next/queries/use-sidebar-unread.ts
@@ -12,6 +12,7 @@ import { useGlobalNotificationSource } from '@components/app/GlobalAppState';
import { enableGraphqlSoup } from '@core/constant/featureFlags';
import { notificationIsRead } from '@entity/utils/notification';
import { notificationStateFromGraphql } from '@notifications/notification-state';
+import { isUnreadChannelMessageNotification } from '@notifications/top-level-channel-notification';
import { createChannelUnreadQuery } from '@queries/channel/unread-presence';
import { makeGraphqlSoupInput } from '@queries/soup/graphql/ast';
import { useSoupAstItemsQuery } from '@queries/soup/items';
@@ -83,7 +84,8 @@ export function useSidebarUnread() {
.some(
(notification) =>
notification.entity_type === 'channel' &&
- !notificationIsRead(notification)
+ !notificationIsRead(notification) &&
+ isUnreadChannelMessageNotification(notification)
);
});
diff --git a/apps/web/src/features/channel/Channel/Channel.tsx b/apps/web/src/features/channel/Channel/Channel.tsx
index fbaa9454bb..0e86768a56 100644
--- a/apps/web/src/features/channel/Channel/Channel.tsx
+++ b/apps/web/src/features/channel/Channel/Channel.tsx
@@ -95,6 +95,7 @@ import { buildReplyTargetValue } from '../Thread/utils/message-actions';
import { isUnifiedInputMode } from '../unified-input-mode';
import { ActiveCallMessage } from './ActiveCallMessage';
import { ChannelDropZone } from './ChannelDropZone';
+import { ChannelUnreadNotifications } from './ChannelUnreadNotifications';
import { createChannelDragState } from './create-channel-drag-state';
import { createChannelFindBar } from './create-channel-find-bar';
import { createChannelHotkeys } from './create-channel-hotkeys';
@@ -123,10 +124,12 @@ import {
import { createThreadPaginator } from './thread-paginator';
import { UnifiedEditInput } from './UnifiedEditInput';
import { UnifiedReplyInput } from './UnifiedReplyInput';
+import { UnreadNotificationsOverlay } from './UnreadNotificationsOverlay';
import {
createUnifiedInputManager,
type UnifiedReplyTargetSnapshot,
} from './unified-input-manager';
+import type { UnreadThread } from './unread-thread-navigation';
export type ChannelProps = {
channelId: string;
@@ -499,6 +502,15 @@ export function Channel(props: ChannelProps) {
targetMessageController.goToMessage(messageId, replyId);
};
+ const goToUnread = (thread: UnreadThread | undefined) => {
+ if (!thread) return;
+ prepareTargetReply(thread.threadId);
+ goToMessage(
+ thread.threadId,
+ thread.messageId === thread.threadId ? undefined : thread.messageId
+ );
+ };
+
const releaseSelectionAndTarget = (threadId: string) => {
if (selection.selectedId() === threadId) clearSelection();
targetMessageController.clearActiveTarget(threadId);
@@ -704,133 +716,183 @@ export function Channel(props: ChannelProps) {
class="relative flex-1 min-h-0"
ref={setThreadListContainerEl}
>
- <SwipableRowProvider
+ <ChannelUnreadNotifications
+ channelId={props.channelId}
+ messages={messages}
+ scrollState={threadListScrollState}
container={threadListContainerEl}
- triggerBehavior="spring-back"
+ insets={threadListScrollInsets}
>
- <ThreadList
- keys={() => messageIndex.keys}
- targetId={
- targetMessageController.hasPendingElementScroll()
- ? targetMessageController.activeTargetMessageId()
- : undefined
- }
- insets={threadListScrollInsets()}
- followOnAppend={!messagesQuery.hasPreviousPage}
- onScrollNearTop={threadPaginator.shiftPaginate}
- onScrollNearBottom={threadPaginator.prependPaginate}
- onReady={onThreadListReady}
- onScroll={onThreadListScroll}
- onUserNavigation={cancelLatestNavigation}
- initialPosition={
- targetMessageController.activeTargetMessageId()
- ? {
- type: 'element',
- id: targetMessageController.activeTargetMessageId()!,
+ {(unreadChip) => (
+ <>
+ <SwipableRowProvider
+ container={threadListContainerEl}
+ triggerBehavior="spring-back"
+ >
+ <ThreadList
+ keys={() => messageIndex.keys}
+ targetId={
+ targetMessageController.hasPendingElementScroll()
+ ? targetMessageController.activeTargetMessageId()
+ : undefined
}
- : props.initialMessagesStateSnapshot?.scroll
- ? {
- type: 'restore',
- snapshot:
- props.initialMessagesStateSnapshot.scroll,
- }
- : { type: 'latest' }
- }
- >
- {(item) => {
- 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}
+ insets={threadListScrollInsets()}
+ followOnAppend={!messagesQuery.hasPreviousPage}
+ onScrollNearTop={threadPaginator.shiftPaginate}
+ onScrollNearBottom={
+ threadPaginator.prependPaginate
+ }
+ onReady={onThreadListReady}
+ onScroll={onThreadListScroll}
+ onUserNavigation={cancelLatestNavigation}
+ initialPosition={
+ targetMessageController.activeTargetMessageId()
+ ? {
+ type: 'element',
+ id: targetMessageController.activeTargetMessageId()!,
+ }
+ : props.initialMessagesStateSnapshot?.scroll
+ ? {
+ type: 'restore',
+ snapshot:
+ props.initialMessagesStateSnapshot
+ .scroll,
+ }
+ : { type: 'latest' }
+ }
+ >
+ {(item) => {
+ 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>
+ );
+ }}
+ </ThreadList>
+ </SwipableRowProvider>
+
+ <Show when={!findBar.isOpen()}>
+ <Show when={unreadChip()}>
+ {(chip) => (
+ <UnreadNotificationsOverlay
+ direction={chip().direction}
+ count={chip().count}
+ onClick={() => goToUnread(chip().thread)}
+ bottomInset={threadListScrollInsets().end}
/>
)}
</Show>
- );
- }}
- </ThreadList>
- </SwipableRowProvider>
- <Show when={!findBar.isOpen()}>
- <ScrollToBottomOverlay
- scrollState={threadListScrollState}
- onScrollToBottom={goToLatest}
- class="touch:top-[calc(var(--mobile-content-inset-top,0)+1rem)]"
- />
- </Show>
+ <Show when={unreadChip()?.direction !== 'above'}>
+ <ScrollToBottomOverlay
+ scrollState={threadListScrollState}
+ onScrollToBottom={goToLatest}
+ class="touch:top-[calc(var(--mobile-content-inset-top,0)+1rem)]"
+ />
+ </Show>
+ </Show>
+ </>
+ )}
+ </ChannelUnreadNotifications>
</div>
</Show>
<DebugSuspense name="Channel.active-call">
diff --git a/apps/web/src/features/channel/Channel/ChannelUnreadNotifications.tsx b/apps/web/src/features/channel/Channel/ChannelUnreadNotifications.tsx
new file mode 100644
index 0000000000..8efd72b344
--- /dev/null
+++ b/apps/web/src/features/channel/Channel/ChannelUnreadNotifications.tsx
@@ -0,0 +1,108 @@
+import { useFeatureFlag } from '@app/lib/analytics/posthog';
+import { useGlobalNotificationSource } from '@components/app/GlobalAppState';
+import { enableGraphqlSoup } from '@core/constant/featureFlags';
+import { isTransientRequestError } from '@core/util/request-error';
+import { MessageNotificationSourceContext } from '@notifications/components/MarkMessageNotifications';
+import { compositeEntity } from '@notifications/types';
+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 Accessor, createMemo, type JSX } from 'solid-js';
+import type { ThreadListScrollState } from './ThreadList';
+import {
+ type UnreadNotificationChip,
+ unreadNotificationChip,
+ unreadThreads,
+} from './unread-thread-navigation';
+
+/** Data and viewport wiring for the channel's unread navigation affordance. */
+export function ChannelUnreadNotifications(props: {
+ channelId: string;
+ messages: Accessor<MessageListItem[]>;
+ scrollState: Accessor<ThreadListScrollState | undefined>;
+ container: Accessor<HTMLElement | undefined>;
+ insets: Accessor<{ start: number; end: number }>;
+ children: (chip: Accessor<UnreadNotificationChip | undefined>) => JSX.Element;
+}) {
+ const notificationSource = useGlobalNotificationSource();
+ const graphqlNotifications = useFeatureFlag(enableGraphqlSoup);
+ const channelNotifications = createChannelNotificationsQuery(
+ props.channelId,
+ () => graphqlNotifications().enabled
+ );
+ const notifications = createMemo(() => {
+ if (!graphqlNotifications().enabled) {
+ return (
+ notificationSource.notificationsByEntity()[
+ compositeEntity({ type: 'channel', id: props.channelId })
+ ] ?? []
+ );
+ }
+ if (!channelNotifications.isEnabled || channelNotifications.isPending)
+ return [];
+ if (
+ channelNotifications.error &&
+ !isTransientRequestError(channelNotifications.error)
+ )
+ return [];
+ const records = channelNotifications.data ?? [];
+ return notificationSource.withLocalOverrides
+ ? records.map(notificationSource.withLocalOverrides)
+ : records;
+ });
+ const unread = createMemo(() => unreadThreads(notifications()));
+ // A reply's timestamp says nothing about where its parent sits in history.
+ // Resolve only the target parent without loading the timeline around it.
+ const unreadRoots = useMessageTimelineByIdsQuery(
+ () => ({ type: 'channel', id: props.channelId }),
+ () => {
+ const id = unread()[0]?.threadId;
+ return id && !props.messages().some((message) => message.id === id)
+ ? [id]
+ : [];
+ }
+ );
+ const unreadChip = createMemo(() => {
+ const positions = new Map(
+ (queryReadyGate(unreadRoots) ? unreadRoots.data : []).map((message) => [
+ message.id,
+ message,
+ ])
+ );
+ for (const message of props.messages()) positions.set(message.id, message);
+ const scroll = props.scrollState();
+ const target = unread()[0];
+ const container = props.container();
+ const viewport = container?.querySelector('[data-channel-scroll]');
+ const element =
+ target &&
+ container?.querySelector(
+ `[data-message-id="${CSS.escape(target.messageId)}"]`
+ );
+ let targetPosition: 'above' | 'below' | 'visible' | undefined;
+ if (viewport && element) {
+ const bounds = viewport.getBoundingClientRect();
+ const message = element.getBoundingClientRect();
+ const insets = props.insets();
+ targetPosition =
+ message.bottom <= bounds.top + insets.start
+ ? 'above'
+ : message.top >= bounds.bottom - insets.end
+ ? 'below'
+ : 'visible';
+ }
+ return unreadNotificationChip(
+ unread(),
+ positions,
+ scroll?.didInitialScroll ? scroll.visibleRange : undefined,
+ targetPosition
+ );
+ });
+
+ return (
+ <MessageNotificationSourceContext.Provider value={notifications}>
+ {props.children(unreadChip)}
+ </MessageNotificationSourceContext.Provider>
+ );
+}
diff --git a/apps/web/src/features/channel/Channel/ThreadList.tsx b/apps/web/src/features/channel/Channel/ThreadList.tsx
index 76a48c802c..52a9ce1df0 100644
--- a/apps/web/src/features/channel/Channel/ThreadList.tsx
+++ b/apps/web/src/features/channel/Channel/ThreadList.tsx
@@ -57,6 +57,8 @@ export type ThreadListScrollState = {
distanceFromTop: number;
distanceFromBottom: number;
viewportSize: number;
+ /** Intersecting rows, excluding overscan and floating header/composer insets. */
+ visibleRange?: { first: string; last: string };
};
export type ThreadListScrollSnapshot = {
@@ -456,6 +458,16 @@ export function ThreadList(props: ThreadListProps) {
: 0;
}
previousScrollOffset = distanceFromTop;
+ const visibleRows = virtualizer
+ .getVirtualItems()
+ .filter(
+ (item) =>
+ item.end + shortListOffset() > distanceFromTop + insets().start &&
+ item.start + shortListOffset() <
+ distanceFromTop + el.clientHeight - insets().end
+ );
+ const firstVisible = visibleRows.at(0);
+ const lastVisible = visibleRows.at(-1);
const state: ThreadListScrollState = {
didInitialScroll: lifecycle.isReady(),
isNearBottom: nearBottom,
@@ -464,6 +476,10 @@ export function ThreadList(props: ThreadListProps) {
distanceFromTop,
distanceFromBottom,
viewportSize: el.clientHeight,
+ visibleRange:
+ firstVisible && lastVisible
+ ? { first: String(firstVisible.key), last: String(lastVisible.key) }
+ : undefined,
};
// Capture both before invoking callers, which may synchronously navigate.
const snapshot = state.didInitialScroll
diff --git a/apps/web/src/features/channel/Channel/UnreadNotificationsOverlay.tsx b/apps/web/src/features/channel/Channel/UnreadNotificationsOverlay.tsx
new file mode 100644
index 0000000000..6ed3f2fcce
--- /dev/null
+++ b/apps/web/src/features/channel/Channel/UnreadNotificationsOverlay.tsx
@@ -0,0 +1,45 @@
+import ArrowDown from '@phosphor-icons/core/regular/arrow-down.svg?component-solid';
+import ArrowUp from '@phosphor-icons/core/regular/arrow-up.svg?component-solid';
+import { cn, Layer } from '@ui';
+import { Show } from 'solid-js';
+
+export function UnreadNotificationsOverlay(props: {
+ direction: 'above' | 'below';
+ count: number;
+ onClick: () => void;
+ bottomInset?: number;
+}) {
+ return (
+ <Show when={props.count > 0}>
+ <Layer depth={3}>
+ <button
+ type="button"
+ aria-label={`${props.count} unread notification ${props.count === 1 ? 'stack' : 'stacks'} ${props.direction}`}
+ class={cn(
+ 'absolute left-1/2 -translate-x-1/2 z-10 flex items-center gap-2 whitespace-nowrap rounded-full px-3 py-1.5 text-xs bg-surface border border-edge-muted shadow-lg not-touch:hover:overlay-hover not-touch:active:overlay-active',
+ props.direction === 'above'
+ ? 'top-4 touch:top-[calc(var(--mobile-content-inset-top,0)+1rem)]'
+ : 'bottom-4'
+ )}
+ style={
+ props.direction === 'below'
+ ? { bottom: `${(props.bottomInset ?? 0) + 16}px` }
+ : undefined
+ }
+ onClick={props.onClick}
+ >
+ <Show
+ when={props.direction === 'above'}
+ fallback={<ArrowDown class="size-3.5" aria-hidden="true" />}
+ >
+ <ArrowUp class="size-3.5" aria-hidden="true" />
+ </Show>
+ Unread notification
+ <span class="rounded-full bg-ink/10 px-1.5 tabular-nums">
+ {props.count}
+ </span>
+ </button>
+ </Layer>
+ </Show>
+ );
+}
diff --git a/apps/web/src/features/channel/Channel/tests/ChannelUnreadNotifications.test.tsx b/apps/web/src/features/channel/Channel/tests/ChannelUnreadNotifications.test.tsx
new file mode 100644
index 0000000000..ccb40e76ca
--- /dev/null
+++ b/apps/web/src/features/channel/Channel/tests/ChannelUnreadNotifications.test.tsx
@@ -0,0 +1,133 @@
+import type { UnifiedNotification } from '@notifications/types';
+import type { MessageListItem } from '@service-storage/messages';
+import { render } from '@solidjs/testing-library';
+import { createSignal, Show } from 'solid-js';
+import { expect, it, vi } from 'vitest';
+import { ChannelUnreadNotifications } from '../ChannelUnreadNotifications';
+import { UnreadNotificationsOverlay } from '../UnreadNotificationsOverlay';
+
+const mocks = vi.hoisted(() => ({ query: vi.fn(), source: vi.fn() }));
+vi.mock('@app/lib/analytics/posthog', () => ({
+ useFeatureFlag: () => () => ({ enabled: true }),
+}));
+vi.mock('@components/app/GlobalAppState', () => ({
+ useGlobalNotificationSource: mocks.source,
+}));
+vi.mock('@queries/channel/notifications', () => ({
+ createChannelNotificationsQuery: mocks.query,
+}));
+vi.mock('@queries/messages/timeline', () => ({
+ useMessageTimelineByIdsQuery: () => ({
+ isPending: true,
+ get data() {
+ throw new Error('Read pending parent query');
+ },
+ }),
+}));
+
+function notification(threadId: string, time: number): UnifiedNotification {
+ return {
+ id: `n-${time}`,
+ entity_id: 'channel',
+ entity_type: 'channel',
+ state: 'unseen',
+ sent: true,
+ viewed_at: null,
+ created_at: `2026-09-01T${time}:00:00Z`,
+ updated_at: '2026-09-01T00:00:00Z',
+ notification_event_type: 'channel_message_reply',
+ notification_metadata: {
+ tag: 'channel_message_reply',
+ content: {
+ channelType: 'private',
+ messageId: `reply-${time}`,
+ threadId,
+ messageContent: 'Hello',
+ },
+ },
+ };
+}
+
+it('updates one chip live without suspending the channel or loading the global feed', () => {
+ const [pending, setPending] = createSignal(true);
+ const [notifications, setNotifications] = createSignal<UnifiedNotification[]>(
+ []
+ );
+ const [seen, setSeen] = createSignal(false);
+ const globalRead = vi.fn(() => {
+ throw new Error('Read global notifications');
+ });
+ mocks.source.mockReturnValue({
+ notificationsByEntity: globalRead,
+ withLocalOverrides: (n: UnifiedNotification) =>
+ seen() ? { ...n, state: 'seen' } : n,
+ });
+ mocks.query.mockReturnValue({
+ isEnabled: true,
+ get isPending() {
+ return pending();
+ },
+ get data() {
+ if (pending()) throw new Error('Read pending notifications');
+ return notifications();
+ },
+ });
+ const messages = [1, 2, 3].map(
+ (i) =>
+ ({
+ id: `root-${i}`,
+ created_at: `2026-08-0${i}T00:00:00Z`,
+ }) as MessageListItem
+ );
+ const navigate = vi.fn();
+ const view = render(() => (
+ <ChannelUnreadNotifications
+ channelId="channel"
+ messages={() => messages}
+ scrollState={() => ({
+ didInitialScroll: true,
+ visibleRange: { first: 'root-2', last: 'root-2' },
+ isNearBottom: false,
+ isScrollingDown: false,
+ distanceFromBottom: 500,
+ distanceFromTop: 500,
+ viewportSize: 500,
+ })}
+ container={() => undefined}
+ insets={() => ({ start: 0, end: 0 })}
+ >
+ {(chip) => (
+ <>
+ <p>Channel messages</p>
+ <Show when={chip()}>
+ {(value) => (
+ <UnreadNotificationsOverlay
+ direction={value().direction}
+ count={value().count}
+ onClick={() => navigate(value().thread)}
+ />
+ )}
+ </Show>
+ </>
+ )}
+ </ChannelUnreadNotifications>
+ ));
+ expect(view.getByText('Channel messages')).toBeTruthy();
+ expect(view.queryByRole('button')).toBeNull();
+ setNotifications([notification('root-1', 12), notification('root-1', 13)]);
+ setPending(false);
+ expect(
+ view.getByRole('button', { name: '1 unread notification stack above' })
+ ).toBeTruthy();
+ setNotifications([...notifications(), notification('root-3', 14)]);
+ expect(view.getAllByRole('button')).toHaveLength(1);
+ view
+ .getByRole('button', { name: '2 unread notification stacks below' })
+ .click();
+ expect(navigate).toHaveBeenCalledWith(
+ expect.objectContaining({ threadId: 'root-3', messageId: 'reply-14' })
+ );
+ setSeen(true);
+ expect(view.queryByRole('button')).toBeNull();
+ expect(globalRead).not.toHaveBeenCalled();
+});
diff --git a/apps/web/src/features/channel/Channel/tests/unread-thread-navigation.test.ts b/apps/web/src/features/channel/Channel/tests/unread-thread-navigation.test.ts
new file mode 100644
index 0000000000..690413a2c0
--- /dev/null
+++ b/apps/web/src/features/channel/Channel/tests/unread-thread-navigation.test.ts
@@ -0,0 +1,167 @@
+import type { UnifiedNotification } from '@notifications/types';
+import { describe, expect, it } from 'vitest';
+import {
+ unreadNotificationChip,
+ unreadThreads,
+} from '../unread-thread-navigation';
+
+function reply(id: string, threadId: string, hour = 12): UnifiedNotification {
+ return {
+ id,
+ entity_id: 'channel',
+ entity_type: 'channel',
+ state: 'unseen',
+ sent: true,
+ created_at: `2026-09-01T${hour}:00:00Z`,
+ updated_at: '2026-09-01T00:00:00Z',
+ viewed_at: null,
+ notification_event_type: 'channel_message_reply',
+ notification_metadata: {
+ tag: 'channel_message_reply',
+ content: {
+ messageId: id,
+ threadId,
+ channelType: 'private',
+ messageContent: 'Hello',
+ },
+ },
+ };
+}
+const positions = new Map([
+ ['old', { id: 'old', created_at: '2026-08-01T00:00:00Z' }],
+ ['middle', { id: 'middle', created_at: '2026-08-02T00:00:00Z' }],
+ ['new', { id: 'new', created_at: '2026-08-03T00:00:00Z' }],
+]);
+const visible = { first: 'middle', last: 'middle' };
+
+describe('channel unread notification navigation', () => {
+ it('counts three replies and a mention of one reply as one thread', () => {
+ const mention = reply('third', 'old', 14);
+ mention.notification_metadata = {
+ tag: 'channel_mention',
+ content: {
+ messageId: 'third',
+ threadId: 'old',
+ channelType: 'private',
+ messageContent: '@you',
+ },
+ };
+ expect(
+ unreadThreads([
+ reply('first', 'old'),
+ reply('second', 'old', 13),
+ reply('third', 'old', 14),
+ mention,
+ ])
+ ).toEqual([
+ {
+ threadId: 'old',
+ messageId: 'third',
+ createdAt: '2026-09-01T14:00:00Z',
+ },
+ ]);
+ });
+
+ it('compares actual instants even when timestamps differ in precision', () => {
+ const early = {
+ ...reply('early', 'old'),
+ created_at: '2026-09-01T12:00:00Z',
+ };
+ const later = {
+ ...reply('later', 'old'),
+ created_at: '2026-09-01T12:00:00.500Z',
+ };
+ expect(unreadThreads([early, later])[0].messageId).toBe('later');
+ expect(
+ unreadThreads([
+ early,
+ {
+ ...later,
+ notification_metadata: reply('later', 'new').notification_metadata,
+ },
+ ])[0].threadId
+ ).toBe('new');
+ });
+
+ it('excludes seen, done, reactions, and non-channel records', () => {
+ const reaction = reply('reaction', 'new');
+ reaction.notification_metadata = {
+ tag: 'channel_message_reaction',
+ content: {
+ messageId: 'reaction',
+ threadId: 'new',
+ channelType: 'private',
+ emoji: '👍',
+ messageContent: 'Hello',
+ },
+ };
+ expect(
+ unreadThreads([
+ { ...reply('seen', 'old'), state: 'seen' },
+ { ...reply('done', 'old'), state: 'done' },
+ { ...reply('document', 'old'), entity_type: 'document' },
+ reaction,
+ ])
+ ).toEqual([]);
+ });
+
+ it('counts separate top-level messages separately and merges their thread notifications', () => {
+ const root = (id: string): UnifiedNotification => ({
+ ...reply(id, id),
+ notification_metadata: {
+ tag: 'channel_message_send',
+ content: { messageId: id, channelType: 'private' },
+ },
+ });
+ expect(
+ unreadThreads([root('old'), root('new'), reply('reply', 'old', 13)])
+ ).toHaveLength(2);
+ });
+
+ it('shows one chip for the most recent notification, with the total thread count', () => {
+ const threads = unreadThreads([
+ reply('a', 'new', 12),
+ reply('b', 'old', 13),
+ ]);
+ expect(unreadNotificationChip(threads, positions, visible)).toMatchObject({
+ count: 2,
+ direction: 'above',
+ thread: { messageId: 'b' },
+ });
+ // A live delivery changes the target and direction, but never double-counts its thread.
+ const live = unreadThreads([
+ reply('a', 'new', 12),
+ reply('b', 'old', 13),
+ reply('c', 'new', 14),
+ ]);
+ expect(unreadNotificationChip(live, positions, visible)).toMatchObject({
+ count: 2,
+ direction: 'below',
+ thread: { messageId: 'c' },
+ });
+ });
+
+ it('uses measured reply position within a tall thread and hides for a visible message', () => {
+ const threads = unreadThreads([reply('a', 'middle')]);
+ expect(
+ unreadNotificationChip(threads, positions, visible, 'above')?.direction
+ ).toBe('above');
+ expect(
+ unreadNotificationChip(threads, positions, visible, 'below')?.direction
+ ).toBe('below');
+ expect(
+ unreadNotificationChip(threads, positions, visible, 'visible')
+ ).toBeUndefined();
+ expect(unreadNotificationChip(threads, positions, visible)?.direction).toBe(
+ 'below'
+ );
+ });
+
+ it('waits for layout and an unloaded parent position instead of guessing from reply time', () => {
+ const threads = unreadThreads([reply('a', 'old')]);
+ expect(
+ unreadNotificationChip(threads, positions, undefined)
+ ).toBeUndefined();
+ expect(unreadNotificationChip(threads, new Map(), visible)).toBeUndefined();
+ });
+});
diff --git a/apps/web/src/features/channel/Channel/unread-thread-navigation.ts b/apps/web/src/features/channel/Channel/unread-thread-navigation.ts
new file mode 100644
index 0000000000..98c6b60df2
--- /dev/null
+++ b/apps/web/src/features/channel/Channel/unread-thread-navigation.ts
@@ -0,0 +1,86 @@
+import type { UnifiedNotification } from '@notifications/types';
+
+export type UnreadThread = {
+ threadId: string;
+ messageId: string;
+ /** Newest unread notification, used to choose a reply within the thread. */
+ createdAt: string;
+};
+
+/** Unlike Inbox display stacks, every parent message is its own stack here. */
+export function unreadThreads(
+ notifications: readonly UnifiedNotification[]
+): UnreadThread[] {
+ const threads = new Map<string, UnreadThread>();
+ for (const notification of notifications) {
+ if (
+ notification.state !== 'unseen' ||
+ notification.entity_type !== 'channel'
+ )
+ continue;
+ const metadata = notification.notification_metadata;
+ if (
+ metadata.tag !== 'channel_message_send' &&
+ metadata.tag !== 'channel_message_reply' &&
+ metadata.tag !== 'channel_mention' &&
+ metadata.tag !== 'document_mention'
+ )
+ continue;
+ const messageId = metadata.content.messageId;
+ if (!messageId) continue;
+ const threadId =
+ ('threadId' in metadata.content && metadata.content.threadId) ||
+ messageId;
+ const previous = threads.get(threadId);
+ if (
+ !previous ||
+ Date.parse(notification.created_at) > Date.parse(previous.createdAt)
+ ) {
+ threads.set(threadId, {
+ threadId,
+ messageId,
+ createdAt: notification.created_at,
+ });
+ }
+ }
+ return [...threads.values()].sort(
+ (a, b) =>
+ Date.parse(b.createdAt) - Date.parse(a.createdAt) ||
+ b.messageId.localeCompare(a.messageId)
+ );
+}
+
+export type ThreadPosition = { id: string; created_at: string };
+export type VisibleThreadRange = { first: string; last: string };
+
+export type UnreadNotificationChip = {
+ thread: UnreadThread;
+ count: number;
+ direction: 'above' | 'below';
+};
+
+/** Target recency and placement are separate: a new reply can be far above. */
+export function unreadNotificationChip(
+ threads: readonly UnreadThread[],
+ positions: ReadonlyMap<string, ThreadPosition>,
+ visible: VisibleThreadRange | undefined,
+ targetPosition?: 'above' | 'below' | 'visible'
+): UnreadNotificationChip | undefined {
+ const thread = threads[0];
+ if (!thread || !visible || targetPosition === 'visible') return;
+ if (targetPosition)
+ return { thread, count: threads.length, direction: targetPosition };
+ const root = positions.get(thread.threadId);
+ const first = positions.get(visible.first);
+ if (!root || !first) return;
+ const order =
+ Date.parse(root.created_at) - Date.parse(first.created_at) ||
+ root.id.localeCompare(first.id);
+ // A collapsed reply in a visible thread lies below its parent. Clicking opens
+ // it; merely seeing the parent must not clear that thread's unread count.
+ return {
+ thread,
+ count: threads.length,
+ direction: order < 0 ? 'above' : 'below',
+ };
+}
diff --git a/apps/web/src/features/channel/Thread/ChannelThread.tsx b/apps/web/src/features/channel/Thread/ChannelThread.tsx
index 0220f659aa..65f38459e8 100644
--- a/apps/web/src/features/channel/Thread/ChannelThread.tsx
+++ b/apps/web/src/features/channel/Thread/ChannelThread.tsx
@@ -9,7 +9,6 @@ import { useThreadRepliesQuery } from '@queries/messages/thread-replies';
import type { Message as EntityMessage } from '@service-storage/messages';
import {
createEffect,
- createMemo,
createSignal,
on,
onCleanup,
@@ -23,6 +22,7 @@ import { createTargetReplyNavigationController } from './create-target-reply-nav
import { createTargetReplyScroller } from './create-target-reply-scroller';
import { createThreadHotkeys } from './create-thread-hotkeys';
import { createThreadRepliesFetchGate } from './create-thread-replies-fetch-gate';
+import { createThreadReplyView } from './create-thread-reply-view';
import { Thread } from './Thread';
import type { ThreadReplyListHandle } from './ThreadReplyList';
import { ThreadTypingIndicator } from './ThreadTypingIndicator';
@@ -32,7 +32,6 @@ import {
getCollapsedRepliesCount,
getThreadLatestReplyAt,
getUniqueReplyUserIds,
- getVisibleReplyCount,
} from './utils/thread-reply-indicator-helpers';
export function ChannelThread(props: ThreadProps) {
@@ -44,7 +43,6 @@ export function ChannelThread(props: ThreadProps) {
const hasReplies = () => thread().reply_count > 0;
const fetchRepliesEnabled = createThreadRepliesFetchGate({
threadId: () => props.data().id,
- replyCount: () => thread().reply_count,
isExpanded: props.isExpanded,
isFindBarOpen: props.isFindBarOpen,
targetThreadId: () => props.targetNavigation?.targetThreadId(),
@@ -85,20 +83,12 @@ export function ChannelThread(props: ThreadProps) {
const loadedReplies = () => queryReplies() ?? [];
const canScrollToTargetReply = () => queryReplies() !== undefined;
- const activeReplies = (): Array<EntityMessage> => {
- return queryReplies() ?? thread().preview ?? [];
- };
-
- // Full replies can extend the server preview's final group. The guarded
- // query read lets collapsed threads update without suspending while fetching.
- const visibleReplyCount = createMemo(() =>
- getVisibleReplyCount(activeReplies())
- );
- const displayReplies = createMemo(() =>
- props.isExpanded()
- ? activeReplies()
- : activeReplies().slice(0, visibleReplyCount())
- );
+ const { activeReplies, visibleReplyCount, displayReplies } =
+ createThreadReplyView({
+ preview: () => thread().preview,
+ loaded: queryReplies,
+ isExpanded: props.isExpanded,
+ });
// Thread-local reply selection
const replySelection = createMessageSelection({
diff --git a/apps/web/src/features/channel/Thread/create-thread-replies-fetch-gate.ts b/apps/web/src/features/channel/Thread/create-thread-replies-fetch-gate.ts
index d0ee58c75b..725951b2f1 100644
--- a/apps/web/src/features/channel/Thread/create-thread-replies-fetch-gate.ts
+++ b/apps/web/src/features/channel/Thread/create-thread-replies-fetch-gate.ts
@@ -1,12 +1,10 @@
import { deferredGate } from '@core/util/debounce';
import type { Accessor } from 'solid-js';
-import { DEFAULT_VISIBLE_REPLY_GROUP_COUNT } from './utils/thread-reply-indicator-helpers';
export const THREAD_REPLIES_FETCH_DEBOUNCE_MS = 300;
type CreateThreadRepliesFetchGateOptions = {
threadId: Accessor<string>;
- replyCount: Accessor<number>;
isExpanded: Accessor<boolean>;
isFindBarOpen: Accessor<boolean>;
targetThreadId: Accessor<string | undefined>;
@@ -14,7 +12,8 @@ type CreateThreadRepliesFetchGateOptions = {
};
/**
- * Delays reply fetching long enough for transiently mounted threads to unmount.
+ * Collapsed threads use their timeline preview without fetching full replies.
+ * Delays explicit expansion/navigation fetches while transient rows unmount.
* Cmd+F navigation is the only immediate path because it needs the targeted
* reply list before it can position the active search result.
*/
@@ -24,10 +23,7 @@ export function createThreadRepliesFetchGate(
const isTargetedReply = () =>
!!options.targetReplyId() &&
options.targetThreadId() === options.threadId();
- const shouldFetchReplies = () =>
- isTargetedReply() ||
- options.isExpanded() ||
- options.replyCount() > DEFAULT_VISIBLE_REPLY_GROUP_COUNT;
+ const shouldFetchReplies = () => isTargetedReply() || options.isExpanded();
const debouncedFetchReplies = deferredGate(
shouldFetchReplies,
THREAD_REPLIES_FETCH_DEBOUNCE_MS
diff --git a/apps/web/src/features/channel/Thread/create-thread-reply-view.ts b/apps/web/src/features/channel/Thread/create-thread-reply-view.ts
new file mode 100644
index 0000000000..993d3fa282
--- /dev/null
+++ b/apps/web/src/features/channel/Thread/create-thread-reply-view.ts
@@ -0,0 +1,21 @@
+import { type Accessor, createMemo } from 'solid-js';
+import type { GroupableMessage } from '../Channel/message-grouping-meta';
+import { getVisibleReplyCount } from './utils/thread-reply-indicator-helpers';
+
+/** Full reply data may arrive independently of the user's expansion choice. */
+export function createThreadReplyView<T extends GroupableMessage>(options: {
+ preview: Accessor<T[]>;
+ loaded: Accessor<T[] | undefined>;
+ isExpanded: Accessor<boolean>;
+}) {
+ const previewCount = createMemo(() =>
+ getVisibleReplyCount(options.preview())
+ );
+ const activeReplies = () => options.loaded() ?? options.preview();
+ const displayReplies = createMemo(() =>
+ options.isExpanded()
+ ? activeReplies()
+ : options.preview().slice(0, previewCount())
+ );
+ return { activeReplies, displayReplies, visibleReplyCount: previewCount };
+}
diff --git a/apps/web/src/features/channel/Thread/tests/create-thread-replies-fetch-gate.test.ts b/apps/web/src/features/channel/Thread/tests/create-thread-replies-fetch-gate.test.ts
index 3cbb4e53cb..353d98bdf5 100644
--- a/apps/web/src/features/channel/Thread/tests/create-thread-replies-fetch-gate.test.ts
+++ b/apps/web/src/features/channel/Thread/tests/create-thread-replies-fetch-gate.test.ts
@@ -4,12 +4,10 @@ import {
createThreadRepliesFetchGate,
THREAD_REPLIES_FETCH_DEBOUNCE_MS,
} from '../create-thread-replies-fetch-gate';
-import { DEFAULT_VISIBLE_REPLY_GROUP_COUNT } from '../utils/thread-reply-indicator-helpers';
type FixtureOptions = {
isExpanded?: boolean;
isFindBarOpen?: boolean;
- replyCount?: number;
targetReplyId?: string;
targetThreadId?: string;
};
@@ -33,7 +31,6 @@ describe('createThreadRepliesFetchGate', () => {
dispose = rootDispose;
enabled = createThreadRepliesFetchGate({
threadId: () => 'thread-1',
- replyCount: () => options.replyCount ?? 0,
isExpanded: () => options.isExpanded ?? false,
isFindBarOpen: () => options.isFindBarOpen ?? false,
targetThreadId: () => options.targetThreadId,
@@ -48,17 +45,11 @@ describe('createThreadRepliesFetchGate', () => {
await Promise.resolve();
};
- it('waits 300ms before enabling an ordinary thread reply fetch', async () => {
- const fixture = createFixture({
- replyCount: DEFAULT_VISIBLE_REPLY_GROUP_COUNT + 1,
- });
+ it('does not fetch full replies merely because a collapsed thread stays mounted', async () => {
+ const fixture = createFixture();
await flushEffects();
-
+ vi.advanceTimersByTime(THREAD_REPLIES_FETCH_DEBOUNCE_MS * 10);
expect(fixture.enabled()).toBe(false);
- vi.advanceTimersByTime(THREAD_REPLIES_FETCH_DEBOUNCE_MS - 1);
- expect(fixture.enabled()).toBe(false);
- vi.advanceTimersByTime(1);
- expect(fixture.enabled()).toBe(true);
});
it('also debounces expansion and non-find-bar reply navigation', async () => {
diff --git a/apps/web/src/features/channel/Thread/tests/create-thread-reply-view.test.ts b/apps/web/src/features/channel/Thread/tests/create-thread-reply-view.test.ts
new file mode 100644
index 0000000000..e4f38e1216
--- /dev/null
+++ b/apps/web/src/features/channel/Thread/tests/create-thread-reply-view.test.ts
@@ -0,0 +1,66 @@
+import { createRoot, createSignal } from 'solid-js';
+import { describe, expect, it } from 'vitest';
+import type { GroupableMessage } from '../../Channel/message-grouping-meta';
+import { createThreadReplyView } from '../create-thread-reply-view';
+
+// One sender group used to grow from the three-row preview to all ten replies.
+const replies: GroupableMessage[] = Array.from({ length: 10 }, (_, index) => ({
+ id: `reply-${index}`,
+ sender_id: 'sender',
+ created_at: new Date(Date.UTC(2026, 8, 24, 9, index)).toISOString(),
+ attachments: [],
+ deleted_at: null,
+}));
+const preview = replies.slice(0, 3);
+
+function fixture(initialLoaded?: GroupableMessage[]) {
+ return createRoot((dispose) => {
+ const [loaded, setLoaded] = createSignal(initialLoaded);
+ const [isExpanded, setExpanded] = createSignal(false);
+ const view = createThreadReplyView({
+ preview: () => preview,
+ loaded,
+ isExpanded,
+ });
+ return { ...view, dispose, setLoaded, setExpanded };
+ });
+}
+
+describe('thread preview and explicit expansion', () => {
+ it('keeps the collapsed preview stable when a background fetch completes', () => {
+ const view = fixture();
+ try {
+ expect(view.displayReplies()).toEqual(preview);
+ view.setLoaded(replies);
+ expect(view.displayReplies()).toEqual(preview);
+ expect(view.visibleReplyCount()).toBe(3);
+ } finally {
+ view.dispose();
+ }
+ });
+
+ it('does not reveal a cached full thread on mount or remount', () => {
+ for (let mount = 0; mount < 2; mount++) {
+ const view = fixture(replies);
+ try {
+ expect(view.displayReplies()).toEqual(preview);
+ } finally {
+ view.dispose();
+ }
+ }
+ });
+
+ it('keeps the preview while an explicit expansion loads, then displays all replies', () => {
+ const view = fixture();
+ try {
+ view.setExpanded(true);
+ expect(view.displayReplies()).toEqual(preview);
+ view.setLoaded(replies);
+ expect(view.displayReplies()).toEqual(replies);
+ view.setExpanded(false);
+ expect(view.displayReplies()).toEqual(preview);
+ } finally {
+ view.dispose();
+ }
+ });
+});
diff --git a/apps/web/src/features/channels-view/channels-view.test.tsx b/apps/web/src/features/channels-view/channels-view.test.tsx
index ac3e9018e8..b3831f8fe0 100644
--- a/apps/web/src/features/channels-view/channels-view.test.tsx
+++ b/apps/web/src/features/channels-view/channels-view.test.tsx
@@ -1,3 +1,4 @@
+import { ThrownResultError } from '@core/util/result';
import type { ChannelEntity } from '@entity/types/entity';
import type { Notification } from '@entity/types/notification';
import {
@@ -7,6 +8,7 @@ import {
screen,
waitFor,
} from '@solidjs/testing-library';
+import { CombinedError } from '@urql/core';
import { batch, createSignal, For, type JSX, Show } from 'solid-js';
import { createStore } from 'solid-js/store';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
@@ -26,6 +28,7 @@ const mocks = vi.hoisted(() => ({
mobileTab: (): ChannelsQueryScope => 'channels',
selectedQuery: vi.fn(),
markRead: vi.fn(),
+ resolveTarget: vi.fn(() => ({ kind: 'message', messageId: 'unread' })),
refresh: vi.fn(async () => {}),
}));
@@ -57,7 +60,7 @@ vi.mock('@app/components/view-shell', () => ({
},
}));
vi.mock('@app/features/next-soup/utils', () => ({
- getChannelEntityTarget: () => undefined,
+ getChannelEntityTarget: mocks.resolveTarget,
markChannelNotificationsSeenOnOpen: mocks.markRead,
}));
vi.mock('@app/features/soup', () => ({
@@ -66,7 +69,10 @@ vi.mock('@app/features/soup', () => ({
vi.mock('@app/features/soup/entity-notifications', () => ({
withEntityNotifications: (entity: FullChannel) => ({
...entity,
- notifications: () => entity.notifications,
+ notifications:
+ typeof entity.notifications === 'function'
+ ? entity.notifications
+ : () => entity.notifications,
}),
}));
vi.mock('@components/app/GlobalAppState', () => ({
@@ -98,8 +104,11 @@ vi.mock('@entity', async () => ({
ListEntityMetadataQueryProvider: mocks.pass,
}));
vi.mock('./components/ChannelDetailView', () => ({
- ChannelDetailView: (props: { channel: ChannelEntity }) => (
- <div data-testid="channel-detail">
+ ChannelDetailView: (props: { channel: ChannelEntity; target?: unknown }) => (
+ <div
+ data-testid="channel-detail"
+ data-target={JSON.stringify(props.target)}
+ >
{props.channel.id}
<textarea aria-label="Composer" />
</div>
@@ -221,13 +230,16 @@ beforeEach(() => {
isLoading: false,
isFetching: false,
error: null,
- data: { entities: [] },
+ data: { entities: [full('two', [])] },
});
setQuery = update;
mocks.selectedQuery.mockImplementation((_id, enabled: () => boolean) => ({
get isEnabled() {
return enabled();
},
+ get isPending() {
+ return query.isLoading;
+ },
get isLoading() {
return query.isLoading;
},
@@ -281,6 +293,201 @@ describe('mobile dock search wiring', () => {
});
describe('channel selection loading and recovery', () => {
+ it.each(['pointerDown', 'keyDown', 'wheel'] as const)(
+ 'stays at latest after %s and notification hydration',
+ (event) => {
+ setQuery({ isFetching: true, data: undefined });
+ render(() => <ChannelsView />);
+ const composer = screen.getByRole('textbox', { name: 'Composer' });
+ fireEvent[event](composer);
+ batch(() =>
+ setQuery({
+ isFetching: false,
+ data: { entities: [full('one', ['unread'])] },
+ })
+ );
+ expect(mocks.resolveTarget).not.toHaveBeenCalled();
+ expect(screen.getByTestId('channel-detail').dataset.target).toBe(
+ JSON.stringify({ kind: 'latest' })
+ );
+ expect(mocks.markRead).toHaveBeenCalledOnce();
+ }
+ );
+
+ it('stays at latest after mounting when notifications arrive', () => {
+ setQuery({ isFetching: true, data: undefined });
+ render(() => <ChannelsView />);
+ const composer = screen.getByRole('textbox', { name: 'Composer' });
+ batch(() =>
+ setQuery({
+ isFetching: false,
+ data: { entities: [full('one', ['unread'])] },
+ })
+ );
+ expect(screen.getByTestId('channel-detail').dataset.target).toBe(
+ JSON.stringify({ kind: 'latest' })
+ );
+ expect(screen.getByRole('textbox', { name: 'Composer' })).toBe(composer);
+ });
+
+ it('preserves an already-loaded full notification edge on route open', () => {
+ setRows([full('one', ['unread-message'])]);
+ render(() => <ChannelsView />);
+ expect(mocks.markRead).toHaveBeenCalledOnce();
+ const marked = mocks.markRead.mock.calls[0][0];
+ expect(
+ marked
+ .notifications()
+ .map((notification: Notification) => notification.id)
+ ).toEqual(['unread-message']);
+ });
+
+ it('keeps the composer mounted and focused across loading, failure, retry, and recovery', () => {
+ setQuery({ isFetching: true, data: undefined });
+ render(() => <ChannelsView />);
+ const composer = screen.getByRole('textbox', { name: 'Composer' });
+ composer.focus();
+ batch(() => setQuery({ isFetching: false, error: new Error('Offline') }));
+ expect(screen.getByRole('textbox', { name: 'Composer' })).toBe(composer);
+ batch(() => setQuery({ isFetching: true, error: null }));
+ expect(screen.getByRole('textbox', { name: 'Composer' })).toBe(composer);
+ batch(() =>
+ setQuery({
+ isFetching: false,
+ data: { entities: [full('one', ['new'])] },
+ })
+ );
+ expect(screen.getByRole('textbox', { name: 'Composer' })).toBe(composer);
+ expect(document.activeElement).toBe(composer);
+ expect(mocks.markRead).toHaveBeenCalledOnce();
+ });
+
+ it.each([
+ new Error('Connection interrupted'),
+ new ThrownResultError([{ code: 'NETWORK_ERROR', message: 'Offline' }]),
+ new ThrownResultError([{ code: 'SERVER_ERROR', message: 'Server failed' }]),
+ new CombinedError({ networkError: new Error('Offline') }),
+ new CombinedError({
+ networkError: new Error('HTTP 503'),
+ response: { status: 503 },
+ }),
+ ])(
+ 'renders an empty unread projection after a transient failure without marking read: %s',
+ (error) => {
+ setSelectedId('two');
+ setQuery({ error, data: undefined });
+ render(() => <ChannelsView />);
+ expect(screen.getByTestId('channel-detail').textContent).toBe('two');
+ expect(screen.queryByText('Conversation unavailable')).toBeNull();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+
+ batch(() => {
+ setQuery('data', { entities: [full('two', ['fresh'])] });
+ setQuery('error', null);
+ });
+ expect(mocks.markRead).toHaveBeenCalledOnce();
+ const marked = mocks.markRead.mock.calls[0][0] as {
+ notifications: () => Notification[];
+ };
+ expect(
+ marked.notifications().map((notification) => notification.id)
+ ).toEqual(['fresh']);
+ }
+ );
+
+ it('does not mark a cached nonempty unread projection on a transient failure', () => {
+ setQuery({ error: new Error('Offline'), data: undefined });
+ render(() => <ChannelsView />);
+ expect(screen.getByTestId('channel-detail').textContent).toBe('one');
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ });
+
+ it.each([
+ new ThrownResultError([{ code: 'UNAUTHORIZED', message: 'Unauthorized' }]),
+ new ThrownResultError([{ code: 'FORBIDDEN', message: 'Forbidden' }]),
+ new ThrownResultError([{ code: 'NOT_FOUND', message: 'Not found' }]),
+ new CombinedError({
+ networkError: new Error('HTTP 401'),
+ response: { status: 401 },
+ }),
+ new CombinedError({
+ networkError: new Error('HTTP 403'),
+ response: { status: 403 },
+ }),
+ new CombinedError({
+ graphQLErrors: [
+ { message: 'Forbidden', extensions: { code: 'FORBIDDEN' } },
+ ],
+ }),
+ ])(
+ 'keeps access failures unavailable even with cached or previously loaded data: %s',
+ (error) => {
+ setSelectedId('two');
+ setQuery('error', error);
+ render(() => <ChannelsView />);
+ expect(screen.getByText('Conversation unavailable')).toBeTruthy();
+ expect(screen.queryByTestId('channel-detail')).toBeNull();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+
+ setQuery('error', null);
+ expect(screen.getByTestId('channel-detail').textContent).toBe('two');
+ mocks.markRead.mockClear();
+ setQuery('error', error);
+ expect(screen.getByText('Conversation unavailable')).toBeTruthy();
+ expect(screen.queryByTestId('channel-detail')).toBeNull();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ }
+ );
+
+ it('keeps an uncached channel unavailable after a transient failure', () => {
+ setRows([]);
+ setQuery({ error: new Error('Offline'), data: undefined });
+ render(() => <ChannelsView />);
+ expect(screen.getByText('Conversation unavailable')).toBeTruthy();
+ expect(screen.queryByTestId('channel-detail')).toBeNull();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ });
+
+ it('shows the selected channel while its notification data is still loading', () => {
+ setSelectedId('two');
+ render(() => <ChannelsView />);
+ expect(screen.getByTestId('channel-detail').textContent).toBe('two');
+ mocks.markRead.mockClear();
+
+ batch(() => {
+ setQuery('isFetching', true);
+ setSelectedId('one');
+ });
+ expect(screen.getByTestId('channel-detail').textContent).toBe('one');
+ expect(screen.queryByText('Loading conversation')).toBeNull();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+
+ batch(() => {
+ setQuery('data', { entities: [full('one', ['new'])] });
+ setQuery('isFetching', false);
+ });
+ expect(screen.getByTestId('channel-detail').textContent).toBe('one');
+ expect(mocks.markRead).toHaveBeenCalledOnce();
+ });
+
+ it('renders an empty unread projection while refreshing its notifications', () => {
+ setSelectedId('two');
+ setQuery('isFetching', true);
+ render(() => <ChannelsView />);
+ expect(screen.getByTestId('channel-detail')).toBeTruthy();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ batch(() => {
+ setQuery('data', { entities: [full('two', ['arrived-after-list'])] });
+ setQuery('isFetching', false);
+ });
+ expect(screen.getByTestId('channel-detail').textContent).toBe('two');
+ expect(mocks.markRead).toHaveBeenCalledExactlyOnceWith(
+ expect.objectContaining({ id: 'two' }),
+ expect.anything(),
+ { channelReadScope: 'top-level' }
+ );
+ });
+
it('offers recovery for a successful empty selection and retries normally', async () => {
render(() => <ChannelsView />);
expect(screen.getByText('Conversation unavailable')).toBeTruthy();
@@ -290,17 +497,21 @@ describe('channel selection loading and recovery', () => {
expect(mocks.markRead).not.toHaveBeenCalled();
setQuery('isFetching', true);
- expect(screen.getByText('Loading conversation')).toBeTruthy();
+ expect(screen.getByTestId('channel-detail').textContent).toBe('one');
batch(() => {
setQuery('data', { entities: [full('one', ['new'])] });
setQuery('isFetching', false);
});
expect(screen.getByTestId('channel-detail').textContent).toBe('one');
- expect(mocks.markRead).toHaveBeenCalledOnce();
+ expect(mocks.markRead).toHaveBeenCalledExactlyOnceWith(
+ expect.objectContaining({ id: 'one' }),
+ expect.anything(),
+ { channelReadScope: 'top-level' }
+ );
});
it('never marks cached data while a reopened selection is refreshing', async () => {
- setQuery('data', { entities: [full('one', ['old'])] });
+ setQuery('data', { entities: [full('one', ['old']), full('two', [])] });
render(() => <ChannelsView />);
await waitFor(() => expect(mocks.markRead).toHaveBeenCalledOnce());
setSelectedId('two');
@@ -310,7 +521,7 @@ describe('channel selection loading and recovery', () => {
setSelectedId('one');
setQuery('isFetching', true);
});
- expect(screen.getByText('Loading conversation')).toBeTruthy();
+ expect(screen.getByTestId('channel-detail')).toBeTruthy();
expect(mocks.markRead).not.toHaveBeenCalled();
batch(() => {
setQuery('data', { entities: [full('one', ['old', 'new'])] });
diff --git a/apps/web/src/features/channels-view/channels-view.tsx b/apps/web/src/features/channels-view/channels-view.tsx
index 8611d8fea4..d49835f2be 100644
--- a/apps/web/src/features/channels-view/channels-view.tsx
+++ b/apps/web/src/features/channels-view/channels-view.tsx
@@ -14,10 +14,8 @@ import { ListEntityMetadataQueryProvider } from '@entity';
import SpinnerIcon from '@phosphor/spinner.svg';
import {
createContext,
- createEffect,
createMemo,
createSignal,
- on,
onMount,
Show,
useContext,
@@ -26,6 +24,7 @@ import { ChannelsViewProvider, useChannelsView } from './channels-view-context';
import { ChannelDetailView } from './components/ChannelDetailView';
import { ChannelsMobileView } from './components/ChannelsMobileView';
import { ChannelsRail } from './components/rail/ChannelsRail';
+import { createChannelDetail } from './primitives/create-channel-detail';
import {
type ChannelsSources,
deduplicateChannels,
@@ -33,6 +32,7 @@ import {
useChannelByIdQuery,
useChannelsSources,
} from './queries';
+import { createChannelDetailSource } from './queries/channel-detail-source';
import { createChannelSearchSource } from './queries/channel-search-source';
const ChannelSourcesContext =
@@ -203,7 +203,7 @@ function ChannelsViewRoot() {
function ChannelDetailRouteContent() {
const { selectedChannel } = useChannelsView();
const notificationSource = useGlobalNotificationSource();
- const channelId = () => selectedChannel()?.id;
+ const channelId = createMemo(() => selectedChannel()?.id);
const sources = useContext(ChannelSourcesContext);
const loaded = createMemo(() =>
resolveSelectedChannel(
@@ -218,79 +218,73 @@ function ChannelDetailRouteContent() {
: []
)
);
- const needsFullEdge = createMemo(
- on(
- channelId,
- () =>
- loaded() === undefined ||
- (loaded()?.unreadNotifications?.length ?? 0) > 0
- )
- );
- const query = useChannelByIdQuery(
+ const source = createChannelDetailSource({
channelId,
- () =>
- channelId() !== undefined && (needsFullEdge() || loaded() === undefined)
- );
- const hydrated = createMemo((previous: ReturnType<typeof loaded>) => {
- const selection = selectedChannel();
- if (!selection || selection.type !== 'channel') return;
- const cached = loaded();
- if (cached && !needsFullEdge())
- return { ...cached, target: selection.target, notifications: () => [] };
- if (
- !query.isEnabled ||
- query.isLoading ||
- query.isFetching ||
- query.error
- ) {
- return previous?.id === selection.id ? previous : undefined;
- }
- const full = resolveSelectedChannel(selection.id, [], query.data?.entities);
- if (!full) return;
+ cached: loaded,
+ createQuery: useChannelByIdQuery,
+ });
+ const detail = createChannelDetail({
+ selection: selectedChannel,
+ cached: loaded,
+ source,
+ markRead: (channel) =>
+ markChannelNotificationsSeenOnOpen(
+ withEntityNotifications(channel, notificationSource),
+ notificationSource,
+ { channelReadScope: 'top-level' }
+ ),
+ });
+ const visibleChannel = createMemo(() => {
+ const view = detail.view();
+ if (view.status !== 'ready') return;
return withEntityNotifications(
- { ...full, target: selection.target },
+ { ...view.channel, target: selectedChannel()?.target },
notificationSource
);
});
- const unavailable = () =>
- Boolean(query.error) ||
- (query.isEnabled && !query.isLoading && !query.isFetching && !hydrated());
+ const unavailable = () => detail.view().status === 'unavailable';
const retry = async () => {
try {
- await query.refresh();
+ await detail.refresh();
} catch {
- /* Query state presents the failure. */
+ /* The source presents the failure. */
}
};
- const readyId = createMemo(() => hydrated()?.id);
- createEffect(
- on(readyId, () => {
- const channel = hydrated();
- if (channel && channel.isParticipant !== false)
- markChannelNotificationsSeenOnOpen(channel, notificationSource);
- })
- );
return (
<DebugSuspense name="ChannelsView.detail-content">
<Show
- when={hydrated()}
+ when={visibleChannel()}
fallback={
- <div class="flex size-full flex-col items-center justify-center gap-2 text-ink-muted">
- <h2>
- {unavailable()
- ? 'Conversation unavailable'
- : 'Loading conversation'}
- </h2>
- <Show when={unavailable()}>
- <button type="button" onClick={retry}>
- Retry
- </button>
- </Show>
- </div>
+ <>
+ <ViewShell.TopBar>
+ <span class="truncate text-sm font-semibold">
+ {loaded()?.name ?? 'Conversation'}
+ </span>
+ </ViewShell.TopBar>
+ <div
+ class="flex min-h-0 flex-1 flex-col items-center justify-center gap-2 text-ink-muted"
+ role="status"
+ >
+ <h2>
+ {unavailable()
+ ? 'Conversation unavailable'
+ : 'Loading conversation'}
+ </h2>
+ <Show when={unavailable()}>
+ <button type="button" onClick={retry}>
+ Retry
+ </button>
+ </Show>
+ </div>
+ </>
}
>
- {(channel) => <ChannelDetailView channel={channel()} />}
+ {(channel) => (
+ <div class="flex size-full min-h-0 flex-col">
+ <ChannelDetailView channel={channel()} target={detail.target()} />
+ </div>
+ )}
</Show>
</DebugSuspense>
);
diff --git a/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx b/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx
index 601737c8c0..cfa34e2c1b 100644
--- a/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx
+++ b/apps/web/src/features/channels-view/components/ChannelDetailView.test.tsx
@@ -6,10 +6,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
const mocks = vi.hoisted(() => ({
routeSearch: vi.fn((): { seek?: string } => ({})),
- getTarget:
- vi.fn<
- typeof import('@app/features/next-soup/utils').getChannelEntityTarget
- >(),
}));
vi.mock('@app/lib/split-router', async (importOriginal) => ({
...(await importOriginal<typeof import('@app/lib/split-router')>()),
@@ -18,9 +14,6 @@ vi.mock('@app/lib/split-router', async (importOriginal) => ({
vi.mock('@app/features/next-soup/actions', () => ({
useBlockEntityCommands: vi.fn(),
}));
-vi.mock('@app/features/next-soup/utils', () => ({
- getChannelEntityTarget: mocks.getTarget,
-}));
vi.mock('@components/app/split-layout/layoutUtils', () => ({
useSplitPanelOrThrow: () => ({ splitHotkeyScope: 'test' }),
}));
@@ -54,47 +47,35 @@ const replyTarget = {
beforeEach(() => {
vi.clearAllMocks();
mocks.routeSearch.mockReturnValue({});
- mocks.getTarget.mockReturnValue(replyTarget);
});
afterEach(cleanup);
describe('Chat detail navigation', () => {
- it('requests a thread-scoped target for unstamped route and favorite selections', () => {
- render(() => <ChannelDetailView channel={channel} />);
-
- expect(mocks.getTarget).toHaveBeenCalledExactlyOnceWith(channel);
+ it('passes an explicit destination to the channel surface', () => {
+ render(() => <ChannelDetailView channel={channel} target={replyTarget} />);
expect(screen.getByTestId('target').textContent).toBe(
JSON.stringify(replyTarget)
);
});
- it('keeps the initial target when notification reads replace the channel', () => {
- const [selected, setSelected] = createSignal(channel);
- render(() => <ChannelDetailView channel={selected()} />);
-
- mocks.getTarget.mockReturnValue({ kind: 'latest' });
- setSelected({ ...channel, notifications: () => [] });
-
- expect(mocks.getTarget).toHaveBeenCalledOnce();
+ it('accepts the initial unread destination after the channel has mounted', () => {
+ const [target, setTarget] = createSignal<ChannelTargetRequest>();
+ render(() => <ChannelDetailView channel={channel} target={target()} />);
+ expect(screen.getByTestId('target').textContent).toBe('');
+ setTarget(replyTarget);
expect(screen.getByTestId('target').textContent).toBe(
JSON.stringify(replyTarget)
);
});
- it('resolves a new explicit target rather than retaining the initial unread target', () => {
+ it('does not derive navigation from notification changes', () => {
const [selected, setSelected] = createSignal(channel);
- render(() => <ChannelDetailView channel={selected()} />);
- const explicit = { messageId: 'search-hit', threadId: 'search-thread' };
- const target = { kind: 'message' as const, ...explicit };
- mocks.getTarget.mockReturnValue(target);
-
- setSelected({ ...channel, target: explicit });
-
- expect(mocks.getTarget).toHaveBeenLastCalledWith(
- expect.objectContaining({ target: explicit })
- );
+ render(() => (
+ <ChannelDetailView channel={selected()} target={replyTarget} />
+ ));
+ setSelected({ ...channel, notifications: () => [] });
expect(screen.getByTestId('target').textContent).toBe(
- JSON.stringify(target)
+ JSON.stringify(replyTarget)
);
});
@@ -105,16 +86,14 @@ describe('Chat detail navigation', () => {
return seek();
},
});
- render(() => <ChannelDetailView channel={channel} />);
+ render(() => <ChannelDetailView channel={channel} target={replyTarget} />);
expect(screen.getByTestId('target').dataset.request).toBe('first');
- mocks.getTarget.mockReturnValue({ kind: 'latest' });
setSeek('repeat');
expect(screen.getByTestId('target').dataset.request).toBe('repeat');
expect(screen.getByTestId('target').textContent).toBe(
JSON.stringify(replyTarget)
);
- expect(mocks.getTarget).toHaveBeenCalledOnce();
});
});
diff --git a/apps/web/src/features/channels-view/components/ChannelDetailView.tsx b/apps/web/src/features/channels-view/components/ChannelDetailView.tsx
index 30502a780c..abaff0c188 100644
--- a/apps/web/src/features/channels-view/components/ChannelDetailView.tsx
+++ b/apps/web/src/features/channels-view/components/ChannelDetailView.tsx
@@ -1,5 +1,4 @@
import { useBlockEntityCommands } from '@app/features/next-soup/actions';
-import { getChannelEntityTarget } from '@app/features/next-soup/utils';
import { createSearchParams } from '@app/lib/split-router';
import {
ChannelDetail,
@@ -8,17 +7,13 @@ import {
import type { ChannelTargetRequest } from '@channel/Channel/ChannelSurface';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import type { ChannelEntity } from '@entity';
-import { createMemo } from 'solid-js';
import { channelsSearch } from '../channels-route';
-/**
- * Rail-selection adapter for the shared ChannelDetail. Fresh metadata and
- * notifications reconcile into a replacement entity for the same selection;
- * only a channel switch or an explicit target change re-derives the target,
- * so notification reads never re-navigate an open conversation (PreviewPanel
- * applied the same rule via its stringified navigation key).
- */
-export function ChannelDetailView(props: { channel: ChannelEntity }) {
+/** Adapts a resolved conversation and navigation intent to the shared surface. */
+export function ChannelDetailView(props: {
+ channel: ChannelEntity;
+ target?: ChannelTargetRequest;
+}) {
const panel = useSplitPanelOrThrow();
const [search] = createSearchParams(channelsSearch);
useBlockEntityCommands({
@@ -27,28 +22,10 @@ export function ChannelDetailView(props: { channel: ChannelEntity }) {
resolveEntity: () => props.channel,
});
- let lastTargetKey: string | undefined;
- const target = createMemo<ChannelTargetRequest | undefined>((previous) => {
- const key = `${props.channel.id}:${props.channel.target?.messageId ?? ''}:${
- props.channel.target?.threadId ?? ''
- }`;
- if (lastTargetKey !== undefined && key === lastTargetKey) return previous;
- lastTargetKey = key;
- const clickTarget = getChannelEntityTarget(props.channel);
- if (!clickTarget) return undefined;
- return clickTarget.kind === 'latest'
- ? { kind: 'latest' }
- : {
- kind: 'message',
- messageId: clickTarget.messageId,
- threadId: clickTarget.threadId,
- };
- });
-
return (
<ChannelDetail
channelId={props.channel.id}
- target={target()}
+ target={props.target}
navigationRequest={search.seek}
fallbackName={props.channel.name}
autofocus={false}
diff --git a/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsx b/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsx
index ee7a333af8..a551374cba 100644
--- a/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsx
+++ b/apps/web/src/features/channels-view/components/ChannelsMobileView.test.tsx
@@ -149,7 +149,7 @@ afterEach(cleanup);
describe('mobile channel activation', () => {
it.each<ChannelsQueryScope>(['recents', 'channels', 'direct_messages'])(
- 'hydrates and includes unread reply targets when opening from %s',
+ 'hydrates and opens at latest with top-level read marking from %s',
async (tab) => {
let resolve!: (channel: WithNotification<ChannelEntity>) => void;
mocks.hydrate.mockReturnValueOnce(
@@ -180,7 +180,8 @@ describe('mobile channel activation', () => {
splitHandle: mocks.handle,
referredFrom: 'channels',
notificationSource: mocks.source,
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
})
);
}
diff --git a/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx b/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx
index d4bd48cd7c..f68cf6f8f8 100644
--- a/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx
+++ b/apps/web/src/features/channels-view/components/ChannelsMobileView.tsx
@@ -137,7 +137,8 @@ export function ChannelsMobileView(props: {
splitHandle: panel.handle,
referredFrom: 'channels',
notificationSource,
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
});
} catch (error) {
if (request !== opening) return;
diff --git a/apps/web/src/features/channels-view/components/rail/ChannelsRail.test.tsx b/apps/web/src/features/channels-view/components/rail/ChannelsRail.test.tsx
index b7af46eb19..86f7e94cd9 100644
--- a/apps/web/src/features/channels-view/components/rail/ChannelsRail.test.tsx
+++ b/apps/web/src/features/channels-view/components/rail/ChannelsRail.test.tsx
@@ -13,6 +13,8 @@ import type { ChannelsSources } from '../../queries';
import type { ChannelRailRow } from './ChannelsRailContext';
const mocks = vi.hoisted(() => ({
+ fetchChannel: vi.fn<(id: string) => Promise<ChannelEntity>>(),
+ favoriteId: undefined as string | undefined,
hydrate:
vi.fn<
(
@@ -40,13 +42,25 @@ vi.mock('@app/components/list', () => ({
}) => {
mocks.activate = (event) =>
options.onActivate({
- item: {
- kind: 'conversation',
- id: 'channel:one',
- scope: 'channels',
- localIndex: 0,
- channel: mocks.row!,
- },
+ item: mocks.favoriteId
+ ? {
+ kind: 'favorite',
+ id: `favorite:channel:${mocks.favoriteId}`,
+ group: 'favorites',
+ favorite: {
+ entityType: 'channel',
+ entityId: mocks.favoriteId,
+ createdAt: '2026-01-01',
+ sortOrder: 0,
+ },
+ }
+ : {
+ kind: 'conversation',
+ id: 'channel:one',
+ scope: 'channels',
+ localIndex: 0,
+ channel: mocks.row!,
+ },
metadata: { event },
});
return {};
@@ -59,7 +73,23 @@ vi.mock('@app/components/view-shell', () => ({
useViewTabHotkeys: vi.fn(),
}));
vi.mock('@app/features/next-soup/utils', () => ({
- channelPreviewSelection: (id: string) => ({ type: 'channel', id }),
+ channelPreviewSelection: (
+ id: string,
+ options?: {
+ target?: { kind: string; messageId?: string; threadId?: string };
+ }
+ ) => ({
+ type: 'channel',
+ id,
+ ...(options?.target?.kind === 'message'
+ ? {
+ target: {
+ messageId: options.target.messageId,
+ threadId: options.target.threadId,
+ },
+ }
+ : {}),
+ }),
getChannelEntityTarget: () => ({ kind: 'latest' }),
markChannelNotificationsSeenOnOpen: mocks.markRead,
navigateChannelEntityToTarget: mocks.navigate,
@@ -104,6 +134,9 @@ vi.mock('@notifications/notification-helpers', () => ({
vi.mock('@queries/channel/notification-selection', () => ({
hydrateChannelNotificationSelection: mocks.hydrate,
}));
+vi.mock('@queries/channel/selection-by-id', () => ({
+ fetchChannelSelectionById: mocks.fetchChannel,
+}));
vi.mock('@queries/channel-labels/channel-labels', () => ({
useChannelLabelsQuery: () => ({ isSuccess: false }),
useCreateChannelLabelMutation: () => ({}),
@@ -202,24 +235,157 @@ const mount = () =>
beforeEach(() => {
vi.clearAllMocks();
mocks.row = channel;
- mocks.selected = undefined;
+ mocks.favoriteId = undefined;
+ mocks.selected = { type: 'channel', id: channel.id };
mocks.select.mockReturnValue(true);
mocks.hydrate.mockReturnValue(hydrated);
});
afterEach(cleanup);
-describe('explicit channel activation', () => {
- it('navigates on repeated clicks without marking notifications in the rail', async () => {
+describe('explicit channel activation read marking', () => {
+ it('resolves an uncached favorite before opening a split with top-level read marking', async () => {
+ mocks.favoriteId = 'uncached';
+ let resolve!: (channel: ChannelEntity) => void;
+ mocks.fetchChannel.mockReturnValueOnce(
+ new Promise((done) => {
+ resolve = done;
+ })
+ );
+ mount();
+ fireEvent.click(screen.getByRole('button'), { shiftKey: true });
+ expect(mocks.fetchChannel).toHaveBeenCalledExactlyOnceWith('uncached');
+ expect(mocks.openSplit).not.toHaveBeenCalled();
+ const full = { ...hydrated, id: 'uncached' };
+ resolve(full);
+ await waitFor(() =>
+ expect(mocks.openSplit).toHaveBeenCalledExactlyOnceWith(full, {
+ openInNewSplit: true,
+ referredFrom: 'channels',
+ notificationSource: mocks.source,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
+ })
+ );
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ });
+
+ it('discards a pending favorite split when another uncached favorite is selected', async () => {
+ mocks.favoriteId = 'uncached';
+ let resolve!: (channel: ChannelEntity) => void;
+ mocks.fetchChannel.mockReturnValueOnce(
+ new Promise((done) => {
+ resolve = done;
+ })
+ );
+ mount();
+ fireEvent.click(screen.getByRole('button'), { shiftKey: true });
+ mocks.favoriteId = 'another';
+ fireEvent.click(screen.getByRole('button'));
+ expect(mocks.select).toHaveBeenCalledExactlyOnceWith({
+ type: 'channel',
+ id: 'another',
+ });
+ resolve({ ...hydrated, id: 'uncached' });
+ await Promise.resolve();
+ expect(mocks.openSplit).not.toHaveBeenCalled();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ });
+
+ it('does not open an unavailable uncached favorite or mark notifications read', async () => {
+ const log = vi.spyOn(console, 'error').mockImplementation(() => {});
+ try {
+ mocks.favoriteId = 'uncached';
+ mocks.fetchChannel.mockRejectedValueOnce(
+ new Error('Conversation is unavailable')
+ );
+ mount();
+ fireEvent.click(screen.getByRole('button'), { shiftKey: true });
+ await waitFor(() => expect(mocks.failure).toHaveBeenCalledOnce());
+ expect(mocks.openSplit).not.toHaveBeenCalled();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ } finally {
+ log.mockRestore();
+ }
+ });
+
+ it('selects a different channel immediately and leaves hydration to the destination', () => {
+ mocks.selected = { type: 'channel', id: 'previous' };
+ mount();
+ fireEvent.click(screen.getByRole('button'));
+ expect(mocks.select).toHaveBeenCalledExactlyOnceWith({
+ type: 'channel',
+ id: channel.id,
+ });
+ expect(mocks.hydrate).not.toHaveBeenCalled();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ });
+
+ it('does not fetch or mark notifications when a channel switch is rejected', () => {
+ mocks.selected = undefined;
+ mocks.select.mockReturnValue(false);
+ mount();
+ fireEvent.click(screen.getByRole('button'));
+ expect(mocks.hydrate).not.toHaveBeenCalled();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ });
+
+ it('preserves an explicit search target when selecting before hydration', () => {
+ mocks.selected = undefined;
+ mocks.row = {
+ ...channel,
+ target: { messageId: 'reply', threadId: 'thread' },
+ };
+ mount();
+ fireEvent.click(screen.getByRole('button'));
+ expect(mocks.select).toHaveBeenCalledExactlyOnceWith({
+ type: 'channel',
+ id: channel.id,
+ target: { messageId: 'reply', threadId: 'thread' },
+ });
+ expect(mocks.hydrate).not.toHaveBeenCalled();
+ });
+
+ it('discards a pending re-click when another channel is selected', async () => {
+ let resolve!: (channel: WithNotification<ChannelEntity>) => void;
+ mocks.hydrate.mockReturnValueOnce(
+ new Promise((done) => {
+ resolve = done;
+ })
+ );
+ mount();
+ fireEvent.click(screen.getByRole('button'));
+ mocks.row = { ...channel, id: 'two' };
+ fireEvent.click(screen.getByRole('button'));
+ expect(mocks.select).toHaveBeenCalledExactlyOnceWith({
+ type: 'channel',
+ id: 'two',
+ });
+ resolve(hydrated);
+ await Promise.resolve();
+ expect(mocks.select).toHaveBeenCalledOnce();
+ expect(mocks.markRead).not.toHaveBeenCalled();
+ });
+
+ it('marks the full channel on every accepted click, including the already-selected route', async () => {
mocks.selected = { type: 'channel', id: channel.id };
mount();
fireEvent.click(screen.getByRole('button'));
- await waitFor(() => expect(mocks.navigate).toHaveBeenCalledOnce());
+ await waitFor(() =>
+ expect(mocks.markRead).toHaveBeenCalledExactlyOnceWith(
+ hydrated,
+ mocks.source,
+ { channelReadScope: 'top-level' }
+ )
+ );
+ expect(mocks.navigate).toHaveBeenCalledOnce();
const refreshed = { ...hydrated, notifications: () => [] };
mocks.hydrate.mockReturnValue(refreshed);
fireEvent.click(screen.getByRole('button'));
- await waitFor(() => expect(mocks.navigate).toHaveBeenCalledTimes(2));
- expect(mocks.select).toHaveBeenCalledTimes(2);
- expect(mocks.markRead).not.toHaveBeenCalled();
+ await waitFor(() => expect(mocks.markRead).toHaveBeenCalledTimes(2));
+ expect(mocks.markRead).toHaveBeenLastCalledWith(refreshed, mocks.source, {
+ channelReadScope: 'top-level',
+ });
+ expect(mocks.navigate).toHaveBeenCalledTimes(2);
});
it('awaits native async hydration when telemetry replaces the global Promise constructor', async () => {
@@ -240,10 +406,11 @@ describe('explicit channel activation', () => {
expect(mocks.markRead).not.toHaveBeenCalled();
resolve(hydrated);
await waitFor(() =>
- expect(mocks.select).toHaveBeenCalledExactlyOnceWith({
- type: 'channel',
- id: channel.id,
- })
+ expect(mocks.markRead).toHaveBeenCalledExactlyOnceWith(
+ hydrated,
+ mocks.source,
+ { channelReadScope: 'top-level' }
+ )
);
} finally {
resolve(hydrated);
@@ -282,11 +449,15 @@ describe('explicit channel activation', () => {
await Promise.resolve();
expect(mocks.select).toHaveBeenCalledOnce();
expect(mocks.openSplit).not.toHaveBeenCalled();
- expect(mocks.markRead).not.toHaveBeenCalled();
+ expect(mocks.markRead).toHaveBeenCalledExactlyOnceWith(
+ hydrated,
+ mocks.source,
+ { channelReadScope: 'top-level' }
+ );
}
);
- it('hydrates shift-clicks and includes unread replies in split navigation targets', async () => {
+ it('hydrates shift-clicks and opens at latest with top-level read marking', async () => {
let resolve!: (channel: WithNotification<ChannelEntity>) => void;
mocks.hydrate.mockReturnValueOnce(
new Promise((done) => {
@@ -302,7 +473,8 @@ describe('explicit channel activation', () => {
openInNewSplit: true,
referredFrom: 'channels',
notificationSource: mocks.source,
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
})
);
expect(mocks.select).not.toHaveBeenCalled();
diff --git a/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsx b/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsx
index 13e2ae6825..e1f6e39c03 100644
--- a/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsx
+++ b/apps/web/src/features/channels-view/components/rail/ChannelsRail.tsx
@@ -12,6 +12,7 @@ import {
type ChannelPreviewSelection,
channelPreviewSelection,
getChannelEntityTarget,
+ markChannelNotificationsSeenOnOpen,
navigateChannelEntityToTarget,
openEntityInSplitFromUnifiedList,
} from '@app/features/next-soup/utils';
@@ -39,6 +40,7 @@ import {
import { notificationIsRead } from '@entity/utils/notification';
import { ensureNotificationSourceLoaded } from '@notifications/notification-helpers';
import { hydrateChannelNotificationSelection } from '@queries/channel/notification-selection';
+import { fetchChannelSelectionById } from '@queries/channel/selection-by-id';
import {
useChannelLabelsQuery,
useCreateChannelLabelMutation,
@@ -165,18 +167,25 @@ export function ChannelsRail(props: ChannelsRailProps) {
openInNewSplit: true,
referredFrom: 'channels',
notificationSource,
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
});
return;
}
const selection = channelPreviewSelection(channelId, {
target: getChannelEntityTarget(entity, {
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
}),
- notifications: entity.notifications,
});
const previous = selectedChannel();
if (!setSelectedChannel(selection)) return;
+ // The detail owns read marking on route opens. Re-clicks refresh and
+ // mark again even though the mounted route does not change.
+ if (previous?.id === selection.id && channel.isParticipant !== false) {
+ markChannelNotificationsSeenOnOpen(entity, notificationSource, {
+ channelReadScope: 'top-level',
+ });
+ }
// Repeated clicks must navigate even when the route stays the same.
if (
previous?.id === selection.id &&
@@ -218,6 +227,19 @@ export function ChannelsRail(props: ChannelsRailProps) {
reportActivationError(new Error('Missing channel id'));
return;
}
+ // A different channel owns its loading UI and notification hydration.
+ // Select it before fetching so the rail and destination respond to the
+ // click immediately. Re-clicks still refresh and re-aim the open channel.
+ if (!openInNewSplit && selectedChannel()?.id !== channelId) {
+ setSelectedChannel(
+ channelPreviewSelection(channelId, {
+ target: channel.target
+ ? { kind: 'message', ...channel.target }
+ : undefined,
+ })
+ );
+ return;
+ }
const selection = hydrateChannelNotificationSelection(
channel,
notificationSource.withLocalOverrides
@@ -442,12 +464,17 @@ export function ChannelsRail(props: ChannelsRailProps) {
? item.channel
: channelsById().get(channelId);
if (channel) activateChannel(channel, openInNewSplit);
- else if (openInNewSplit) {
- layout.openWithSplit(
- { type: 'channel', id: channelId },
- { preferNewSplit: true, referredFrom: 'channels' }
- );
- } else setSelectedChannel({ type: 'channel', id: channelId });
+ else {
+ const request = ++activation;
+ if (openInNewSplit) {
+ void selectHydratedChannel(
+ fetchChannelSelectionById(channelId),
+ request,
+ channelId,
+ true
+ );
+ } else setSelectedChannel({ type: 'channel', id: channelId });
+ }
},
})
);
diff --git a/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.test.ts b/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.test.ts
index c8a2b223d0..7d47364044 100644
--- a/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.test.ts
+++ b/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.test.ts
@@ -4,7 +4,7 @@ import { createRoot, createSignal } from 'solid-js';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
const source = vi.hoisted(() => ({
- notifications: vi.fn(() => []),
+ notifications: vi.fn<NotificationSource['notifications']>(() => []),
subscribe: vi.fn(() => () => {}),
withLocalState: vi.fn<NonNullable<NotificationSource['withLocalState']>>(),
}));
@@ -45,6 +45,34 @@ afterEach(() => {
});
describe('bounded channel unread indicators', () => {
+ it('ignores reply mentions while retaining older top-level mentions in legacy rows', () => {
+ const mention = (id: string, threadId?: string) =>
+ ({
+ id,
+ entity_type: 'channel',
+ entity_id: id,
+ state: 'unseen',
+ created_at: '2026-01-01',
+ notification_metadata: {
+ tag: 'channel_mention',
+ content: { messageId: 'message', threadId },
+ },
+ }) as ReturnType<NotificationSource['notifications']>[number];
+ source.notifications.mockReturnValue([
+ mention('reply', 'root'),
+ mention('root'),
+ ]);
+ const activity = createRoot((cleanup) => {
+ dispose = cleanup;
+ return useChannelRailActivity(
+ () => [row('reply', undefined), row('root', undefined)],
+ calls
+ );
+ });
+ expect([...activity.unreadChannelIds()]).toEqual(['root']);
+ expect(activity.unreadCount('channels')).toBe(1);
+ });
+
it.each(['seen', 'done'] as const)(
'clears dots, counts, and activity targets immediately on local %s, and restores them on rollback',
(state) => {
diff --git a/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.ts b/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.ts
index 57bf3d6b89..543b9c5a35 100644
--- a/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.ts
+++ b/apps/web/src/features/channels-view/components/rail/hooks/useChannelRailActivity.ts
@@ -2,6 +2,7 @@ import { useGlobalNotificationSource } from '@components/app/GlobalAppState';
import { compareDateDesc, type DateValue } from '@core/util/date';
import type { ChannelEntity } from '@entity';
import { notificationIsRead } from '@entity/utils/notification';
+import { isUnreadChannelMessageNotification } from '@notifications/top-level-channel-notification';
import { type Accessor, createEffect, createMemo, onCleanup } from 'solid-js';
import { createStore } from 'solid-js/store';
import type { ChannelsGroup } from '../../../types';
@@ -83,6 +84,7 @@ export function useChannelRailActivity(
(notification) =>
notification.entity_type === 'channel' &&
legacyChannelIds.has(notification.entity_id) &&
+ isUnreadChannelMessageNotification(notification) &&
!notificationIsRead(notification)
)
);
@@ -135,6 +137,7 @@ export function useChannelRailActivity(
notificationSource.subscribe((notification) => {
if (
notification.entity_type !== 'channel' ||
+ !isUnreadChannelMessageNotification(notification) ||
notificationIsRead(notification)
) {
return;
diff --git a/apps/web/src/features/channels-view/context/channel-detail-source.ts b/apps/web/src/features/channels-view/context/channel-detail-source.ts
new file mode 100644
index 0000000000..d9407aa598
--- /dev/null
+++ b/apps/web/src/features/channels-view/context/channel-detail-source.ts
@@ -0,0 +1,19 @@
+import type { ChannelEntity } from '@entity/types/entity';
+import type { Accessor } from 'solid-js';
+
+export type ChannelSelection = Pick<ChannelEntity, 'id' | 'target'>;
+
+export type ChannelDestination =
+ | { kind: 'latest' }
+ | { kind: 'message'; messageId: string; threadId?: string };
+
+export type ChannelDetailLoad =
+ | { status: 'pending' }
+ | { status: 'error'; error: Error }
+ | { status: 'ready'; channel: ChannelEntity | undefined };
+
+/** A ready result contains the complete notification source for this open. */
+export type ChannelDetailSource = {
+ load: Accessor<ChannelDetailLoad>;
+ refresh: () => Promise<void>;
+};
diff --git a/apps/web/src/features/channels-view/primitives/create-channel-detail.test.ts b/apps/web/src/features/channels-view/primitives/create-channel-detail.test.ts
new file mode 100644
index 0000000000..87a386527b
--- /dev/null
+++ b/apps/web/src/features/channels-view/primitives/create-channel-detail.test.ts
@@ -0,0 +1,197 @@
+import { ThrownResultError } from '@core/util/result';
+import type { ChannelEntity } from '@entity/types/entity';
+import { batch, createRoot, createSignal } from 'solid-js';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import type {
+ ChannelDetailLoad,
+ ChannelSelection,
+} from '../context/channel-detail-source';
+import { createChannelDetail } from './create-channel-detail';
+
+const channel = (id: string): ChannelEntity => ({
+ type: 'channel',
+ id,
+ name: id,
+ ownerId: 'viewer',
+ channelType: 'private',
+});
+const disposers: (() => void)[] = [];
+afterEach(() => disposers.splice(0).forEach((dispose) => dispose()));
+
+function setup() {
+ return createRoot((dispose) => {
+ disposers.push(dispose);
+ const [selection, setSelection] = createSignal<ChannelSelection>({
+ id: 'one',
+ });
+ const [cached, setCached] = createSignal<ChannelEntity | undefined>(
+ channel('one')
+ );
+ const [load, setLoad] = createSignal<ChannelDetailLoad>({
+ status: 'pending',
+ });
+ const markRead = vi.fn();
+ const detail = createChannelDetail({
+ selection,
+ cached,
+ source: { load, refresh: vi.fn(async () => {}) },
+ markRead,
+ });
+ return {
+ detail,
+ setSelection,
+ setCached,
+ setLoad,
+ markRead,
+ };
+ });
+}
+
+describe('channel opening', () => {
+ it('changes same-channel destinations without marking the channel read again', () => {
+ const { detail, setSelection, setLoad, markRead } = setup();
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(markRead).toHaveBeenCalledOnce();
+
+ for (const target of [
+ { messageId: 'explicit' },
+ { messageId: 'explicit', threadId: 'thread' },
+ { messageId: 'another', threadId: 'thread' },
+ ]) {
+ setSelection({ id: 'one', target });
+ expect(detail.target()).toEqual({ kind: 'message', ...target });
+ expect(markRead).toHaveBeenCalledOnce();
+ }
+ setSelection({ id: 'one' });
+ expect(markRead).toHaveBeenCalledOnce();
+
+ batch(() => {
+ setSelection({ id: 'two' });
+ setLoad({ status: 'ready', channel: channel('two') });
+ });
+ expect(markRead).toHaveBeenCalledTimes(2);
+ batch(() => {
+ setSelection({ id: 'one' });
+ setLoad({ status: 'ready', channel: channel('one') });
+ });
+ expect(markRead).toHaveBeenCalledTimes(3);
+ });
+
+ it('keeps latest navigation when an equivalent selection object replaces it', () => {
+ const { detail, setSelection, setLoad } = setup();
+ setSelection({ id: 'one' });
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ });
+
+ it('opens cached metadata at latest before notifications and marks read once', () => {
+ const { detail, setLoad, markRead } = setup();
+ expect(detail.view()).toEqual({ status: 'ready', channel: channel('one') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).not.toHaveBeenCalled();
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).toHaveBeenCalledOnce();
+ setLoad({ status: 'pending' });
+ expect(detail.view().status).toBe('ready');
+ setLoad({
+ status: 'ready',
+ channel: { ...channel('one'), notifications: () => [] },
+ });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).toHaveBeenCalledOnce();
+ });
+
+ it('uses explicit targets immediately, including a new target during refresh', () => {
+ const { detail, setSelection, setLoad } = setup();
+ setSelection({ id: 'one', target: { messageId: 'explicit' } });
+ expect(detail.target()).toEqual({ kind: 'message', messageId: 'explicit' });
+ setLoad({ status: 'ready', channel: channel('one') });
+ setLoad({ status: 'pending' });
+ setSelection({ id: 'one', target: { messageId: 'another' } });
+ expect(detail.target()).toEqual({ kind: 'message', messageId: 'another' });
+ });
+
+ it('stays at latest when notification hydration completes', () => {
+ const { detail, setLoad, markRead } = setup();
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).toHaveBeenCalledOnce();
+ });
+
+ it('keeps a transient fallback mounted through retry and does not jump on recovery', () => {
+ const { detail, setLoad, markRead } = setup();
+ setLoad({ status: 'error', error: new Error('Offline') });
+ expect(detail.view().status).toBe('ready');
+ expect(markRead).not.toHaveBeenCalled();
+ setLoad({ status: 'pending' });
+ expect(detail.view().status).toBe('ready');
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).toHaveBeenCalledOnce();
+ });
+
+ it('keeps denied content hidden through retry until a successful response', () => {
+ const { detail, setLoad, markRead } = setup();
+ setLoad({
+ status: 'error',
+ error: new ThrownResultError([
+ { code: 'FORBIDDEN', message: 'Forbidden' },
+ ]),
+ });
+ expect(detail.view().status).toBe('unavailable');
+ setLoad({ status: 'pending' });
+ expect(detail.view().status).toBe('unavailable');
+ expect(markRead).not.toHaveBeenCalled();
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(detail.view().status).toBe('ready');
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).toHaveBeenCalledOnce();
+ });
+
+ it('handles missing channels and failures without cached metadata', () => {
+ const { detail, setLoad, setCached, markRead } = setup();
+ setCached(undefined);
+ // Already visible metadata is retained while loading.
+ expect(detail.view().status).toBe('ready');
+ setLoad({ status: 'ready', channel: undefined });
+ expect(detail.view().status).toBe('unavailable');
+ setLoad({ status: 'pending' });
+ expect(detail.view().status).toBe('loading');
+ setLoad({ status: 'error', error: new Error('Offline') });
+ expect(detail.view().status).toBe('unavailable');
+ expect(markRead).not.toHaveBeenCalled();
+ });
+
+ it('ignores another channel’s result and resets navigation and marking on each open', () => {
+ const { detail, setSelection, setCached, setLoad, markRead } = setup();
+ batch(() => {
+ setSelection({ id: 'two' });
+ setCached(channel('two'));
+ });
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).not.toHaveBeenCalled();
+ setLoad({ status: 'ready', channel: channel('two') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).toHaveBeenCalledExactlyOnceWith(channel('two'));
+ batch(() => {
+ setSelection({ id: 'one' });
+ setCached(channel('one'));
+ setLoad({ status: 'pending' });
+ });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ setLoad({ status: 'ready', channel: channel('one') });
+ expect(detail.target()).toEqual({ kind: 'latest' });
+ expect(markRead).toHaveBeenCalledTimes(2);
+ });
+
+ it('does not mark non-participant channels read', () => {
+ const { setLoad, markRead } = setup();
+ setLoad({
+ status: 'ready',
+ channel: { ...channel('one'), isParticipant: false },
+ });
+ expect(markRead).not.toHaveBeenCalled();
+ });
+});
diff --git a/apps/web/src/features/channels-view/primitives/create-channel-detail.ts b/apps/web/src/features/channels-view/primitives/create-channel-detail.ts
new file mode 100644
index 0000000000..15fc696487
--- /dev/null
+++ b/apps/web/src/features/channels-view/primitives/create-channel-detail.ts
@@ -0,0 +1,90 @@
+import { isTransientRequestError } from '@core/util/request-error';
+import type { ChannelEntity } from '@entity/types/entity';
+import { type Accessor, createEffect, createMemo, on } from 'solid-js';
+import type {
+ ChannelDestination,
+ ChannelDetailSource,
+ ChannelSelection,
+} from '../context/channel-detail-source';
+
+type ChannelDetailViewState =
+ | { status: 'loading' }
+ | { status: 'unavailable'; channelId: string; denied: boolean }
+ | { status: 'ready'; channel: ChannelEntity };
+
+/** Display, initial navigation, and read marking have independent readiness. */
+export function createChannelDetail(options: {
+ selection: Accessor<ChannelSelection | undefined>;
+ cached: Accessor<ChannelEntity | undefined>;
+ source: ChannelDetailSource;
+ markRead: (channel: ChannelEntity) => void;
+}) {
+ // `on` tracks reads; it does not compare the values returned by its sources.
+ // Memoize the fields so replacing a selection object is not a new open/jump.
+ const channelId = createMemo(() => options.selection()?.id);
+ const activation = createMemo(on(channelId, () => ({})));
+ const complete = () => {
+ const load = options.source.load();
+ return load.status === 'ready' && load.channel?.id === channelId()
+ ? load.channel
+ : undefined;
+ };
+
+ const view = createMemo<ChannelDetailViewState>((previous) => {
+ const id = channelId();
+ if (!id) return { status: 'loading' };
+ const load = options.source.load();
+ if (load.status === 'error' && !isTransientRequestError(load.error))
+ return { status: 'unavailable', channelId: id, denied: true };
+ if (load.status === 'ready') {
+ const channel = complete();
+ return channel
+ ? { status: 'ready', channel }
+ : { status: 'unavailable', channelId: id, denied: false };
+ }
+ // Retrying an access failure cannot make previously denied data visible.
+ if (
+ previous?.status === 'unavailable' &&
+ previous.channelId === id &&
+ previous.denied
+ )
+ return previous;
+ const cached = options.cached();
+ const channel =
+ previous?.status === 'ready' && previous.channel.id === id
+ ? previous.channel
+ : cached?.id === id
+ ? cached
+ : undefined;
+ if (channel) return { status: 'ready', channel };
+ return load.status === 'error'
+ ? { status: 'unavailable', channelId: id, denied: false }
+ : { status: 'loading' };
+ });
+
+ // Conversation opens always start at latest; only explicit links pick a message.
+ const target = createMemo<ChannelDestination>(() => {
+ const explicit = options.selection()?.target;
+ return explicit ? { kind: 'message', ...explicit } : { kind: 'latest' };
+ });
+
+ let markedActivation: object | undefined;
+ createEffect(() => {
+ const current = activation();
+ const channel = complete();
+ if (
+ !channel ||
+ markedActivation === current ||
+ channel.isParticipant === false
+ )
+ return;
+ markedActivation = current;
+ options.markRead(channel);
+ });
+
+ return {
+ view,
+ target,
+ refresh: options.source.refresh,
+ };
+}
diff --git a/apps/web/src/features/channels-view/queries.ts b/apps/web/src/features/channels-view/queries.ts
index 6f671ab6ec..5e3af8e0a9 100644
--- a/apps/web/src/features/channels-view/queries.ts
+++ b/apps/web/src/features/channels-view/queries.ts
@@ -202,7 +202,7 @@ function useChannelsDataSource(
})
);
const items = createMemo<ChannelEntity[]>((previous) => {
- if (!query.isEnabled || query.isLoading) return previous;
+ if (!query.isEnabled || query.isPending) return previous;
const channels = filterChannelsForScope(
scope,
diff --git a/apps/web/src/features/channels-view/queries/channel-detail-source.test.ts b/apps/web/src/features/channels-view/queries/channel-detail-source.test.ts
new file mode 100644
index 0000000000..94dd1dd801
--- /dev/null
+++ b/apps/web/src/features/channels-view/queries/channel-detail-source.test.ts
@@ -0,0 +1,128 @@
+import type { ChannelEntity } from '@entity/types/entity';
+import type { WithNotification } from '@entity/types/notification';
+import { type Accessor, createRoot, createSignal } from 'solid-js';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import { createChannelDetailSource } from './channel-detail-source';
+
+const full: WithNotification<ChannelEntity> = {
+ id: 'one',
+ type: 'channel',
+ name: 'One',
+ ownerId: 'viewer',
+ channelType: 'private',
+ notifications: () => [],
+};
+const disposers: (() => void)[] = [];
+afterEach(() => disposers.splice(0).forEach((dispose) => dispose()));
+
+function setup(
+ cachedChannel: ChannelEntity | undefined = {
+ ...full,
+ unreadNotifications: [],
+ }
+) {
+ return createRoot((dispose) => {
+ disposers.push(dispose);
+ const [id, setId] = createSignal('one');
+ const [cached, setCached] = createSignal<ChannelEntity | undefined>(
+ cachedChannel
+ );
+ const [pending, setPending] = createSignal(false);
+ const [fetching, setFetching] = createSignal(false);
+ const [error, setError] = createSignal<Error | null>(null);
+ const [entities, setEntities] = createSignal<ChannelEntity[]>([full]);
+ const readData = vi.fn(() => {
+ if (pending()) throw new Error('Read a pending resource');
+ return { entities: entities() };
+ });
+ let enabled!: Accessor<boolean>;
+ const refresh = vi.fn(async () => {});
+ const source = createChannelDetailSource({
+ channelId: id,
+ cached,
+ createQuery: (_id, isEnabled) => {
+ enabled = isEnabled;
+ return {
+ get isEnabled() {
+ return enabled();
+ },
+ get isPending() {
+ return pending();
+ },
+ isLoading: false,
+ get isFetching() {
+ return fetching();
+ },
+ get error() {
+ return error();
+ },
+ get data() {
+ return readData();
+ },
+ refresh,
+ };
+ },
+ });
+ return {
+ source,
+ enabled,
+ setId,
+ setCached,
+ setPending,
+ setFetching,
+ setError,
+ setEntities,
+ readData,
+ refresh,
+ };
+ });
+}
+
+describe('channel detail source', () => {
+ it('reuses full cached notifications without touching the query data', () => {
+ const { source, enabled, readData } = setup(full);
+ expect(enabled()).toBe(false);
+ expect(source.load()).toEqual({ status: 'ready', channel: full });
+ expect(readData).not.toHaveBeenCalled();
+ });
+
+ it('refreshes an empty summary and keeps the decision stable as the list updates', () => {
+ const { source, enabled, setCached, setFetching } = setup();
+ expect(enabled()).toBe(true);
+ setFetching(true);
+ setCached(full);
+ expect(enabled()).toBe(true);
+ expect(source.load()).toEqual({ status: 'pending' });
+ setFetching(false);
+ expect(source.load()).toEqual({ status: 'ready', channel: full });
+ });
+
+ it('never reads a paused pending resource or a background refresh', () => {
+ const { source, setPending, setFetching, readData } = setup();
+ setPending(true);
+ expect(source.load()).toEqual({ status: 'pending' });
+ setPending(false);
+ setFetching(true);
+ expect(source.load()).toEqual({ status: 'pending' });
+ expect(readData).not.toHaveBeenCalled();
+ });
+
+ it('exposes failures and missing results without accepting another channel’s data', () => {
+ const { source, setError, setEntities, readData } = setup();
+ const error = new Error('Failed');
+ setError(error);
+ expect(source.load()).toEqual({ status: 'error', error });
+ expect(readData).not.toHaveBeenCalled();
+ setError(null);
+ setEntities([{ ...full, id: 'two' }]);
+ expect(source.load()).toEqual({ status: 'ready', channel: undefined });
+ });
+
+ it('fetches an uncached route and delegates retry to the query', async () => {
+ const { source, setCached, enabled, refresh } = setup();
+ setCached(undefined);
+ expect(enabled()).toBe(true);
+ await source.refresh();
+ expect(refresh).toHaveBeenCalledOnce();
+ });
+});
diff --git a/apps/web/src/features/channels-view/queries/channel-detail-source.ts b/apps/web/src/features/channels-view/queries/channel-detail-source.ts
new file mode 100644
index 0000000000..e62078defd
--- /dev/null
+++ b/apps/web/src/features/channels-view/queries/channel-detail-source.ts
@@ -0,0 +1,59 @@
+import type { ChannelEntity, EntityData } from '@entity/types/entity';
+import { type Accessor, createMemo, on } from 'solid-js';
+import type { ChannelDetailSource } from '../context/channel-detail-source';
+
+type ChannelDetailQuery = {
+ readonly isEnabled: boolean;
+ readonly isPending: boolean;
+ readonly isLoading: boolean;
+ readonly isFetching: boolean;
+ readonly error: Error | null;
+ readonly data: { entities: EntityData[] } | undefined;
+ refresh: () => Promise<void>;
+};
+
+export function createChannelDetailSource(options: {
+ channelId: Accessor<string | undefined>;
+ cached: Accessor<ChannelEntity | undefined>;
+ createQuery: (
+ channelId: Accessor<string | undefined>,
+ enabled: Accessor<boolean>
+ ) => ChannelDetailQuery;
+}): ChannelDetailSource {
+ // Decide once per open. Subsequent list updates must not restart hydration.
+ // A defined unreadNotifications field identifies the abbreviated list query,
+ // including []; legacy/full rows already have a notification source.
+ const refreshOnOpen = createMemo(
+ on(options.channelId, () => {
+ const cached = options.cached();
+ return !cached || cached.unreadNotifications !== undefined;
+ })
+ );
+ const query = options.createQuery(
+ options.channelId,
+ () =>
+ options.channelId() !== undefined &&
+ (refreshOnOpen() || !options.cached())
+ );
+
+ return {
+ load: () => {
+ const id = options.channelId();
+ if (!id) return { status: 'pending' };
+ if (query.isEnabled && query.error)
+ return { status: 'error', error: query.error };
+ if (!refreshOnOpen() && options.cached()) {
+ return { status: 'ready', channel: options.cached() };
+ }
+ if (!query.isEnabled) return { status: 'pending' };
+ if (query.isPending || query.isLoading || query.isFetching)
+ return { status: 'pending' };
+ const channel = query.data?.entities.find(
+ (entity): entity is ChannelEntity =>
+ entity.type === 'channel' && entity.id === id
+ );
+ return { status: 'ready', channel };
+ },
+ refresh: () => query.refresh(),
+ };
+}
diff --git a/apps/web/src/features/email-view/queries/use-email-query.test.ts b/apps/web/src/features/email-view/queries/use-email-query.test.ts
index e2e7f6f824..8b114dba2b 100644
--- a/apps/web/src/features/email-view/queries/use-email-query.test.ts
+++ b/apps/web/src/features/email-view/queries/use-email-query.test.ts
@@ -184,6 +184,9 @@ function mount(search = '') {
if (loading()) throw new Error('Read pending query data');
return { entities: entities(), groups: undefined };
},
+ get isPending() {
+ return loading();
+ },
get isLoading() {
return loading();
},
@@ -221,6 +224,9 @@ function mount(search = '') {
if (retentionLoading()) throw new Error('Read pending retained mail');
return { entities: retainedEntities(), groups: undefined };
},
+ get isPending() {
+ return retentionLoading();
+ },
get isLoading() {
return retentionLoading();
},
diff --git a/apps/web/src/features/home/queries/use-home-query.test.ts b/apps/web/src/features/home/queries/use-home-query.test.ts
index 86d36fadc1..9bec91f1fe 100644
--- a/apps/web/src/features/home/queries/use-home-query.test.ts
+++ b/apps/web/src/features/home/queries/use-home-query.test.ts
@@ -81,6 +81,9 @@ function makeQuery(initial: EntityData[], hasMore = true) {
soupPageTimestamp(entities(), 'touched_by_me'),
};
},
+ get isPending() {
+ return loading();
+ },
get isLoading() {
return loading();
},
diff --git a/apps/web/src/features/next-soup/utils.test.ts b/apps/web/src/features/next-soup/utils.test.ts
index dfe51eda27..6c5c9eac71 100644
--- a/apps/web/src/features/next-soup/utils.test.ts
+++ b/apps/web/src/features/next-soup/utils.test.ts
@@ -357,7 +357,7 @@ describe('channel unread clicks', () => {
created_at: '2026-09-23T12:00:00Z',
};
- it('targets the newest unread reply even when the rail has an empty cached witness', async () => {
+ it('opens at latest even with unread replies and an empty cached witness', async () => {
fetchChannelNotifications.mockResolvedValue([
older,
newer,
@@ -376,16 +376,15 @@ describe('channel unread clicks', () => {
unreadNotifications: [],
});
const selection = channelPreviewSelection(channel.id, {
- target: getChannelEntityTarget(channel, { scopeChannelThreads: false }),
+ target: getChannelEntityTarget(channel, {
+ channelNavigation: 'latest',
+ }),
});
- expect(selection.target).toEqual({
- messageId: 'newer',
- threadId: 'thread',
- });
+ expect(selection.target).toBeUndefined();
});
- it('honors local reads while refreshing a stale empty rail row on every click', async () => {
+ it('keeps opening at latest across local reads and new arrivals', async () => {
fetchChannelNotifications.mockResolvedValue([older, newer]);
const row = {
type: 'channel' as const,
@@ -400,13 +399,12 @@ describe('channel unread clicks', () => {
const channel = await hydrateChannelNotificationSelection(row, (n) =>
readIds.has(n.id) ? asRead(n) : n
);
- return getChannelEntityTarget(channel, { scopeChannelThreads: false });
+ return getChannelEntityTarget(channel, {
+ channelNavigation: 'latest',
+ });
};
- expect(await click()).toMatchObject({
- kind: 'message',
- messageId: 'older',
- });
+ expect(await click()).toEqual({ kind: 'latest' });
readIds.add(older.id);
expect(await click()).toEqual({ kind: 'latest' });
@@ -415,11 +413,7 @@ describe('channel unread clicks', () => {
newer,
replyNotification('incoming', 'new-arrival', 'thread'),
]);
- expect(await click()).toMatchObject({
- kind: 'message',
- messageId: 'new-arrival',
- threadId: 'thread',
- });
+ expect(await click()).toEqual({ kind: 'latest' });
expect(fetchChannelNotifications).toHaveBeenCalledTimes(3);
});
@@ -479,19 +473,20 @@ describe('channel unread clicks', () => {
notifications: () => [newer],
};
const selection = channelPreviewSelection('channel-1', {
- target: getChannelEntityTarget(entity, { scopeChannelThreads: false }),
+ target: getChannelEntityTarget(entity, {
+ channelNavigation: 'latest',
+ }),
notifications: entity.notifications,
});
expect(selection).toMatchObject({
type: 'channel',
id: 'channel-1',
- target: { messageId: 'newer', threadId: 'thread' },
});
expect(selection).not.toHaveProperty('kind');
- expect(selection.target).not.toHaveProperty('kind');
+ expect(selection.target).toBeUndefined();
});
- it('reads current unread state on every click without revisiting read targets', () => {
+ it('opens at latest regardless of current unread state', () => {
let notifications = [older, newer, { ...newer, id: 'mention' }];
const row: ChannelPreviewSelection = {
type: 'channel',
@@ -499,19 +494,11 @@ describe('channel unread clicks', () => {
notifications: () => notifications,
};
const click = () =>
- getChannelEntityTarget(row, { scopeChannelThreads: false });
- expect(click()).toEqual({
- kind: 'message',
- messageId: 'newer',
- threadId: 'thread',
- });
+ getChannelEntityTarget(row, { channelNavigation: 'latest' });
+ expect(click()).toEqual({ kind: 'latest' });
notifications = [older, asRead(newer), asRead({ ...newer, id: 'mention' })];
- expect(click()).toEqual({
- kind: 'message',
- messageId: 'older',
- threadId: undefined,
- });
+ expect(click()).toEqual({ kind: 'latest' });
notifications = notifications.map(asRead);
expect(click()).toEqual({ kind: 'latest' });
@@ -529,10 +516,10 @@ describe('channel unread clicks', () => {
},
},
} as UnifiedNotification);
- expect(click()).toMatchObject({ kind: 'message', messageId: 'incoming' });
+ expect(click()).toEqual({ kind: 'latest' });
});
- it('uses new arrivals immediately while older notifications remain unread', () => {
+ it('keeps opening at latest when new notifications arrive', () => {
let notifications = [older];
const row: ChannelPreviewSelection = {
type: 'channel',
@@ -540,12 +527,12 @@ describe('channel unread clicks', () => {
notifications: () => notifications,
};
expect(
- getChannelEntityTarget(row, { scopeChannelThreads: false })
- ).toMatchObject({ messageId: 'older' });
+ getChannelEntityTarget(row, { channelNavigation: 'latest' })
+ ).toEqual({ kind: 'latest' });
notifications = [older, newer];
expect(
- getChannelEntityTarget(row, { scopeChannelThreads: false })
- ).toMatchObject({ messageId: 'newer' });
+ getChannelEntityTarget(row, { channelNavigation: 'latest' })
+ ).toEqual({ kind: 'latest' });
});
it('preserves Home row targets, including an already-read thread reply', () => {
@@ -1038,7 +1025,7 @@ describe('getChannelEntityTarget', () => {
});
it.each(['channel_mention', 'channel_message_reply'] as const)(
- 'leaves thread %s unread when Chat opens the parent channel without reading the global feed',
+ 'leaves threaded %s unread when Chat opens without reading the global feed',
(tag) => {
const notification = {
...sendNotification('thread-notification', 'message'),
@@ -1055,14 +1042,15 @@ describe('getChannelEntityTarget', () => {
{
...notificationSourceWithBulkMarkAsRead(bulkMarkAsRead),
notificationsByEntity,
- }
+ },
+ { channelReadScope: 'top-level' }
);
expect(bulkMarkAsRead).not.toHaveBeenCalled();
expect(notificationsByEntity).not.toHaveBeenCalled();
}
);
- it('marks unstacked notifications on repeated Chat opens, skipping thread stacks and local reads', () => {
+ it('marks top-level notifications on repeated Chat opens, skipping replies and local reads', () => {
const send = sendNotification('send', 'top-level');
const root = sendNotification('root', 'root');
const reply = replyNotification('reply', 'reply-message', 'root');
@@ -1090,11 +1078,44 @@ describe('getChannelEntityTarget', () => {
withLocalOverrides: (notification) =>
readIds.has(notification.id) ? asRead(notification) : notification,
};
- const notifications = [send, root, reply, mention, read, done];
+ const reaction = {
+ ...sendNotification('reaction', 'root'),
+ notification_event_type: 'channel_message_reaction',
+ notification_metadata: {
+ tag: 'channel_message_reaction',
+ content: { messageId: 'root' },
+ },
+ } as UnifiedNotification;
+ const replyReaction = {
+ ...reaction,
+ id: 'reply-reaction',
+ notification_metadata: {
+ tag: 'channel_message_reaction',
+ content: { messageId: 'reply', threadId: 'root' },
+ },
+ } as UnifiedNotification;
+ const notifications = [
+ send,
+ root,
+ reply,
+ mention,
+ reaction,
+ replyReaction,
+ read,
+ done,
+ ];
const channel = channelRow({ notifications });
- const open = () => markChannelNotificationsSeenOnOpen(channel, source);
+ const open = () =>
+ markChannelNotificationsSeenOnOpen(channel, source, {
+ channelReadScope: 'top-level',
+ });
open();
- expect(bulkMarkAsRead).toHaveBeenCalledExactlyOnceWith([send]);
+ expect(bulkMarkAsRead).toHaveBeenCalledExactlyOnceWith([
+ send,
+ root,
+ mention,
+ reaction,
+ ]);
open();
expect(bulkMarkAsRead).toHaveBeenCalledTimes(1);
notifications.push(
@@ -1102,7 +1123,7 @@ describe('getChannelEntityTarget', () => {
);
open();
expect(bulkMarkAsRead).toHaveBeenCalledTimes(1);
- const incoming = sendNotification('incoming', 'new-message');
+ const incoming = sendNotification('incoming', 'new-root');
notifications.push(incoming);
open();
expect(bulkMarkAsRead).toHaveBeenCalledTimes(2);
@@ -1239,7 +1260,8 @@ describe('getChannelEntityTarget', () => {
openInNewSplit,
notificationSource:
notificationSourceWithBulkMarkAsRead(bulkMarkAsRead),
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
});
expect(openWithSplit).toHaveBeenCalledWith(
@@ -1260,14 +1282,17 @@ describe('getChannelEntityTarget', () => {
}
);
- it('marks only top-level routed channel notifications after the destination is applied', async () => {
- const unread = sendNotification('deferred-send', 'message');
- const reply = replyNotification('deferred', 'reply-message', 'root');
+ it('marks top-level notifications only once after deferred conversation navigation applies', async () => {
+ const root = sendNotification('root', 'root-message');
+ const reply = replyNotification('reply', 'reply-message', 'root-message');
const bulkMarkAsRead = vi.fn(async () => {});
let onApplied: (() => void) | undefined;
setGlobalSplitManager({
activeSplit: vi.fn(),
- getOrchestrator: vi.fn(() => ({})),
+ getOrchestrator: vi.fn(() => ({
+ getBlockHandle: vi.fn(async () => undefined),
+ })),
+ getSplitByContent: vi.fn(),
openWithSplit: (
...[_content, options]: Parameters<SplitManager['openWithSplit']>
) => {
@@ -1275,22 +1300,23 @@ describe('getChannelEntityTarget', () => {
return { status: 'navigating' };
},
} as unknown as SplitManager);
-
await openEntityInSplitFromUnifiedList(
- channelRow({ notifications: [unread, reply] }),
+ channelRow({ notifications: [root, reply] }),
{
notificationSource:
notificationSourceWithBulkMarkAsRead(bulkMarkAsRead),
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
}
);
expect(bulkMarkAsRead).not.toHaveBeenCalled();
expect(onApplied).toBeDefined();
onApplied!();
- expect(bulkMarkAsRead).toHaveBeenCalledExactlyOnceWith([unread]);
+ onApplied!();
+ expect(bulkMarkAsRead).toHaveBeenCalledExactlyOnceWith([root]);
});
- it('keeps the unread reply target without marking the thread read on a Chat open', async () => {
+ it('opens a conversation at latest without clearing unread replies', async () => {
const reply = replyNotification('reply-target', 'reply-message', 'root');
const openWithSplit = vi.fn(() => ({ status: 'opened' }));
setGlobalSplitManager({
@@ -1301,23 +1327,21 @@ describe('getChannelEntityTarget', () => {
getSplitByContent: vi.fn(),
openWithSplit,
} as unknown as SplitManager);
- const bulkMarkAsRead = vi.fn(async () => {
- reply.state = 'seen';
- });
+ const bulkMarkAsRead = vi.fn(async () => {});
await openEntityInSplitFromUnifiedList(
channelRow({ notifications: [reply] }),
{
notificationSource:
notificationSourceWithBulkMarkAsRead(bulkMarkAsRead),
- scopeChannelThreads: false,
+ channelNavigation: 'latest',
+ channelReadScope: 'top-level',
}
);
- expect(targetSearch(openWithSplit, 'channels')).toMatchObject({
- messageId: ['reply-message'],
- threadId: ['root'],
- });
+ expect(openWithSplit.mock.calls[0]).toEqual([
+ expect.anything(),
+ expect.objectContaining({ search: undefined, reopen: 'latest' }),
+ ]);
expect(bulkMarkAsRead).not.toHaveBeenCalled();
- expect(reply.state).toBe('unseen');
});
it('uses the global source for channels without an attached notification edge', () => {
@@ -1364,9 +1388,9 @@ describe('getChannelEntityTarget', () => {
expect(bulkMarkAsRead).not.toHaveBeenCalled();
});
- it.each([true, false])(
- 'keeps parent-channel reads thread-scoped regardless of target scope (%s)',
- async (scopeChannelThreads) => {
+ it.each(['latest', 'notification'] as const)(
+ 'keeps inbox-row reads thread-scoped regardless of navigation (%s)',
+ async (channelNavigation) => {
const parentNotification = {
...sendNotification('parent-send', 'message'),
created_at: '2026-09-23T12:00:00Z',
@@ -1389,7 +1413,8 @@ describe('getChannelEntityTarget', () => {
channelRow({ notifications: [parentNotification, threadNotification] }),
{
openInNewSplit: true,
- scopeChannelThreads,
+ channelNavigation,
+ channelReadScope: 'inbox-row',
notificationSource:
notificationSourceWithBulkMarkAsRead(bulkMarkAsRead),
}
@@ -1400,13 +1425,15 @@ describe('getChannelEntityTarget', () => {
expect.objectContaining({ preferNewSplit: true })
);
const search = targetSearch(openWithSplit, 'channels');
- expect(search).toMatchObject({
- messageId: [scopeChannelThreads ? 'message' : 'reply'],
- seek: [expect.any(String)],
- });
- expect(search?.threadId).toEqual(
- scopeChannelThreads ? undefined : ['thread-root']
- );
+ if (channelNavigation === 'latest') {
+ expect(search).toBeUndefined();
+ } else {
+ expect(search).toMatchObject({
+ messageId: ['message'],
+ seek: [expect.any(String)],
+ });
+ expect(search?.threadId).toBeUndefined();
+ }
expect(bulkMarkAsRead).toHaveBeenCalledExactlyOnceWith([
parentNotification,
]);
diff --git a/apps/web/src/features/next-soup/utils.ts b/apps/web/src/features/next-soup/utils.ts
index b74642e1ea..8c681b737a 100644
--- a/apps/web/src/features/next-soup/utils.ts
+++ b/apps/web/src/features/next-soup/utils.ts
@@ -51,7 +51,7 @@ import {
} from '@core/dom-selectors';
import { isTouchDevice } from '@core/mobile/isTouchDevice';
import type { BlockOrchestrator } from '@core/orchestrator';
-import { compareDateDesc, type DateValue } from '@core/util/date';
+import type { DateValue } from '@core/util/date';
import { throwOnErr } from '@core/util/result';
import { waitForFrames } from '@core/util/sleep';
import { openExternalUrl } from '@core/util/url';
@@ -91,6 +91,7 @@ import {
setDoneOverride,
type UnifiedNotification,
} from '@notifications';
+import { isTopLevelChannelNotification } from '@notifications/top-level-channel-notification';
import { hydrateChannelNotificationSelection } from '@queries/channel/notification-selection';
import { queryClient } from '@queries/client';
import {
@@ -379,8 +380,10 @@ interface OpenEntityOptions {
* opening a channel row. Callers that can open channels must provide it.
*/
notificationSource?: NotificationSource;
- /** False to target unread replies in Chat; read marking stays thread-scoped. */
- scopeChannelThreads?: boolean;
+ /** Default: notification. Explicit message targets always take precedence. */
+ channelNavigation?: 'latest' | 'notification';
+ /** Default: inbox-row. Top-level includes mentions and reactions outside threads. */
+ channelReadScope?: 'top-level' | 'inbox-row';
}
/**
@@ -473,7 +476,9 @@ export function channelIdForPreviewNavigation(
export function getChannelEntityTarget(
entity: EntityData | ChannelPreviewSelection,
- options: { scopeChannelThreads?: boolean } = {}
+ {
+ channelNavigation = 'notification',
+ }: { channelNavigation?: 'latest' | 'notification' } = {}
): ChannelClickTarget | undefined {
if (
entity.type !== 'channel' &&
@@ -500,15 +505,11 @@ export function getChannelEntityTarget(
threadId: entity.threadId,
};
- if (!isWithNotification(entity)) return fallback;
+ if (channelNavigation === 'latest' || !isWithNotification(entity))
+ return fallback;
const notifications = entity.notifications?.() ?? [];
- const scoped =
- options.scopeChannelThreads === false
- ? [...notifications].sort((a, b) =>
- compareDateDesc(a.created_at, b.created_at)
- )
- : scopeChannelNotificationsForEntity(entity, notifications);
+ const scoped = scopeChannelNotificationsForEntity(entity, notifications);
for (const notification of scoped) {
// For a whole-`channel` row, ignore notifications you have already read:
// the row stands for the entire channel, so once read it should open at
@@ -716,7 +717,7 @@ export const openEntityInSplitFromUnifiedList = async (
const content = getEntitySplitContent(entity);
const channelTarget = getChannelEntityTarget(entity, {
- scopeChannelThreads: options.scopeChannelThreads,
+ channelNavigation: options.channelNavigation,
});
const channelMessageTarget =
channelTarget?.kind === 'message' ? channelTarget : undefined;
@@ -760,14 +761,19 @@ export const openEntityInSplitFromUnifiedList = async (
splitContent = withListNavigationSource(splitContent, splitHandle);
}
+ let markedNotifications = false;
const markNotificationsSeen = () => {
+ if (markedNotifications) return;
+ markedNotifications = true;
if (options.notificationSource) {
- markChannelNotificationsSeenOnOpen(entity, options.notificationSource);
+ markChannelNotificationsSeenOnOpen(entity, options.notificationSource, {
+ channelReadScope: options.channelReadScope,
+ });
}
};
const result = splitManager.openWithSplit(splitContent, {
search: target ? searchLocationUpdates(content.id, target) : undefined,
- onApplied: target ? markNotificationsSeen : undefined,
+ onApplied: markNotificationsSeen,
referredFrom,
activate: true,
preferNewSplit: openInNewSplit,
@@ -806,11 +812,15 @@ export const openEntityInSplitFromUnifiedList = async (
* array (mobile Channels) or a list accessor. Only rows without an edge fall
* back to the separately paginated global source. Passing these notifications
* through the source keeps its REST cache and durable seen overrides in sync
- * while the configured mutation updates GraphQL edges.
+ * while the configured mutation updates GraphQL edges. Chat opens the whole
+ * conversation's top-level messages; Inbox opens only the row's stack.
*/
export function markChannelNotificationsSeenOnOpen(
entity: EntityWithRawNotifications<EntityData>,
- notificationSource: NotificationSource
+ notificationSource: NotificationSource,
+ {
+ channelReadScope = 'inbox-row',
+ }: { channelReadScope?: 'top-level' | 'inbox-row' } = {}
) {
if (
entity.type !== 'channel' &&
@@ -821,8 +831,13 @@ export function markChannelNotificationsSeenOnOpen(
}
const notifications = getEntityNotifications(entity, notificationSource, {
- scopeChannelThreads: true,
- }).filter((notification) => !notificationIsRead(notification));
+ scopeChannelThreads: channelReadScope === 'inbox-row',
+ }).filter(
+ (notification) =>
+ !notificationIsRead(notification) &&
+ (channelReadScope === 'inbox-row' ||
+ isTopLevelChannelNotification(notification))
+ );
if (notifications.length === 0) return;
void notificationSource.bulkMarkAsRead(notifications).catch((error) => {
diff --git a/apps/web/src/features/notifications/components/MarkMessageNotifications.tsx b/apps/web/src/features/notifications/components/MarkMessageNotifications.tsx
index 266a743352..da7b5beb10 100644
--- a/apps/web/src/features/notifications/components/MarkMessageNotifications.tsx
+++ b/apps/web/src/features/notifications/components/MarkMessageNotifications.tsx
@@ -3,7 +3,17 @@ import { useNotificationsForEntity } from '@notifications/notification-helpers';
import type { UnifiedNotification } from '@notifications/types';
import type { MessageParent } from '@service-storage/messages';
import type { JSXElement } from 'solid-js';
-import { createEffect, createSignal } from 'solid-js';
+import {
+ type Accessor,
+ createContext,
+ createEffect,
+ createSignal,
+ useContext,
+} from 'solid-js';
+
+/** A channel can supply its complete edge without activating the global feed. */
+export const MessageNotificationSourceContext =
+ createContext<Accessor<UnifiedNotification[]>>();
const MAX_MARK_ATTEMPTS = 3;
@@ -17,10 +27,10 @@ export function MarkMessageNotifications(props: {
// matches metadata.messageId only; the current CHANNEL_MESSAGE entity scope
// is thread-aware, so targeting a root also includes reply notifications.
const notificationSource = useGlobalNotificationSource();
- const notifications = useNotificationsForEntity(
- notificationSource,
- props.parent
- );
+ const scopedNotifications = useContext(MessageNotificationSourceContext);
+ const notifications =
+ scopedNotifications ??
+ useNotificationsForEntity(notificationSource, props.parent);
const isMessageNotification = (n: UnifiedNotification) => {
const content = n.notification_metadata.content;
return (
@@ -36,19 +46,27 @@ export function MarkMessageNotifications(props: {
//
// Not a one-shot latch: a stale refetch can land after the optimistic write
// and flip notifications back to unviewed while this row stays mounted, so
- // re-mark whenever the cache regresses, bounded per mount. inFlight is a
- // signal so a regression that lands mid-mark re-runs the effect on settle.
+ // re-mark whenever the cache regresses, bounded per notification batch.
+ // New notifications get a fresh budget. inFlight is a signal so a regression
+ // that lands mid-mark re-runs the effect on settle.
const [inFlight, setInFlight] = createSignal(false);
let attempts = 0;
+ let attemptedIds = '';
createEffect(() => {
const unread = notifications().filter(
(notification) =>
isMessageNotification(notification) && notification.state === 'unseen'
);
- if (unread.length === 0 || inFlight() || attempts >= MAX_MARK_ATTEMPTS) {
- return;
+ if (unread.length === 0 || inFlight()) return;
+ const ids = JSON.stringify(
+ unread.map((notification) => notification.id).sort()
+ );
+ if (ids !== attemptedIds) {
+ attemptedIds = ids;
+ attempts = 0;
}
+ if (attempts >= MAX_MARK_ATTEMPTS) return;
attempts += 1;
setInFlight(true);
void notificationSource
@@ -61,5 +79,5 @@ export function MarkMessageNotifications(props: {
});
});
- return <>{props.children}</>;
+ return props.children;
}
diff --git a/apps/web/src/features/notifications/tests/mark-message-notifications.test.tsx b/apps/web/src/features/notifications/tests/mark-message-notifications.test.tsx
index a51ee6d6c0..828947c278 100644
--- a/apps/web/src/features/notifications/tests/mark-message-notifications.test.tsx
+++ b/apps/web/src/features/notifications/tests/mark-message-notifications.test.tsx
@@ -1,8 +1,12 @@
import type { NotificationSource } from '@notifications/notification-source';
import type { UnifiedNotification } from '@notifications/types';
import { render, waitFor } from '@solidjs/testing-library';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
-import { MarkMessageNotifications } from '../components/MarkMessageNotifications';
+import { createSignal } from 'solid-js';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import {
+ MarkMessageNotifications,
+ MessageNotificationSourceContext,
+} from '../components/MarkMessageNotifications';
const mocks = vi.hoisted(() => ({
notificationSource: undefined as NotificationSource | undefined,
@@ -79,27 +83,82 @@ describe('MarkMessageNotifications', () => {
expect(bulkMarkAsRead).toHaveBeenCalledWith(matchingNotifications);
});
- it('handles mark failures while preserving bounded retries', async () => {
+ afterEach(() => vi.unstubAllGlobals());
+
+ it('marks scoped notifications on mount and live updates without reading the global feed', async () => {
+ const observer = vi.fn();
+ vi.stubGlobal('IntersectionObserver', observer);
+ const globalRead = vi.spyOn(
+ mocks.notificationSource!,
+ 'notificationsByEntity'
+ );
+ const [notifications, setNotifications] = createSignal(
+ matchingNotifications
+ );
+ const view = render(() => (
+ <MessageNotificationSourceContext.Provider value={notifications}>
+ <MarkMessageNotifications
+ messageId="message-1"
+ parent={{ type: 'channel', id: 'channel-1' }}
+ >
+ <span>Message</span>
+ </MarkMessageNotifications>
+ </MessageNotificationSourceContext.Provider>
+ ));
+ expect(globalRead).not.toHaveBeenCalled();
+ await waitFor(() => expect(bulkMarkAsRead).toHaveBeenCalledOnce());
+ expect(bulkMarkAsRead).toHaveBeenCalledWith(matchingNotifications);
+ for (let i = 0; i < 4; i++) {
+ const liveNotifications = [documentMentionNotification(`live-${i}`)];
+ setNotifications(liveNotifications);
+ await waitFor(() => expect(bulkMarkAsRead).toHaveBeenCalledTimes(i + 2));
+ expect(bulkMarkAsRead).toHaveBeenLastCalledWith(liveNotifications);
+ }
+ expect(globalRead).not.toHaveBeenCalled();
+ expect(observer).not.toHaveBeenCalled();
+ expect(view.container.firstElementChild?.tagName).toBe('SPAN');
+ });
+
+ it('bounds retries for the same notifications and retries a new batch after exhaustion', async () => {
const error = new Error('mark failed');
bulkMarkAsRead.mockRejectedValue(error);
const consoleError = vi
.spyOn(console, 'error')
.mockImplementation(() => {});
+ const [notifications, setNotifications] = createSignal(
+ matchingNotifications
+ );
try {
render(() => (
- <MarkMessageNotifications
- messageId="message-1"
- parent={{ type: 'channel', id: 'channel-1' }}
- >
- <span>Message</span>
- </MarkMessageNotifications>
+ <MessageNotificationSourceContext.Provider value={notifications}>
+ <MarkMessageNotifications
+ messageId="message-1"
+ parent={{ type: 'channel', id: 'channel-1' }}
+ >
+ <span>Message</span>
+ </MarkMessageNotifications>
+ </MessageNotificationSourceContext.Provider>
));
await waitFor(() => {
expect(bulkMarkAsRead).toHaveBeenCalledTimes(3);
expect(consoleError).toHaveBeenCalledTimes(3);
});
+ // A refetch or a different ordering must not restart the failed batch.
+ setNotifications(
+ [...matchingNotifications].reverse().map((n) => ({ ...n }))
+ );
+ await new Promise((resolve) => setTimeout(resolve, 0));
+ expect(bulkMarkAsRead).toHaveBeenCalledTimes(3);
+
+ const incoming = [documentMentionNotification('new-after-failure')];
+ bulkMarkAsRead.mockImplementation(async (notifications) => {
+ for (const notification of notifications) notification.state = 'seen';
+ });
+ setNotifications(incoming);
+ await waitFor(() => expect(bulkMarkAsRead).toHaveBeenCalledTimes(4));
+ expect(bulkMarkAsRead).toHaveBeenLastCalledWith(incoming);
} finally {
consoleError.mockRestore();
}
diff --git a/apps/web/src/features/notifications/top-level-channel-notification.test.ts b/apps/web/src/features/notifications/top-level-channel-notification.test.ts
new file mode 100644
index 0000000000..da2d5bf4c5
--- /dev/null
+++ b/apps/web/src/features/notifications/top-level-channel-notification.test.ts
@@ -0,0 +1,35 @@
+import { describe, expect, it } from 'vitest';
+import {
+ isTopLevelChannelNotification,
+ isUnreadChannelMessageNotification,
+} from './top-level-channel-notification';
+import type { UnifiedNotification } from './types';
+
+describe('top-level channel notifications', () => {
+ it.each([
+ ['channel_message_send', undefined, true],
+ ['channel_mention', undefined, true],
+ ['channel_mention', 'root', false],
+ ['channel_message_reaction', undefined, true],
+ ['channel_message_reaction', 'root', false],
+ ['document_mention', undefined, true],
+ ['document_mention', 'root', false],
+ ['channel_message_reply', 'root', false],
+ ['channel_invite', undefined, false],
+ ['call_started', undefined, false],
+ ] as const)(
+ 'classifies %s with thread %s as %s',
+ (tag, threadId, expected) => {
+ const notification_metadata = {
+ tag,
+ content: { messageId: 'message', threadId },
+ } as UnifiedNotification['notification_metadata'];
+ expect(isTopLevelChannelNotification({ notification_metadata })).toBe(
+ expected
+ );
+ expect(
+ isUnreadChannelMessageNotification({ notification_metadata })
+ ).toBe(expected && tag !== 'channel_message_reaction');
+ }
+ );
+});
diff --git a/apps/web/src/features/notifications/top-level-channel-notification.ts b/apps/web/src/features/notifications/top-level-channel-notification.ts
new file mode 100644
index 0000000000..65e414def4
--- /dev/null
+++ b/apps/web/src/features/notifications/top-level-channel-notification.ts
@@ -0,0 +1,27 @@
+import { match } from 'ts-pattern';
+import type { UnifiedNotification } from './types';
+
+/** Notifications on messages outside threads, eligible for channel-view read marking. */
+export function isTopLevelChannelNotification(
+ notification: Pick<UnifiedNotification, 'notification_metadata'>
+): boolean {
+ return match(notification.notification_metadata)
+ .with({ tag: 'channel_message_send' }, () => true)
+ .with(
+ { tag: 'channel_mention' },
+ { tag: 'channel_message_reaction' },
+ { tag: 'document_mention' },
+ ({ content }) => content.threadId == null
+ )
+ .otherwise(() => false);
+}
+
+/** Reactions never contribute to the channel-view unread badge. */
+export function isUnreadChannelMessageNotification(
+ notification: Pick<UnifiedNotification, 'notification_metadata'>
+): boolean {
+ return (
+ notification.notification_metadata.tag !== 'channel_message_reaction' &&
+ isTopLevelChannelNotification(notification)
+ );
+}
diff --git a/apps/web/src/features/reviews-view/queries/use-reviews-query.test.ts b/apps/web/src/features/reviews-view/queries/use-reviews-query.test.ts
index b26153a007..128ed0f8e8 100644
--- a/apps/web/src/features/reviews-view/queries/use-reviews-query.test.ts
+++ b/apps/web/src/features/reviews-view/queries/use-reviews-query.test.ts
@@ -108,6 +108,7 @@ describe('Reviews notifications', () => {
vi.mocked(useSoupAstItemsQuery).mockReturnValue({
data: { entities: [review], groups: undefined },
error: null,
+ isPending: false,
isLoading: false,
isFetching: false,
isPlaceholderData: false,
diff --git a/apps/web/src/lib/core/util/request-error.test.ts b/apps/web/src/lib/core/util/request-error.test.ts
new file mode 100644
index 0000000000..12782233a9
--- /dev/null
+++ b/apps/web/src/lib/core/util/request-error.test.ts
@@ -0,0 +1,63 @@
+import { CombinedError } from '@urql/core';
+import { describe, expect, it } from 'vitest';
+import { isTransientRequestError } from './request-error';
+import { ThrownResultError } from './result';
+
+describe('isTransientRequestError', () => {
+ it.each([null, undefined])('does not classify %s as a failure', (error) => {
+ expect(isTransientRequestError(error)).toBe(false);
+ });
+
+ it('treats an untyped request failure as transient', () => {
+ expect(isTransientRequestError(new Error('Failed to fetch'))).toBe(true);
+ });
+
+ it.each([
+ { codes: ['NETWORK_ERROR'], expected: true },
+ { codes: ['SERVER_ERROR'], expected: true },
+ { codes: ['NETWORK_ERROR', 'SERVER_ERROR'], expected: true },
+ { codes: ['NETWORK_ERROR', 'FORBIDDEN'], expected: false },
+ { codes: ['UNAUTHORIZED'], expected: false },
+ { codes: ['NOT_FOUND'], expected: false },
+ { codes: ['UNKNOWN'], expected: false },
+ { codes: [], expected: false },
+ ])('classifies REST errors $codes', ({ codes, expected }) => {
+ const error = new ThrownResultError(
+ codes.map((code) => ({ code, message: 'Request failed' }))
+ );
+ expect(isTransientRequestError(error)).toBe(expected);
+ });
+
+ it.each([
+ { status: undefined, expected: true },
+ { status: 401, expected: false },
+ { status: 403, expected: false },
+ { status: 503, expected: true },
+ ])('classifies GraphQL transport status $status', ({ status, expected }) => {
+ const error = new CombinedError({
+ networkError: new Error('Request failed'),
+ response:
+ status === undefined ? undefined : new Response(null, { status }),
+ });
+ expect(isTransientRequestError(error)).toBe(expected);
+ });
+
+ it('requires a transport failure for GraphQL HTTP errors', () => {
+ expect(
+ isTransientRequestError(
+ new CombinedError({ response: new Response(null, { status: 503 }) })
+ )
+ ).toBe(false);
+ });
+
+ it('leaves explicit application retry permissions to the caller', () => {
+ const error = new CombinedError({
+ networkError: new Error('Request failed'),
+ graphQLErrors: [
+ { message: 'Read failed', extensions: { retryable: true } },
+ ],
+ response: new Response(null, { status: 503 }),
+ });
+ expect(isTransientRequestError(error)).toBe(false);
+ });
+});
diff --git a/apps/web/src/lib/core/util/request-error.ts b/apps/web/src/lib/core/util/request-error.ts
new file mode 100644
index 0000000000..a5e59913aa
--- /dev/null
+++ b/apps/web/src/lib/core/util/request-error.ts
@@ -0,0 +1,30 @@
+import { CombinedError } from '@urql/core';
+import { ThrownResultError } from './result';
+
+/**
+ * Classifies transport/server failures shared by cached reads and retries.
+ * Structured application errors take precedence; untyped errors are treated as
+ * transient. Callers still own cache availability and explicit retry policies.
+ */
+export function isTransientRequestError(
+ error: Error | null | undefined
+): boolean {
+ if (!error) return false;
+ if (error instanceof CombinedError) {
+ const status = error.response?.status;
+ return (
+ error.graphQLErrors.length === 0 &&
+ error.networkError != null &&
+ (status == null || status >= 500)
+ );
+ }
+ if (error instanceof ThrownResultError) {
+ return (
+ error.errors.length > 0 &&
+ error.errors.every(
+ ({ code }) => code === 'NETWORK_ERROR' || code === 'SERVER_ERROR'
+ )
+ );
+ }
+ return true;
+}
diff --git a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts
index 19a164f103..17c65a4955 100644
--- a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts
+++ b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.test.ts
@@ -684,6 +684,10 @@ describe('normalizedCacheExchange', () => {
expect(host.writes[0]?.data).toBe(data);
expect(results).toHaveLength(1);
expect(results[0]?.data).toBe(data);
+ expect(normalizedCacheResultMetadata(results[0]!)).toEqual({
+ source: 'live-network',
+ cacheEffectsApplied: true,
+ });
});
it('deletes the exact normalized key from subscription patches', async () => {
@@ -929,6 +933,10 @@ describe('normalizedCacheExchange', () => {
expect(host.invalidations).toEqual([['GraphqlSoupDocument:document-2']]);
expect(results).toHaveLength(1);
expect(results[0]?.data).toBe(data);
+ expect(normalizedCacheResultMetadata(results[0]!)).toEqual({
+ source: 'live-network',
+ cacheEffectsApplied: false,
+ });
});
it('cache-first miss forwards to network and writes through', async () => {
@@ -3332,6 +3340,64 @@ describe('normalizedCacheExchange', () => {
});
});
+ it.each([true, false])(
+ 'delegates persisted commit revalidations only when an owner accepts: %s',
+ async (handled) => {
+ const commit = host.commitOptimisticWrite.bind(host);
+ host.commitOptimisticWrite = async (transactionId, claim, args) => ({
+ ...(await commit(transactionId, claim, args)),
+ revalidations: [
+ {
+ query: stringifyDocument(QUERY),
+ operationName: 'Soup',
+ variablesJson: '{"input":{"limit":2}}',
+ },
+ ],
+ });
+ const delegateRevalidation = vi.fn(() => handled);
+ const { ops, client, results } = harness(host, undefined, {
+ delegateRevalidation,
+ });
+ ops.next(makeMutationOp(1, optimistic));
+ await tick();
+ expect(delegateRevalidation).toHaveBeenCalledWith(client, {
+ document: expect.any(Object),
+ variables: { input: { limit: 2 } },
+ });
+ expect(vi.mocked(client.query)).toHaveBeenCalledTimes(handled ? 0 : 1);
+ expect(results[0]?.error).toBeUndefined();
+ expect(host.commits).toHaveLength(1);
+ }
+ );
+
+ it('preserves a committed mutation when delegated reconciliation fails', async () => {
+ const commit = host.commitOptimisticWrite.bind(host);
+ host.commitOptimisticWrite = async (transactionId, claim, args) => ({
+ ...(await commit(transactionId, claim, args)),
+ revalidations: [
+ {
+ query: stringifyDocument(QUERY),
+ operationName: 'Soup',
+ variablesJson: '{}',
+ },
+ ],
+ });
+ const error = new Error('refresh owner unavailable');
+ const onCacheError = vi.fn();
+ const { ops, results } = harness(host, undefined, {
+ delegateRevalidation: () => {
+ throw error;
+ },
+ onCacheError,
+ });
+ ops.next(makeMutationOp(1, optimistic));
+ await tick();
+ expect(onCacheError).toHaveBeenCalledWith(error, expect.any(Object));
+ expect(results[0]?.error).toBeUndefined();
+ expect(host.commits).toHaveLength(1);
+ expect(host.rollbacks).toHaveLength(0);
+ });
+
it('rolls back on a GraphQL error result', async () => {
const error = new CombinedError({ graphQLErrors: ['nope'] });
const { ops, results } = harness(host, (op) =>
diff --git a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts
index e4cde91d4f..242f06b850 100644
--- a/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts
+++ b/apps/web/src/lib/graphql-cache/exchange/normalized-cache-exchange.ts
@@ -35,6 +35,7 @@
*/
import {
+ type Client,
CombinedError,
type Exchange,
makeOperation,
@@ -78,6 +79,7 @@ import {
compileEntityResolvers,
type EntityResolverConfig,
} from './entity-resolvers';
+import type { QueryRevalidation } from './optimistic';
import {
normalizedEntityKey,
notifyOptimisticMutationEnqueued,
@@ -111,6 +113,8 @@ const NORMALIZED_CACHE_RESULT_METADATA_KEY = '__macroNormalizedCache';
export type NormalizedCacheResultMetadata =
| {
source: 'live-network';
+ /** Subscription effects finished successfully in this cache generation. */
+ cacheEffectsApplied?: boolean;
revision?: CacheRevision;
/** Local-only acknowledgement; never rejects or republishes response data. */
persistence?: Promise<CacheRevision | undefined>;
@@ -129,12 +133,16 @@ export function normalizedCacheResultMetadata(
return { source };
}
if (source !== 'live-network') return;
- const { revision, persistence } = metadata as {
+ const { revision, persistence, cacheEffectsApplied } = metadata as {
+ cacheEffectsApplied?: unknown;
revision?: unknown;
persistence?: unknown;
};
return {
source,
+ ...(typeof cacheEffectsApplied === 'boolean'
+ ? { cacheEffectsApplied }
+ : {}),
...(isCacheRevision(revision) ? { revision } : {}),
...(persistence instanceof Promise
? { persistence: persistence as Promise<CacheRevision | undefined> }
@@ -419,6 +427,9 @@ function queuedMutationResult(
}
export interface NormalizedCacheExchangeOptions {
+ /** Return true to transfer a committed query refresh to an active reader's queue.
+ * Persisted descriptors without an owner retain the normal network fallback. */
+ delegateRevalidation?: (client: Client, query: QueryRevalidation) => boolean;
/** Schema-typed singular entity relations derived from field arguments. */
entityResolvers?: EntityResolverConfig;
/** Called when cache work fails; the operation may degrade or emit uncertainty. */
@@ -767,7 +778,7 @@ export function normalizedCacheExchange(
resolveRoute: (result: OperationResult | undefined) => void;
}
>();
- const subscriptionEffectChains = new Map<number, Promise<void>>();
+ const subscriptionEffectChains = new Map<number, Promise<boolean>>();
// Teardown invalidates queued effects, including when the same operation
// is immediately resubscribed after a back/forward-cache restore.
const subscriptionGenerations = new Map<number, object>();
@@ -950,12 +961,21 @@ export function normalizedCacheExchange(
) {
throw new Error('cache revalidation variables are not an object');
}
+ const document = replayDocument(
+ revalidation.query,
+ revalidation.operationName
+ );
+ if (
+ options.delegateRevalidation?.(client, {
+ document,
+ variables: variables as Record<string, unknown>,
+ })
+ )
+ continue;
void client
- .query(
- replayDocument(revalidation.query, revalidation.operationName),
- variables as Record<string, unknown>,
- { requestPolicy: 'network-only' }
- )
+ .query(document, variables as Record<string, unknown>, {
+ requestPolicy: 'network-only',
+ })
.toPromise()
.then((result) => {
if (result.error) throw result.error;
@@ -1181,9 +1201,10 @@ export function normalizedCacheExchange(
op: Operation,
effects: CacheEffect[],
isCurrent: () => boolean = () => true
- ): Promise<void> {
+ ): Promise<boolean> {
+ let applied = true;
for (const effect of effects) {
- if (!isCurrent()) return;
+ if (!isCurrent()) return false;
try {
if (effect.kind === 'write') {
await host.writeQuery({
@@ -1196,11 +1217,13 @@ export function normalizedCacheExchange(
await host.deleteRecords([effect.key]);
}
} catch (error) {
+ applied = false;
// One failed cache effect must neither skip later effects nor
// prevent delivery of the original operation result.
options.onCacheError?.(error, op);
}
}
+ return applied && isCurrent();
}
// Persistence is still ordered/durable, but foreground query consumers do
@@ -1303,7 +1326,7 @@ export function normalizedCacheExchange(
// overtake a later delete. Subscribers still receive each original
// result after its effects settle.
const previousEffects =
- subscriptionEffectChains.get(op.key) ?? Promise.resolve();
+ subscriptionEffectChains.get(op.key) ?? Promise.resolve(true);
const generation = subscriptionGenerations.get(op.key);
const effects = previousEffects.then(() =>
applyOperationCacheEffects(
@@ -1316,7 +1339,11 @@ export function normalizedCacheExchange(
);
subscriptionEffectChains.set(op.key, effects);
try {
- await effects;
+ const cacheEffectsApplied = await effects;
+ return withResultMetadata(result, {
+ source: 'live-network',
+ cacheEffectsApplied,
+ });
} finally {
if (subscriptionEffectChains.get(op.key) === effects) {
subscriptionEffectChains.delete(op.key);
diff --git a/apps/web/src/lib/queries/channel/notification-refresh.test.ts b/apps/web/src/lib/queries/channel/notification-refresh.test.ts
new file mode 100644
index 0000000000..f4fc5d2ce4
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/notification-refresh.test.ts
@@ -0,0 +1,413 @@
+import type { QueryRevalidation } from '@graphql-cache/exchange/optimistic';
+import type { GraphqlNotificationPatch } from '@service-storage/graphql-soup-websocket';
+import { type Client, CombinedError, gql } from '@urql/core';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import {
+ type ChannelNotificationReader,
+ channelNotificationRefresh,
+ delegateChannelNotificationRefresh,
+ disposeChannelNotificationRefresh,
+} from './notification-refresh';
+
+const document = gql`query Notifications($id: String!) { channel(id: $id) { id } }`;
+const descriptor = (id = 'a'): QueryRevalidation => ({
+ document,
+ variables: { id },
+});
+const cleanups: (() => void)[] = [];
+beforeEach(() => {
+ vi.useFakeTimers();
+ vi.spyOn(globalThis.document, 'hidden', 'get').mockReturnValue(false);
+ vi.spyOn(navigator, 'onLine', 'get').mockReturnValue(true);
+ vi.spyOn(console, 'warn').mockImplementation(() => {});
+});
+afterEach(() => {
+ cleanups.splice(0).forEach((dispose) => dispose());
+ vi.restoreAllMocks();
+ vi.useRealTimers();
+});
+function setup() {
+ const request = vi
+ .fn<() => Promise<{ error?: CombinedError }>>()
+ .mockResolvedValue({});
+ const query = vi.fn(() => ({ toPromise: request }));
+ const client = { query } as unknown as Client;
+ const queue = channelNotificationRefresh(client);
+ cleanups.push(() => disposeChannelNotificationRefresh(client));
+ const register = (
+ id = 'a',
+ overrides: Partial<ChannelNotificationReader> = {}
+ ) => {
+ const reader: ChannelNotificationReader = {
+ enabled: true,
+ fetching: false,
+ filtered: false,
+ channelId: id,
+ notificationIds: [],
+ ...overrides,
+ };
+ const dispose = queue.register(descriptor(id), reader);
+ cleanups.push(dispose);
+ return { reader, dispose };
+ };
+ return { queue, client, query, request, register };
+}
+function patch(id = 'a', updated = false): GraphqlNotificationPatch {
+ return {
+ __typename: updated
+ ? 'GraphqlUpdatedNotification'
+ : 'GraphqlNewNotification',
+ notification: { id: 'notification', entityType: 'CHANNEL', entityId: id },
+ } as GraphqlNotificationPatch;
+}
+const deletion = (
+ entityId: string,
+ graphqlTypeName = 'GraphqlNotification'
+): GraphqlNotificationPatch => ({
+ __typename: 'GraphqlCacheDeletion',
+ entityId,
+ graphqlTypeName,
+});
+const tick = () => vi.advanceTimersByTimeAsync(100);
+function deferred() {
+ let resolve!: (result: {}) => void;
+ const promise = new Promise<{}>((done) => {
+ resolve = done;
+ });
+ return { promise, resolve };
+}
+
+describe('shared channel notification refresh', () => {
+ it('shares one operation across readers and batches websocket + committed mutations', async () => {
+ const f = setup();
+ f.register();
+ f.register();
+ f.queue.onPatch(patch(), false);
+ expect(delegateChannelNotificationRefresh(f.client, descriptor())).toBe(
+ true
+ );
+ f.queue.onPatch(patch(), false);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(1);
+ expect(f.query).toHaveBeenCalledWith(
+ document,
+ { id: 'a' },
+ { requestPolicy: 'network-only' }
+ );
+ expect(
+ delegateChannelNotificationRefresh(f.client, descriptor('unmounted'))
+ ).toBe(false);
+ });
+
+ it('does not interrupt initial or independent in-flight query loads', async () => {
+ const f = setup();
+ const { reader } = f.register('a', { fetching: true });
+ f.queue.onPatch(patch(), false);
+ await tick();
+ expect(f.query).not.toHaveBeenCalled();
+ reader.fetching = false;
+ f.queue.changed();
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ });
+
+ it('retains exactly one follow-up for events during a request', async () => {
+ const f = setup();
+ f.register();
+ const pending = deferred();
+ f.request.mockReturnValueOnce(pending.promise);
+ f.queue.onPatch(patch(), false);
+ await tick();
+ for (let i = 0; i < 20; i++) f.queue.onPatch(patch(), false);
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ pending.resolve({});
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(2);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(2);
+ });
+
+ it('caps concurrency across distinct projections at four', async () => {
+ const f = setup();
+ const pending = deferred();
+ f.request.mockReturnValue(pending.promise);
+ for (let i = 0; i < 9; i++) f.register(String(i));
+ f.queue.reconnect();
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(4);
+ pending.resolve({});
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(8);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(9);
+ });
+
+ it('lets normalized state changes update full edges but refreshes filtered badges', async () => {
+ const f = setup();
+ f.register('a', { notificationIds: ['notification'] });
+ f.register('badge', { channelId: undefined, filtered: true });
+ f.queue.onPatch(patch('a', true), true);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(1);
+ expect(f.query.mock.calls[0]).toEqual([
+ document,
+ { id: 'badge' },
+ { requestPolicy: 'network-only' },
+ ]);
+ f.queue.onPatch(patch('a', true), false);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(3);
+ });
+
+ it('refreshes a full edge when an updated notification is not in its membership', async () => {
+ const f = setup();
+ f.register();
+ f.queue.onPatch(patch('a', true), true);
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ });
+
+ it('scopes known deletions, ignores unrelated types, and recovers unknown deletions', async () => {
+ const f = setup();
+ f.register('a', { notificationIds: ['known'] });
+ f.register('b');
+ f.queue.onPatch(deletion('unknown', 'GraphqlDocument'), true);
+ await tick();
+ expect(f.query).not.toHaveBeenCalled();
+ f.queue.onPatch(deletion('known'), true);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(1);
+ f.queue.onPatch(deletion('unknown'), true);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(3);
+ f.queue.onPatch(deletion('b', 'GraphqlSoupChannel'), true);
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(4);
+ });
+
+ it('reconnects enabled readers without starting disabled or global feeds', async () => {
+ const f = setup();
+ f.register();
+ f.register('b', { enabled: false });
+ f.queue.reconnect();
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ expect(f.query.mock.calls[0]).toEqual([
+ document,
+ { id: 'a' },
+ { requestPolicy: 'network-only' },
+ ]);
+ });
+
+ it('holds dirty work while hidden/offline, then resumes without another notification', async () => {
+ const f = setup();
+ f.register();
+ vi.spyOn(globalThis.document, 'hidden', 'get').mockReturnValue(true);
+ f.queue.onPatch(patch(), false);
+ await tick();
+ expect(f.query).not.toHaveBeenCalled();
+ vi.spyOn(globalThis.document, 'hidden', 'get').mockReturnValue(false);
+ vi.spyOn(navigator, 'onLine', 'get').mockReturnValue(false);
+ globalThis.document.dispatchEvent(new Event('visibilitychange'));
+ await tick();
+ expect(f.query).not.toHaveBeenCalled();
+ vi.spyOn(navigator, 'onLine', 'get').mockReturnValue(true);
+ window.dispatchEvent(new Event('online'));
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ });
+
+ it('recovers transient failures with exponential backoff capped at 30 seconds', async () => {
+ const f = setup();
+ f.register();
+ f.request.mockResolvedValue({
+ error: new CombinedError({ networkError: new Error('offline') }),
+ });
+ f.queue.onPatch(patch(), false);
+ await tick();
+ for (const delay of [1000, 2000, 4000, 8000, 16000, 30000, 30000]) {
+ const before = f.query.mock.calls.length;
+ await vi.advanceTimersByTimeAsync(delay - 1);
+ expect(f.query).toHaveBeenCalledTimes(before);
+ await vi.advanceTimersByTimeAsync(1);
+ expect(f.query).toHaveBeenCalledTimes(before + 1);
+ }
+ f.request.mockResolvedValue({});
+ await vi.advanceTimersByTimeAsync(30000);
+ const calls = f.query.mock.calls.length;
+ await vi.advanceTimersByTimeAsync(60000);
+ expect(f.query).toHaveBeenCalledTimes(calls);
+ });
+
+ it.each([
+ new CombinedError({ graphQLErrors: ['forbidden'] }),
+ new CombinedError({
+ networkError: new Error('unauthorized'),
+ response: { status: 401 },
+ }),
+ ])(
+ 'does not automatically retry authorization/application errors',
+ async (error) => {
+ const f = setup();
+ f.register();
+ f.request.mockResolvedValue({ error });
+ f.queue.onPatch(patch(), false);
+ await tick();
+ // Blocked jobs must leave committed revalidations to the caller's fallback.
+ expect(delegateChannelNotificationRefresh(f.client, descriptor())).toBe(
+ false
+ );
+ f.queue.reconnect();
+ f.queue.onPatch(patch(), false);
+ await vi.advanceTimersByTimeAsync(60000);
+ expect(f.query).toHaveBeenCalledOnce();
+ const refresh = f.queue.refresh([descriptor()]);
+ const failure = expect(refresh).rejects.toBe(error);
+ await tick();
+ await failure;
+ expect(f.query).toHaveBeenCalledTimes(2);
+ }
+ );
+
+ it.each([
+ new CombinedError({ graphQLErrors: ['forbidden'] }),
+ new CombinedError({
+ networkError: new Error('unauthorized'),
+ response: { status: 401 },
+ }),
+ ])(
+ 'settles overlapping refresh callers when a permanent failure blocks the job',
+ async (error) => {
+ const f = setup();
+ f.register();
+ const pending = deferred();
+ f.request.mockReturnValueOnce(pending.promise);
+ const errors: unknown[] = [];
+ const refresh = async () => {
+ try {
+ await f.queue.refresh([descriptor()]);
+ } catch (error) {
+ errors.push(error);
+ }
+ };
+ const first = refresh();
+ await tick();
+ const second = refresh();
+ pending.resolve({ error });
+ await tick();
+ expect(errors).toEqual([error, error]);
+ await Promise.all([first, second]);
+ await vi.advanceTimersByTimeAsync(30000);
+ expect(f.query).toHaveBeenCalledOnce();
+ const retry = f.queue.refresh([descriptor()]);
+ await tick();
+ await retry;
+ expect(f.query).toHaveBeenCalledTimes(2);
+ }
+ );
+
+ it('waits for the generation requested by an explicit refresh', async () => {
+ const f = setup();
+ f.register();
+ const pending = deferred();
+ f.request.mockReturnValueOnce(pending.promise);
+ f.queue.onPatch(patch(), false);
+ await tick();
+ const done = vi.fn();
+ const refresh = f.queue.refresh([descriptor()]).then(done);
+ pending.resolve({});
+ await Promise.resolve();
+ expect(done).not.toHaveBeenCalled();
+ await tick();
+ await refresh;
+ expect(done).toHaveBeenCalledOnce();
+ });
+
+ it('rejects an explicit refresh when its reader becomes disabled', async () => {
+ const f = setup();
+ const { reader } = f.register('a', { fetching: true });
+ const refresh = f.queue.refresh([descriptor()]);
+ const failure = expect(refresh).rejects.toThrow('disabled');
+ reader.enabled = false;
+ f.queue.changed();
+ await failure;
+ await tick();
+ expect(f.query).not.toHaveBeenCalled();
+ });
+
+ it('lets explicit retries bypass an existing background retry delay', async () => {
+ const f = setup();
+ f.register();
+ f.request.mockResolvedValueOnce({
+ error: new CombinedError({ networkError: new Error('offline') }),
+ });
+ f.queue.onPatch(patch(), false);
+ await tick();
+ const refresh = f.queue.refresh([descriptor()]);
+ await tick();
+ await refresh;
+ expect(f.query).toHaveBeenCalledTimes(2);
+ });
+
+ it('unregisters duplicate views independently and cancels the last pending job', async () => {
+ const f = setup();
+ const a = f.register();
+ const b = f.register();
+ f.queue.onPatch(patch(), false);
+ a.dispose();
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ f.queue.onPatch(patch(), false);
+ b.dispose();
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ });
+
+ it('fences late completions and retries after client replacement', async () => {
+ const f = setup();
+ f.register();
+ const pending = deferred();
+ f.request.mockReturnValueOnce(pending.promise);
+ f.queue.onPatch(patch(), false);
+ await tick();
+ f.queue.onPatch(patch(), false);
+ disposeChannelNotificationRefresh(f.client);
+ pending.resolve({});
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ expect(delegateChannelNotificationRefresh(f.client, descriptor())).toBe(
+ false
+ );
+ const next = setup();
+ next.register();
+ next.queue.reconnect();
+ await tick();
+ expect(next.query).toHaveBeenCalledOnce();
+ });
+
+ it('fences a cache reset and refreshes the replacement session', async () => {
+ const f = setup();
+ f.register();
+ const pending = deferred();
+ f.request.mockReturnValueOnce(pending.promise);
+ f.queue.onPatch(patch(), false);
+ await tick();
+ f.queue.reset();
+ pending.resolve({});
+ await tick();
+ expect(f.query).toHaveBeenCalledTimes(2);
+ });
+
+ it('suspends pagehide work and reconciles on restoration', async () => {
+ const f = setup();
+ f.register();
+ f.queue.suspend(true);
+ f.queue.onPatch(patch(), false);
+ await tick();
+ expect(f.query).not.toHaveBeenCalled();
+ f.queue.suspend(false);
+ await tick();
+ expect(f.query).toHaveBeenCalledOnce();
+ });
+});
diff --git a/apps/web/src/lib/queries/channel/notification-refresh.ts b/apps/web/src/lib/queries/channel/notification-refresh.ts
new file mode 100644
index 0000000000..208717bf74
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/notification-refresh.ts
@@ -0,0 +1,351 @@
+import { isTransientRequestError } from '@core/util/request-error';
+import type { QueryRevalidation } from '@graphql-cache/exchange/optimistic';
+import type { GraphqlNotificationPatch } from '@service-storage/graphql-soup-websocket';
+import { type Client, createRequest } from '@urql/core';
+
+type QueryClient = Pick<Client, 'query'>;
+export type ChannelNotificationReader = {
+ enabled: boolean;
+ fetching: boolean;
+ /** Omitted for channel lists, which can gain previously absent channels. */
+ channelId?: string;
+ filtered: boolean;
+ notificationIds: readonly string[];
+};
+type Waiter = {
+ generation: number;
+ resolve: () => void;
+ reject: (error: unknown) => void;
+};
+type Job = {
+ query: QueryRevalidation;
+ readers: Set<ChannelNotificationReader>;
+ generation: number;
+ completed: number;
+ running: boolean;
+ retryAt: number;
+ failures: number;
+ blocked: boolean;
+ waiters: Waiter[];
+};
+
+const coordinators = new WeakMap<QueryClient, ChannelNotificationRefresh>();
+
+/** One queue per client; no global notification feed is mounted or inspected. */
+export function channelNotificationRefresh(client: QueryClient) {
+ let coordinator = coordinators.get(client);
+ if (!coordinator) {
+ coordinator = new ChannelNotificationRefresh(client);
+ coordinators.set(client, coordinator);
+ }
+ return coordinator;
+}
+
+export function disposeChannelNotificationRefresh(client: QueryClient) {
+ coordinators.get(client)?.dispose();
+ coordinators.delete(client);
+}
+
+/** Durable replay falls back to the exchange when no matching reader exists. */
+export function delegateChannelNotificationRefresh(
+ client: QueryClient,
+ query: QueryRevalidation
+): boolean {
+ return coordinators.get(client)?.invalidateQuery(query) ?? false;
+}
+
+export class ChannelNotificationRefresh {
+ private jobs = new Map<number, Job>();
+ private timer: ReturnType<typeof setTimeout> | undefined;
+ private timerAt = 0;
+ private active = 0;
+ private disposed = false;
+ private listening = false;
+ private epoch = 0;
+ private suspended = false;
+
+ constructor(private readonly client: QueryClient) {}
+
+ register(query: QueryRevalidation, reader: ChannelNotificationReader) {
+ const key = createRequest(query.document, query.variables).key;
+ let job = this.jobs.get(key);
+ if (!job) {
+ job = {
+ query,
+ readers: new Set(),
+ generation: 0,
+ completed: 0,
+ running: false,
+ retryAt: 0,
+ failures: 0,
+ blocked: false,
+ waiters: [],
+ };
+ this.jobs.set(key, job);
+ }
+ job.readers.add(reader);
+ this.listen();
+ return () => {
+ if (!job.readers.delete(reader)) return;
+ if (job.readers.size) return;
+ if (!job.running) this.jobs.delete(key);
+ job.completed = job.generation;
+ this.settle(
+ job,
+ Infinity,
+ new Error('Channel notification reader closed')
+ );
+ if (![...this.jobs.values()].some((job) => job.readers.size))
+ this.stopListening();
+ };
+ }
+
+ /** Called when reactive enabled/loading state changes; does not invalidate. */
+ changed = () => {
+ for (const job of this.jobs.values()) {
+ if (!this.enabled(job))
+ this.settle(
+ job,
+ Infinity,
+ new Error('Channel notification reader disabled')
+ );
+ }
+ this.schedule();
+ };
+
+ invalidateQuery(query: QueryRevalidation): boolean {
+ const job = this.jobs.get(
+ createRequest(query.document, query.variables).key
+ );
+ // Decline work we cannot run so committed writes retain their network fallback.
+ if (!job || !this.enabled(job) || job.blocked) return false;
+ this.invalidate(job);
+ this.schedule();
+ return true;
+ }
+
+ /** Explicit refreshes await one attempt. Background recovery never fails a mutation. */
+ async refresh(queries: readonly QueryRevalidation[]): Promise<void> {
+ const jobs = new Set(
+ queries
+ .map((query) =>
+ this.jobs.get(createRequest(query.document, query.variables).key)
+ )
+ .filter((job): job is Job => !!job && this.enabled(job))
+ );
+ const promises = [...jobs].map((job) => {
+ this.invalidate(job);
+ job.blocked = false;
+ job.retryAt = 0;
+ return new Promise<void>((resolve, reject) => {
+ job.waiters.push({ generation: job.generation, resolve, reject });
+ });
+ });
+ this.schedule();
+ await Promise.all(promises);
+ }
+
+ suspend(suspended: boolean) {
+ this.suspended = suspended;
+ if (!suspended) this.reconnect();
+ }
+
+ /** Fence work from a replaced cache/session while retaining mounted readers. */
+ reset() {
+ this.epoch += 1;
+ for (const job of this.jobs.values()) {
+ this.settle(
+ job,
+ Infinity,
+ new Error('Channel notification cache replaced')
+ );
+ job.failures = 0;
+ job.retryAt = 0;
+ job.blocked = false;
+ }
+ this.reconnect();
+ }
+
+ reconnect() {
+ for (const job of this.jobs.values()) {
+ if (this.enabled(job)) this.invalidate(job);
+ }
+ this.schedule();
+ }
+
+ onPatch(patch: GraphqlNotificationPatch, normalized: boolean) {
+ if (patch.__typename === 'GraphqlCacheDeletion') {
+ if (patch.graphqlTypeName === 'GraphqlNotification') {
+ const owners = [...this.jobs.values()].filter((job) =>
+ [...job.readers].some((reader) =>
+ reader.notificationIds.includes(patch.entityId)
+ )
+ );
+ // A deletion contains no parent channel. Unknown IDs require recovery
+ // across enabled readers; known IDs affect only their cached owners.
+ for (const job of owners.length ? owners : this.jobs.values()) {
+ if (this.enabled(job)) this.invalidate(job);
+ }
+ } else if (patch.graphqlTypeName === 'GraphqlSoupChannel') {
+ this.invalidateChannel(patch.entityId);
+ } else return;
+ } else {
+ if (patch.notification.entityType !== 'CHANNEL') return;
+ this.invalidateChannel(
+ patch.notification.entityId,
+ normalized && patch.__typename === 'GraphqlUpdatedNotification'
+ ? patch.notification.id
+ : undefined
+ );
+ }
+ this.schedule();
+ }
+
+ dispose() {
+ this.disposed = true;
+ this.stopListening();
+ for (const job of this.jobs.values()) {
+ this.settle(
+ job,
+ Infinity,
+ new Error('Channel notification client closed')
+ );
+ }
+ this.jobs.clear();
+ }
+
+ private enabled(job: Job) {
+ return [...job.readers].some((reader) => reader.enabled);
+ }
+
+ private invalidate(job: Job) {
+ job.generation += 1;
+ }
+
+ private invalidateChannel(channelId: string, normalizedUpdateId?: string) {
+ for (const job of this.jobs.values()) {
+ if (
+ [...job.readers].some(
+ (reader) =>
+ reader.enabled &&
+ (!reader.channelId || reader.channelId === channelId) &&
+ // Updating a normalized record cannot add it to an older edge.
+ (normalizedUpdateId === undefined ||
+ reader.filtered ||
+ !reader.notificationIds.includes(normalizedUpdateId))
+ )
+ )
+ this.invalidate(job);
+ }
+ }
+
+ private available(job: Job) {
+ return (
+ !this.disposed &&
+ !this.suspended &&
+ this.enabled(job) &&
+ !job.running &&
+ !job.blocked &&
+ job.generation > job.completed &&
+ ![...job.readers].some((reader) => reader.enabled && reader.fetching) &&
+ // Explicit user refreshes may run in hidden tabs. Background work waits.
+ (job.waiters.length > 0 ||
+ (!document.hidden && navigator.onLine !== false))
+ );
+ }
+
+ private schedule = () => {
+ if (this.disposed || this.active >= 4) return;
+ const ready = [...this.jobs.values()].filter((job) => this.available(job));
+ if (!ready.length) return;
+ const delay = Math.max(
+ 100,
+ Math.min(...ready.map((job) => job.retryAt)) - Date.now()
+ );
+ const deadline = Date.now() + delay;
+ if (this.timer !== undefined && this.timerAt <= deadline) return;
+ clearTimeout(this.timer);
+ this.timerAt = deadline;
+ this.timer = setTimeout(this.flush, delay);
+ };
+
+ private flush = () => {
+ this.timer = undefined;
+ for (const [key, job] of [...this.jobs]) {
+ if (this.active >= 4) break;
+ if (!this.available(job) || job.retryAt > Date.now()) continue;
+ // Rotate dispatched operations so a busy channel cannot starve others.
+ this.jobs.delete(key);
+ this.jobs.set(key, job);
+ void this.run(key, job);
+ }
+ this.schedule();
+ };
+
+ private async run(key: number, job: Job) {
+ const generation = job.generation;
+ const epoch = this.epoch;
+ job.running = true;
+ this.active += 1;
+ try {
+ const result = await this.client
+ .query(job.query.document, job.query.variables, {
+ requestPolicy: 'network-only',
+ })
+ .toPromise();
+ if (this.disposed || epoch !== this.epoch || !job.readers.size) return;
+ if (result.error) throw result.error;
+ job.completed = generation;
+ job.failures = 0;
+ job.retryAt = 0;
+ this.settle(job, generation);
+ } catch (error) {
+ if (this.disposed || epoch !== this.epoch || !job.readers.size) return;
+ job.failures += 1;
+ if (error instanceof Error && isTransientRequestError(error)) {
+ this.settle(job, generation, error);
+ job.retryAt =
+ Date.now() +
+ Math.min(30_000, 1000 * 2 ** Math.min(job.failures - 1, 5));
+ } else {
+ job.blocked = true;
+ // Later generations cannot run while blocked; reject their callers too.
+ this.settle(job, Infinity, error);
+ }
+ console.warn('Failed to refresh channel notifications', error);
+ } finally {
+ job.running = false;
+ this.active -= 1;
+ if (!job.readers.size) this.jobs.delete(key);
+ this.schedule();
+ }
+ }
+
+ private settle(job: Job, generation: number, error?: unknown) {
+ const settled = job.waiters.filter(
+ (waiter) => waiter.generation <= generation
+ );
+ job.waiters = job.waiters.filter(
+ (waiter) => waiter.generation > generation
+ );
+ for (const waiter of settled) {
+ if (error !== undefined) waiter.reject(error);
+ else waiter.resolve();
+ }
+ }
+
+ private listen() {
+ if (this.listening || this.disposed) return;
+ this.listening = true;
+ document.addEventListener('visibilitychange', this.changed);
+ window.addEventListener('online', this.changed);
+ }
+
+ private stopListening() {
+ clearTimeout(this.timer);
+ this.timer = undefined;
+ this.listening = false;
+ document.removeEventListener('visibilitychange', this.changed);
+ window.removeEventListener('online', this.changed);
+ }
+}
diff --git a/apps/web/src/lib/queries/channel/notifications.test.ts b/apps/web/src/lib/queries/channel/notifications.test.ts
new file mode 100644
index 0000000000..0b48a78c68
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/notifications.test.ts
@@ -0,0 +1,123 @@
+import { SoupNotificationsDocument } from '@service-storage/graphql/generated/graphql';
+import type { GraphqlNotificationPatch } from '@service-storage/graphql-soup-websocket';
+import { createRoot, createSignal } from 'solid-js';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import { getActiveGraphqlSoupRevalidations } from '../soup/graphql/active-queries';
+import {
+ channelNotificationRefresh,
+ disposeChannelNotificationRefresh,
+} from './notification-refresh';
+import { createChannelNotificationsQuery } from './notifications';
+
+const mocks = vi.hoisted(() => ({
+ createQuery: vi.fn(),
+ refetch: vi.fn().mockResolvedValue(undefined),
+ subscribe: vi.fn(),
+ client: { query: vi.fn() },
+}));
+vi.mock('@app/lib/urql-solid', () => ({ createUrqlQuery: mocks.createQuery }));
+vi.mock('@service-storage/graphql-soup', () => ({
+ getGraphqlSoupClient: () => mocks.client,
+ mapGraphqlNotification: (n: unknown) => n,
+}));
+vi.mock('@service-storage/graphql-soup-websocket', () => ({
+ subscribeToGraphqlNotificationPatches: mocks.subscribe,
+}));
+let dispose: () => void;
+afterEach(() => {
+ dispose?.();
+ disposeChannelNotificationRefresh(mocks.client as never);
+ vi.useRealTimers();
+ vi.clearAllMocks();
+ vi.restoreAllMocks();
+});
+
+function setup() {
+ vi.useFakeTimers();
+ vi.spyOn(document, 'hidden', 'get').mockReturnValue(false);
+ mocks.client.query.mockImplementation(() => ({
+ toPromise: async () => {
+ await mocks.refetch();
+ return {};
+ },
+ }));
+ mocks.createQuery.mockReturnValue({ refetch: mocks.refetch });
+ return createRoot((cleanup) => {
+ dispose = cleanup;
+ const [enabled, setEnabled] = createSignal(true);
+ createChannelNotificationsQuery('channel', enabled);
+ const patch = (entityId = 'channel', kind = 'GraphqlNewNotification') => {
+ channelNotificationRefresh(mocks.client as never).onPatch(
+ {
+ __typename: kind,
+ notification: { entityType: 'CHANNEL', entityId },
+ } as GraphqlNotificationPatch,
+ false
+ );
+ };
+ return { setEnabled, patch };
+ });
+}
+
+describe('complete channel notification edge', () => {
+ it('registers only this channel for read-state reconciliation while enabled', () => {
+ const f = setup();
+ const options = mocks.createQuery.mock.calls[0][0]();
+ expect(options.query).toBe(SoupNotificationsDocument);
+ expect(options.variables.input.initial.filters.channelFilter).toEqual({
+ literal: { channelId: 'channel' },
+ });
+ expect(options.variables.input.initial.limit).toBe(1);
+ expect(getActiveGraphqlSoupRevalidations()).toHaveLength(1);
+ f.setEnabled(false);
+ expect(mocks.createQuery.mock.calls[0][0]().enabled).toBe(false);
+ expect(getActiveGraphqlSoupRevalidations()).toHaveLength(0);
+ });
+
+ it('coalesces live deliveries and remote state changes, without fetching other channels', async () => {
+ const f = setup();
+ f.patch('another-channel');
+ await vi.advanceTimersByTimeAsync(100);
+ expect(mocks.refetch).not.toHaveBeenCalled();
+ f.patch();
+ f.patch('channel', 'GraphqlUpdatedNotification');
+ await vi.advanceTimersByTimeAsync(100);
+ expect(mocks.refetch).toHaveBeenCalledOnce();
+ expect(mocks.client.query.mock.calls[0][2]).toEqual({
+ requestPolicy: 'network-only',
+ });
+ f.setEnabled(false);
+ f.patch();
+ await vi.advanceTimersByTimeAsync(100);
+ expect(mocks.refetch).toHaveBeenCalledOnce();
+ });
+
+ it('refreshes again when a delivery arrives during an in-flight snapshot', async () => {
+ const f = setup();
+ let finish = () => {};
+ mocks.refetch.mockImplementationOnce(
+ () =>
+ new Promise<void>((resolve) => {
+ finish = resolve;
+ })
+ );
+ f.patch();
+ await vi.advanceTimersByTimeAsync(100);
+ f.patch();
+ await vi.advanceTimersByTimeAsync(100);
+ expect(mocks.refetch).toHaveBeenCalledOnce();
+ finish();
+ await vi.advanceTimersByTimeAsync(100);
+ expect(mocks.refetch).toHaveBeenCalledTimes(2);
+ });
+
+ it('cancels pending refreshes and subscriptions on channel close', async () => {
+ const f = setup();
+ f.patch();
+ dispose();
+ await vi.advanceTimersByTimeAsync(100);
+ expect(mocks.refetch).not.toHaveBeenCalled();
+ expect(mocks.subscribe).not.toHaveBeenCalled();
+ expect(getActiveGraphqlSoupRevalidations()).toHaveLength(0);
+ });
+});
diff --git a/apps/web/src/lib/queries/channel/notifications.ts b/apps/web/src/lib/queries/channel/notifications.ts
new file mode 100644
index 0000000000..4019a0c543
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/notifications.ts
@@ -0,0 +1,61 @@
+import { createUrqlQuery } from '@app/lib/urql-solid';
+import {
+ SoupNotificationsDocument,
+ type SoupNotificationsQuery,
+} from '@service-storage/graphql/generated/graphql';
+import {
+ getGraphqlSoupClient,
+ mapGraphqlNotification,
+} from '@service-storage/graphql-soup';
+import { type Accessor, onCleanup } from 'solid-js';
+import {
+ registerActiveGraphqlSoupQuery,
+ registerGraphqlSoupRevalidations,
+} from '../soup/graphql/active-queries';
+import { buildGraphqlEntitySoupInput } from '../soup/graphql/entity-input';
+import { registerChannelNotificationRefresh } from './register-notification-refresh';
+
+/** Complete, live channel notifications; never read the global GraphQL feed. */
+export function createChannelNotificationsQuery(
+ channelId: string,
+ enabled: Accessor<boolean>
+) {
+ const variables = {
+ input: buildGraphqlEntitySoupInput('CHANNEL', channelId)!,
+ };
+ const query = createUrqlQuery(() => ({
+ query: SoupNotificationsDocument,
+ client: getGraphqlSoupClient(),
+ variables,
+ enabled: enabled(),
+ requestPolicy: 'cache-and-network',
+ select: (data: SoupNotificationsQuery) =>
+ (
+ data.user.soup.items.find((item) => item.id === channelId)
+ ?.notifications ?? []
+ ).map(mapGraphqlNotification),
+ }));
+ const refresh = registerChannelNotificationRefresh(() => ({
+ client: getGraphqlSoupClient(),
+ queries: [{ document: SoupNotificationsDocument, variables }],
+ reader: {
+ enabled: enabled(),
+ fetching: query.isFetching,
+ channelId,
+ filtered: false,
+ notificationIds: query.isSuccess
+ ? (query.data ?? []).map((n) => n.id)
+ : [],
+ },
+ }));
+ onCleanup(registerActiveGraphqlSoupQuery({ isEnabled: enabled, refresh }));
+ onCleanup(
+ registerGraphqlSoupRevalidations(
+ () =>
+ enabled() ? [{ document: SoupNotificationsDocument, variables }] : [],
+ getGraphqlSoupClient
+ )
+ );
+
+ return query;
+}
diff --git a/apps/web/src/lib/queries/channel/register-notification-refresh.test.ts b/apps/web/src/lib/queries/channel/register-notification-refresh.test.ts
new file mode 100644
index 0000000000..5564ff8b0f
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/register-notification-refresh.test.ts
@@ -0,0 +1,82 @@
+import type { QueryRevalidation } from '@graphql-cache/exchange/optimistic';
+import { type Client, gql } from '@urql/core';
+import { createRoot, createSignal } from 'solid-js';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import {
+ channelNotificationRefresh,
+ delegateChannelNotificationRefresh,
+ disposeChannelNotificationRefresh,
+} from './notification-refresh';
+import { registerChannelNotificationRefresh } from './register-notification-refresh';
+
+const document = gql`query Channel($id: ID!) { channel(id: $id) { id } }`;
+const descriptor: QueryRevalidation = { document, variables: { id: 'a' } };
+const cleanups: (() => void)[] = [];
+beforeEach(() => {
+ vi.useFakeTimers();
+ vi.spyOn(globalThis.document, 'hidden', 'get').mockReturnValue(false);
+});
+afterEach(() => {
+ cleanups.splice(0).forEach((dispose) => dispose());
+ vi.restoreAllMocks();
+ vi.useRealTimers();
+});
+function client() {
+ const query = vi.fn(() => ({ toPromise: async () => ({}) }));
+ const client = { query } as unknown as Client;
+ cleanups.push(() => disposeChannelNotificationRefresh(client));
+ return { client, query };
+}
+it('reactively waits for initial load, unregisters old clients, and cleans up readers', async () => {
+ const first = client();
+ const second = client();
+ const root = createRoot((dispose) => {
+ const [current, setClient] = createSignal(first.client);
+ const [fetching, setFetching] = createSignal(true);
+ const [enabled, setEnabled] = createSignal(true);
+ registerChannelNotificationRefresh(() => ({
+ client: current(),
+ queries: [descriptor],
+ reader: {
+ enabled: enabled(),
+ fetching: fetching(),
+ filtered: false,
+ channelId: 'a',
+ notificationIds: [],
+ },
+ }));
+ return { dispose, setClient, setFetching, setEnabled };
+ });
+ cleanups.push(root.dispose);
+ expect(delegateChannelNotificationRefresh(first.client, descriptor)).toBe(
+ true
+ );
+ await vi.advanceTimersByTimeAsync(100);
+ expect(first.query).not.toHaveBeenCalled();
+ root.setFetching(false);
+ await vi.advanceTimersByTimeAsync(100);
+ expect(first.query).toHaveBeenCalledOnce();
+ root.setEnabled(false);
+ expect(delegateChannelNotificationRefresh(first.client, descriptor)).toBe(
+ false
+ );
+ root.setClient(() => second.client);
+ root.setEnabled(true);
+ expect(delegateChannelNotificationRefresh(first.client, descriptor)).toBe(
+ false
+ );
+ expect(delegateChannelNotificationRefresh(second.client, descriptor)).toBe(
+ true
+ );
+ await vi.advanceTimersByTimeAsync(100);
+ expect(second.query).toHaveBeenCalledOnce();
+ root.dispose();
+ expect(delegateChannelNotificationRefresh(second.client, descriptor)).toBe(
+ false
+ );
+ channelNotificationRefresh(first.client).reconnect();
+ channelNotificationRefresh(second.client).reconnect();
+ await vi.advanceTimersByTimeAsync(100);
+ expect(first.query).toHaveBeenCalledOnce();
+ expect(second.query).toHaveBeenCalledOnce();
+});
diff --git a/apps/web/src/lib/queries/channel/register-notification-refresh.ts b/apps/web/src/lib/queries/channel/register-notification-refresh.ts
new file mode 100644
index 0000000000..a0c88bf7c5
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/register-notification-refresh.ts
@@ -0,0 +1,58 @@
+import type { QueryRevalidation } from '@graphql-cache/exchange/optimistic';
+import { type Client, createRequest } from '@urql/core';
+import { createEffect, on, onCleanup, untrack } from 'solid-js';
+import {
+ type ChannelNotificationReader,
+ channelNotificationRefresh,
+} from './notification-refresh';
+
+/** Syncs Solid query lifetimes with the client's imperative refresh queue. */
+export function registerChannelNotificationRefresh(
+ options: () => {
+ client: Pick<Client, 'query'>;
+ queries: readonly QueryRevalidation[];
+ reader: ChannelNotificationReader;
+ }
+) {
+ let client: Pick<Client, 'query'> | undefined;
+ const registrations = new Map<
+ number,
+ { reader: ChannelNotificationReader; dispose: () => void }
+ >();
+ const clear = () => {
+ for (const registration of registrations.values()) registration.dispose();
+ registrations.clear();
+ };
+ createEffect(
+ on(options, (next) => {
+ if (client !== next.client) clear();
+ client = next.client;
+ const coordinator = channelNotificationRefresh(client);
+ const keys = new Set<number>();
+ for (const query of next.queries) {
+ const key = createRequest(query.document, query.variables).key;
+ keys.add(key);
+ const existing = registrations.get(key);
+ if (existing) Object.assign(existing.reader, next.reader);
+ else {
+ const reader = { ...next.reader };
+ registrations.set(key, {
+ reader,
+ dispose: coordinator.register(query, reader),
+ });
+ }
+ }
+ for (const [key, registration] of registrations) {
+ if (keys.has(key)) continue;
+ registration.dispose();
+ registrations.delete(key);
+ }
+ coordinator.changed();
+ })
+ );
+ onCleanup(clear);
+ return () => {
+ const next = untrack(options);
+ return channelNotificationRefresh(next.client).refresh(next.queries);
+ };
+}
diff --git a/apps/web/src/lib/queries/channel/selection-by-id.test.ts b/apps/web/src/lib/queries/channel/selection-by-id.test.ts
new file mode 100644
index 0000000000..d4e6296726
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/selection-by-id.test.ts
@@ -0,0 +1,92 @@
+import type { ChannelEntity } from '@entity/types/entity';
+import type { WithNotification } from '@entity/types/notification';
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+const fetchSoup = vi.hoisted(() => vi.fn());
+const mapEntity = vi.hoisted(() => vi.fn());
+vi.mock('@service-storage/graphql-soup', () => ({
+ fetchGraphqlSoup: fetchSoup,
+}));
+vi.mock('../soup/transform-utils', () => ({
+ mapApiSoupItemToEntity: mapEntity,
+}));
+
+import { fetchChannelSelectionById } from './selection-by-id';
+
+describe('uncached channel selection', () => {
+ beforeEach(() => vi.clearAllMocks());
+ it.each([true, false])(
+ 'loads uncached channel membership (%s) and the complete notification edge together',
+ async (isParticipant) => {
+ const notifications = [{ id: 'older-mention' }, { id: 'reply' }];
+ fetchSoup.mockResolvedValue({
+ items: [
+ {
+ tag: 'channel',
+ data: {
+ channel: {
+ id: 'channel',
+ name: 'Channel',
+ channel_type: 'private',
+ owner_id: 'owner',
+ },
+ participants: [],
+ is_participant: isParticipant,
+ notifications,
+ },
+ },
+ ],
+ nextCursor: null,
+ });
+ const mapped: WithNotification<ChannelEntity> = {
+ type: 'channel',
+ id: 'channel',
+ name: 'Channel',
+ ownerId: 'owner',
+ channelType: 'private',
+ isParticipant,
+ notifications: () => [],
+ };
+ mapEntity.mockReturnValue(mapped);
+ const full = await fetchChannelSelectionById('channel');
+ expect(full).toBe(mapped);
+ expect(mapEntity).toHaveBeenCalledWith(
+ expect.objectContaining({
+ tag: 'channel',
+ data: expect.objectContaining({
+ is_participant: isParticipant,
+ notifications,
+ }),
+ })
+ );
+ expect(full.unreadNotifications).toBeUndefined();
+ expect(fetchSoup).toHaveBeenCalledWith(
+ expect.anything(),
+ {
+ input: expect.objectContaining({
+ initial: expect.objectContaining({
+ limit: 1,
+ filters: expect.objectContaining({
+ channelFilter: { literal: { channelId: 'channel' } },
+ }),
+ }),
+ }),
+ },
+ { requestPolicy: 'network-only', allowOfflineFallback: false }
+ );
+ }
+ );
+
+ it('rejects an absent channel rather than constructing a partial selection', async () => {
+ fetchSoup.mockResolvedValue({ items: [], nextCursor: null });
+ await expect(fetchChannelSelectionById('channel')).rejects.toThrow(
+ 'Conversation is unavailable'
+ );
+ });
+
+ it('propagates access failures without falling back to cached metadata', async () => {
+ const error = new Error('Forbidden');
+ fetchSoup.mockRejectedValue(error);
+ await expect(fetchChannelSelectionById('channel')).rejects.toBe(error);
+ });
+});
diff --git a/apps/web/src/lib/queries/channel/selection-by-id.ts b/apps/web/src/lib/queries/channel/selection-by-id.ts
new file mode 100644
index 0000000000..456e4c308b
--- /dev/null
+++ b/apps/web/src/lib/queries/channel/selection-by-id.ts
@@ -0,0 +1,26 @@
+import type { ChannelEntity } from '@entity/types/entity';
+import { SoupDocument } from '@service-storage/graphql/generated/graphql';
+import { fetchGraphqlSoup } from '@service-storage/graphql-soup';
+import { buildGraphqlEntitySoupInput } from '../soup/graphql/entity-input';
+import { mapApiSoupItemToEntity } from '../soup/transform-utils';
+
+/** Resolve an uncached favorite with membership and its complete notification edge. */
+export async function fetchChannelSelectionById(
+ channelId: string
+): Promise<ChannelEntity> {
+ const input = buildGraphqlEntitySoupInput('CHANNEL', channelId);
+ if (!input) throw new Error('Invalid channel selection');
+ const page = await fetchGraphqlSoup(
+ SoupDocument,
+ { input },
+ { requestPolicy: 'network-only', allowOfflineFallback: false }
+ );
+ const item = page.items.find(
+ (item) => item.tag === 'channel' && item.data.channel.id === channelId
+ );
+ if (!item || item.tag !== 'channel')
+ throw new Error('Conversation is unavailable');
+ const channel = mapApiSoupItemToEntity(item);
+ if (channel.type !== 'channel') throw new Error('Invalid channel selection');
+ return channel;
+}
diff --git a/apps/web/src/lib/queries/channel/unread-cache.test.ts b/apps/web/src/lib/queries/channel/unread-cache.test.ts
index c1e055296c..652eb71738 100644
--- a/apps/web/src/lib/queries/channel/unread-cache.test.ts
+++ b/apps/web/src/lib/queries/channel/unread-cache.test.ts
@@ -78,12 +78,7 @@ function setup(ids = ['other']) {
}
describe('websocket channel unread cache writes', () => {
- it.each([
- 'channel_message_send',
- 'channel_message_reply',
- 'channel_mention',
- 'document_mention',
- ])(
+ it.each(['channel_message_send', 'channel_mention', 'document_mention'])(
'links %s and admits its channel to an empty badge page',
async (eventType) => {
const host = setup([]);
@@ -127,6 +122,34 @@ describe('websocket channel unread cache writes', () => {
}
);
+ it.each([null, 'thread'])(
+ 'writes a conversation witness only for top-level mentions (thread=%s)',
+ async (threadId) => {
+ const host = setup(['channel']);
+ await cacheNewChannelUnread(
+ host,
+ {
+ ...notification,
+ eventType: 'channel_mention',
+ metadata: {
+ __typename: 'GraphqlChannelMentionMetadata',
+ channelMentionMessageId: 'message',
+ channelMentionMessageContent: 'Hello',
+ channelMentionThreadId: threadId,
+ channelMentionChannelType: 'PRIVATE',
+ channelMentionHasAttachments: false,
+ channelMentionSenderDisplayName: null,
+ channelMentionChannelName: 'Channel',
+ channelMentionSenderProfilePictureUrl: null,
+ },
+ },
+ () => true
+ );
+ expect(host.writeQuery).toHaveBeenCalledTimes(threadId === null ? 1 : 0);
+ if (threadId !== null) expect(host.readQuery).not.toHaveBeenCalled();
+ }
+ );
+
it('preserves other badge identities without replaying their notification states, and stays bounded', async () => {
const host = setup(['other', 'oldest']);
await cacheNewChannelUnread(host, notification, () => true);
@@ -153,6 +176,8 @@ describe('websocket channel unread cache writes', () => {
{ state: 'SEEN' as const },
{ state: 'DONE' as const },
{ eventType: 'call_started' },
+ { eventType: 'channel_message_reply' },
+ { eventType: 'channel_message_reaction' },
{ eventType: 'channel_invite' },
{ entityType: 'DOCUMENT' as const },
])('does not admit non-message or read evidence: %j', async (patch) => {
@@ -194,11 +219,14 @@ describe('websocket channel unread cache writes', () => {
});
it('uses exactly the same argument-keyed relationship as the channel list and badge', () => {
- const argumentsOf = (document: DocumentNode) => {
+ const argumentsOf = (
+ document: DocumentNode,
+ alias = 'unreadNotifications'
+ ) => {
let argumentsKey: string | undefined;
visit(document, {
Field(node) {
- if (node.alias?.value === 'unreadNotifications') {
+ if (node.alias?.value === alias) {
argumentsKey = node.arguments
?.map((argument) => print(argument))
.join('\n');
diff --git a/apps/web/src/lib/queries/channel/unread-cache.ts b/apps/web/src/lib/queries/channel/unread-cache.ts
index eb5ae2c72d..0c63c11c30 100644
--- a/apps/web/src/lib/queries/channel/unread-cache.ts
+++ b/apps/web/src/lib/queries/channel/unread-cache.ts
@@ -1,4 +1,5 @@
import type { CacheHost } from '@graphql-cache/host/types';
+import { isUnreadChannelMessageNotification } from '@notifications/top-level-channel-notification';
import {
ChannelUnreadCacheWriteDocument,
type ChannelUnreadCacheWriteSubscription,
@@ -8,13 +9,13 @@ import {
type ChannelUnreadPresenceQueryVariables,
type SoupNotificationFieldsFragment,
} from '@service-storage/graphql/generated/graphql';
+import { mapGraphqlNotification } from '@service-storage/graphql-soup';
import { stringifyDocument } from '@urql/core';
import { getChannelListRevalidations } from '../soup/graphql/channel-list-revalidation';
const channelMessageEvents = new Set([
'channel_mention',
'channel_message_send',
- 'channel_message_reply',
'document_mention',
]);
@@ -41,7 +42,8 @@ export async function cacheNewChannelUnread(
!isCurrent() ||
notification.entityType !== 'CHANNEL' ||
notification.state !== 'UNSEEN' ||
- !channelMessageEvents.has(notification.eventType)
+ !channelMessageEvents.has(notification.eventType) ||
+ !isUnreadChannelMessageNotification(mapGraphqlNotification(notification))
) {
return false;
}
@@ -50,22 +52,22 @@ export async function cacheNewChannelUnread(
__typename: 'GraphqlSoupChannel' as const,
id: notification.entityId,
};
+ const witness = {
+ id: notification.id,
+ state: notification.state,
+ createdAt: notification.createdAt,
+ };
await host.writeQuery({
query: relationshipQuery,
operationName: 'ChannelUnreadCacheWrite',
+ variables: {},
data: {
soupUpdates: [
{
__typename: 'SoupUpdated',
item: {
...channel,
- unreadNotifications: [
- {
- id: notification.id,
- state: notification.state,
- createdAt: notification.createdAt,
- },
- ],
+ unreadNotifications: [witness],
},
},
],
diff --git a/apps/web/src/lib/queries/channel/unread-presence.test.ts b/apps/web/src/lib/queries/channel/unread-presence.test.ts
index 6ea4bb18a0..f80ea48362 100644
--- a/apps/web/src/lib/queries/channel/unread-presence.test.ts
+++ b/apps/web/src/lib/queries/channel/unread-presence.test.ts
@@ -91,6 +91,7 @@ describe('channel unread presence query', () => {
});
it('shares bounded notification revalidation and unregisters on disposal', async () => {
+ const visible = vi.spyOn(document, 'hidden', 'get').mockReturnValue(false);
const f = setup();
try {
f.setEnabled(true);
@@ -103,12 +104,19 @@ describe('channel unread presence query', () => {
typeof f.client,
'query'
>);
- expect(query).toHaveBeenCalledWith(
+ expect(query).not.toHaveBeenCalled();
+ const ownQuery = vi.spyOn(f.client, 'query');
+ await revalidateChannelLists(f.client);
+ await vi.waitFor(() => expect(ownQuery).toHaveBeenCalledOnce());
+ expect(ownQuery).toHaveBeenCalledWith(
ChannelUnreadPresenceDocument,
{ input: { initial: { limit: 500 } } },
{ requestPolicy: 'network-only' }
);
+ f.respond('SEEN');
+ expect(f.query.data).toEqual([{ id: 'one', state: 'SEEN' }]);
} finally {
+ visible.mockRestore();
f.dispose();
}
expect(getChannelListRevalidations()).toHaveLength(0);
diff --git a/apps/web/src/lib/queries/channel/unread-presence.ts b/apps/web/src/lib/queries/channel/unread-presence.ts
index 9f43d28c8e..e2caf62428 100644
--- a/apps/web/src/lib/queries/channel/unread-presence.ts
+++ b/apps/web/src/lib/queries/channel/unread-presence.ts
@@ -11,6 +11,8 @@ import {
registerGraphqlSoupRevalidations,
} from '../soup/graphql/active-queries';
+import { registerChannelNotificationRefresh } from './register-notification-refresh';
+
function unreadWitnesses(data: ChannelUnreadPresenceQuery) {
return data.user.soup.items.flatMap((item) =>
item.__typename === 'GraphqlSoupChannel' ? item.unreadNotifications : []
@@ -32,20 +34,26 @@ export function createChannelUnreadQuery(
select: unreadWitnesses,
}));
onCleanup(
- registerGraphqlSoupRevalidations(() =>
- enabled() ? [{ document: ChannelUnreadPresenceDocument, variables }] : []
+ registerGraphqlSoupRevalidations(
+ () =>
+ enabled()
+ ? [{ document: ChannelUnreadPresenceDocument, variables }]
+ : [],
+ getGraphqlSoupClient
)
);
- onCleanup(
- registerActiveGraphqlSoupQuery({
- isEnabled: enabled,
- refresh: async () => {
- await query.refetch({
- requestPolicy: 'network-only',
- throwOnError: true,
- });
- },
- })
- );
+ const refresh = registerChannelNotificationRefresh(() => ({
+ client: getGraphqlSoupClient(),
+ queries: [{ document: ChannelUnreadPresenceDocument, variables }],
+ reader: {
+ enabled: enabled(),
+ fetching: query.isFetching,
+ filtered: true,
+ notificationIds: query.isSuccess
+ ? (query.data ?? []).map((n) => n.id)
+ : [],
+ },
+ }));
+ onCleanup(registerActiveGraphqlSoupQuery({ isEnabled: enabled, refresh }));
return query;
}
diff --git a/apps/web/src/lib/queries/notification/revalidation.ts b/apps/web/src/lib/queries/notification/revalidation.ts
index ea7098f9eb..f889bdd43c 100644
--- a/apps/web/src/lib/queries/notification/revalidation.ts
+++ b/apps/web/src/lib/queries/notification/revalidation.ts
@@ -7,6 +7,7 @@ import {
SoupNotificationsDocument,
} from '@service-storage/graphql/generated/graphql';
import type { Client } from '@urql/core';
+import { delegateChannelNotificationRefresh } from '../channel/notification-refresh';
import { getActiveGraphqlSoupRevalidations } from '../soup/graphql/active-queries';
type NotificationReader = {
@@ -48,12 +49,14 @@ async function refreshSafely(refresh: () => Promise<unknown>): Promise<void> {
export async function revalidateNotificationReaders(
client: Client
): Promise<void> {
- const pages = getActiveGraphqlSoupRevalidations().filter(({ document }) =>
- notificationDocuments.has(document)
+ const pages = getActiveGraphqlSoupRevalidations(client).filter(
+ ({ document }) => notificationDocuments.has(document)
);
await Promise.all([
...pages.map(({ document, variables }) =>
refreshSafely(async () => {
+ if (delegateChannelNotificationRefresh(client, { document, variables }))
+ return;
const result = await client
.query(document, variables, { requestPolicy: 'network-only' })
.toPromise();
diff --git a/apps/web/src/lib/queries/soup/graphql/active-queries.test.ts b/apps/web/src/lib/queries/soup/graphql/active-queries.test.ts
index 2fc185fa74..2453d0e94c 100644
--- a/apps/web/src/lib/queries/soup/graphql/active-queries.test.ts
+++ b/apps/web/src/lib/queries/soup/graphql/active-queries.test.ts
@@ -1,5 +1,5 @@
import type { QueryRevalidation } from '@graphql-cache/exchange/optimistic';
-import { gql } from '@urql/core';
+import { type Client, gql } from '@urql/core';
import { describe, expect, it, onTestFinished, vi } from 'vitest';
import {
getActiveGraphqlSoupRevalidations,
@@ -45,6 +45,28 @@ describe('active GraphQL Soup queries', () => {
expect(getActiveGraphqlSoupRevalidations()).toEqual([]);
});
+ it('keeps channel descriptors scoped to the owning client before deduplication', () => {
+ const first = { query: vi.fn() } as unknown as Client;
+ const second = { query: vi.fn() } as unknown as Client;
+ const descriptor = { document: gql`query Channel { id }`, variables: {} };
+ onTestFinished(
+ registerGraphqlSoupRevalidations(
+ () => [descriptor],
+ () => first
+ )
+ );
+ expect(getActiveGraphqlSoupRevalidations(first)).toEqual([descriptor]);
+ expect(getActiveGraphqlSoupRevalidations(second)).toEqual([]);
+ onTestFinished(
+ registerGraphqlSoupRevalidations(
+ () => [descriptor],
+ () => second
+ )
+ );
+ expect(getActiveGraphqlSoupRevalidations(second)).toEqual([descriptor]);
+ expect(getActiveGraphqlSoupRevalidations()).toEqual([descriptor]);
+ });
+
it('strict revalidation fails until every enabled reader succeeds', async () => {
const consoleError = vi
.spyOn(console, 'error')
diff --git a/apps/web/src/lib/queries/soup/graphql/active-queries.ts b/apps/web/src/lib/queries/soup/graphql/active-queries.ts
index c1774c456b..6d55825d6c 100644
--- a/apps/web/src/lib/queries/soup/graphql/active-queries.ts
+++ b/apps/web/src/lib/queries/soup/graphql/active-queries.ts
@@ -1,5 +1,5 @@
import type { QueryRevalidation } from '@graphql-cache/exchange/optimistic';
-import { createRequest } from '@urql/core';
+import { type Client, createRequest } from '@urql/core';
type ActiveGraphqlSoupQuery = {
isEnabled: () => boolean;
@@ -7,21 +7,29 @@ type ActiveGraphqlSoupQuery = {
};
const activeQueries = new Set<ActiveGraphqlSoupQuery>();
-const revalidationSources = new Set<() => readonly QueryRevalidation[]>();
+const revalidationSources = new Set<{
+ queries: () => readonly QueryRevalidation[];
+ client?: () => Pick<Client, 'query'>;
+}>();
/** Each reader supplies its enabled, loaded pages for durable mutation replay. */
export function registerGraphqlSoupRevalidations(
- queries: () => readonly QueryRevalidation[]
+ queries: () => readonly QueryRevalidation[],
+ client?: () => Pick<Client, 'query'>
): () => void {
- revalidationSources.add(queries);
- return () => revalidationSources.delete(queries);
+ const source = { queries, client };
+ revalidationSources.add(source);
+ return () => revalidationSources.delete(source);
}
/** Snapshot query descriptors without fetching or waiting on the cache. */
-export function getActiveGraphqlSoupRevalidations(): QueryRevalidation[] {
+export function getActiveGraphqlSoupRevalidations(
+ client?: Pick<Client, 'query'>
+): QueryRevalidation[] {
const queries = new Map<number, QueryRevalidation>();
for (const source of revalidationSources) {
- for (const query of source()) {
+ if (client && source.client && source.client() !== client) continue;
+ for (const query of source.queries()) {
queries.set(createRequest(query.document, query.variables).key, query);
}
}
diff --git a/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts b/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts
index 6ab9303406..32f1c7cbb7 100644
--- a/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts
+++ b/apps/web/src/lib/queries/soup/graphql/channel-list-revalidation.ts
@@ -3,11 +3,12 @@ import {
ChannelUnreadPresenceDocument,
} from '@service-storage/graphql/generated/graphql';
import type { Client } from '@urql/core';
+import { delegateChannelNotificationRefresh } from '../../channel/notification-refresh';
import { getActiveGraphqlSoupRevalidations } from './active-queries';
/** Filtered notification membership must be re-evaluated after status writes. */
-export function getChannelListRevalidations() {
- return getActiveGraphqlSoupRevalidations().filter(
+export function getChannelListRevalidations(client?: Pick<Client, 'query'>) {
+ return getActiveGraphqlSoupRevalidations(client).filter(
(query) =>
query.document === ChannelListSoupDocument ||
query.document === ChannelUnreadPresenceDocument
@@ -19,8 +20,10 @@ export async function revalidateChannelLists(
client: Pick<Client, 'query'>
): Promise<void> {
await Promise.all(
- getChannelListRevalidations().map(async ({ document, variables }) => {
+ getChannelListRevalidations(client).map(async ({ document, variables }) => {
try {
+ if (delegateChannelNotificationRefresh(client, { document, variables }))
+ return;
const result = await client
.query(document, variables, { requestPolicy: 'network-only' })
.toPromise();
diff --git a/apps/web/src/lib/queries/soup/graphql/items.test.ts b/apps/web/src/lib/queries/soup/graphql/items.test.ts
index c42176f6f2..6c54941c04 100644
--- a/apps/web/src/lib/queries/soup/graphql/items.test.ts
+++ b/apps/web/src/lib/queries/soup/graphql/items.test.ts
@@ -75,6 +75,10 @@ vi.mock('@queries/client', async () => {
});
import { queryClient } from '@queries/client';
+import {
+ delegateChannelNotificationRefresh,
+ disposeChannelNotificationRefresh,
+} from '../../channel/notification-refresh';
import { getActiveGraphqlSoupRevalidations } from './active-queries';
import { createGraphqlSoupAstItemsQuery } from './items';
import {
@@ -558,6 +562,72 @@ describe('createGraphqlSoupAstItemsQuery', () => {
}
});
+ it('keeps loaded channel pages registered for retry after a transient refresh failure', async () => {
+ vi.useFakeTimers();
+ const visibility = vi
+ .spyOn(document, 'hidden', 'get')
+ .mockReturnValue(false);
+ const fake = makeFakeClient();
+ getGraphqlSoupClientMock.mockReturnValue(fake.client);
+ makeGraphqlSoupInputMock.mockImplementation(({ cursor }) =>
+ cursor ? { continuation: { cursor } } : { initial: { limit: 50 } }
+ );
+ const { query, dispose } = createRoot((dispose) => ({
+ dispose,
+ query: createGraphqlSoupAstItemsQuery(
+ () => ({ params: {}, body: {} }),
+ () => ({ enabled: true, projection: 'channel-list' })
+ ),
+ }));
+ const error = new CombinedError({ networkError: new Error('offline') });
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
+ const pageData = graphqlSoupPage({ items: [], next_cursor: null });
+ const refresh = vi
+ .fn()
+ .mockReturnValueOnce({
+ toPromise: async () => {
+ fake.executions[1].fail(error);
+ return { error };
+ },
+ })
+ .mockReturnValue({
+ toPromise: async () => {
+ fake.executions[1].next(pageData);
+ return { data: pageData };
+ },
+ });
+ fake.client.query = refresh as unknown as Client['query'];
+ try {
+ fake.executions[0].next(
+ graphqlSoupPage({ items: [], next_cursor: 'next' })
+ );
+ const more = query.fetchNextPage();
+ fake.executions[1].next(pageData);
+ await more;
+ const page = getActiveGraphqlSoupRevalidations().find(
+ (entry) => entry.variables?.input?.continuation?.cursor === 'next'
+ )!;
+ expect(delegateChannelNotificationRefresh(fake.client, page)).toBe(true);
+ await vi.advanceTimersByTimeAsync(100);
+ expect(refresh).toHaveBeenCalledOnce();
+ expect(query.error()).toBe(error);
+ await vi.advanceTimersByTimeAsync(1000);
+ expect(refresh).toHaveBeenCalledTimes(2);
+ expect(refresh).toHaveBeenLastCalledWith(page.document, page.variables, {
+ requestPolicy: 'network-only',
+ });
+ expect(query.error()).toBeUndefined();
+ query.resetToInitialPage();
+ expect(delegateChannelNotificationRefresh(fake.client, page)).toBe(false);
+ } finally {
+ dispose();
+ disposeChannelNotificationRefresh(fake.client);
+ warn.mockRestore();
+ visibility.mockRestore();
+ vi.useRealTimers();
+ }
+ });
+
it('registers enabled flat pages for durable replay and drops reset or unmounted pages', async () => {
const fake = makeFakeClient();
getGraphqlSoupClientMock.mockReturnValue(fake.client);
@@ -1228,6 +1298,12 @@ describe('createGraphqlSoupAstItemsQuery', () => {
});
fake.executions[0].fail(unauthorized);
expect(query.error()).toBe(unauthorized);
+ const unavailable = new CombinedError({
+ networkError: new Error('HTTP 503'),
+ response: { status: 503 },
+ });
+ fake.executions[0].fail(unavailable);
+ expect(query.error()).toBe(unavailable);
} else {
expect(query.data()?.cachedMail).not.toBe(true);
expect(query.error()).toBe(offlineError);
diff --git a/apps/web/src/lib/queries/soup/graphql/items.ts b/apps/web/src/lib/queries/soup/graphql/items.ts
index 165858072b..e866e252ad 100644
--- a/apps/web/src/lib/queries/soup/graphql/items.ts
+++ b/apps/web/src/lib/queries/soup/graphql/items.ts
@@ -15,6 +15,7 @@ import {
createUrqlInfiniteQuery,
type UrqlInfiniteData,
} from '@app/lib/urql-solid';
+import { isTransientRequestError } from '@core/util/request-error';
import { Telemetry } from '@macro-inc/observability';
import { useInstructionsMdIdQuery } from '@queries/storage/instructions-md';
import {
@@ -52,6 +53,7 @@ import {
untrack,
} from 'solid-js';
import { NIL as NIL_UUID } from 'uuid';
+import { registerChannelNotificationRefresh } from '../../channel/register-notification-refresh';
import type { SoupAstBody, SoupAstItemsData, SoupAstParams } from '../items';
import { soupPageTimestamp } from '../page-timestamp';
import {
@@ -682,9 +684,38 @@ export function createGraphqlSoupAstItemsQuery(
? [{ document: queryDocument(), variables: { input } }]
: [];
});
- })
+ }, getGraphqlSoupClient)
);
+ registerChannelNotificationRefresh(() => ({
+ client: getGraphqlSoupClient(),
+ // urql retains loaded pages after errors; keep them registered for retry.
+ queries:
+ options().projection === 'channel-list'
+ ? [...new Set([null, ...(query.data?.pageParams ?? [])])].flatMap(
+ (cursor) => {
+ const input = inputForCursor(cursor);
+ return input
+ ? [{ document: queryDocument(), variables: { input } }]
+ : [];
+ }
+ )
+ : [],
+ reader: {
+ enabled: query.isEnabled && !options().networkPaused,
+ fetching: query.isFetching,
+ filtered: true,
+ notificationIds: query.isSuccess
+ ? (query.data?.records() ?? []).flatMap((item) =>
+ item.__typename === 'GraphqlSoupChannel' &&
+ 'unreadNotifications' in item
+ ? (item.unreadNotifications?.map((n) => n.id) ?? [])
+ : []
+ )
+ : [],
+ },
+ }));
+
// Capture membership/sort evidence for each published projection, so a later
// cache revision cannot change the baseline of an in-flight reconciliation.
const serverRecords = createMemo(() =>
@@ -772,9 +803,9 @@ export function createGraphqlSoupAstItemsQuery(
// Keep server responses (including HTTP auth failures), GraphQL errors,
// and failures without current-query local proof visible.
if (
- error?.networkError &&
+ error &&
+ isTransientRequestError(error) &&
!error.response &&
- error.graphQLErrors.length === 0 &&
displayLocalProjection()
) {
return undefined;
@@ -913,6 +944,8 @@ export function createGraphqlSoupAstItemsQuery(
},
refresh: async () => {
if (firstPageInput() === undefined) return;
+ // An explicit list refresh rebuilds the cursor chain in order. The
+ // notification queue observes isFetching and waits for this to finish.
await query.refetch({
requestPolicy: 'network-only',
throwOnError: true,
diff --git a/apps/web/src/lib/queries/soup/items.transport-refetch.test.ts b/apps/web/src/lib/queries/soup/items.transport-refetch.test.ts
index b17e1d4a18..a250ac2d5a 100644
--- a/apps/web/src/lib/queries/soup/items.transport-refetch.test.ts
+++ b/apps/web/src/lib/queries/soup/items.transport-refetch.test.ts
@@ -2,7 +2,10 @@ import { useInfiniteQuery } from '@tanstack/solid-query';
import { createRoot } from 'solid-js';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-const testState = vi.hoisted(() => ({ graphqlEnabled: false }));
+const testState = vi.hoisted(() => ({
+ graphqlEnabled: false,
+ restPending: false,
+}));
const restRefetch = vi.hoisted(() => vi.fn(async () => undefined));
const fetchSoup = vi.hoisted(() => vi.fn());
const flatQuery = vi.hoisted(() => makeGraphqlQuery(false));
@@ -69,6 +72,9 @@ vi.mock('@tanstack/solid-query', () => ({
useInfiniteQuery: vi.fn(() => ({
data: undefined,
error: null,
+ get isPending() {
+ return testState.restPending;
+ },
isLoading: false,
isFetching: false,
isPlaceholderData: false,
@@ -100,19 +106,22 @@ import {
let disposeRoot: (() => void) | undefined;
-function mountAutoTransportQuery(): SoupAstItemsQuery {
+function mountAutoTransportQuery(networkPaused = false): SoupAstItemsQuery {
let query: SoupAstItemsQuery | undefined;
createRoot((dispose) => {
disposeRoot = dispose;
- query = useSoupAstItemsQuery(() => ({
- params: {},
- body: {},
- groupBy: {
- type: 'property',
- propertyDefinitionId: 'priority',
- entityType: 'TASK',
- },
- }));
+ query = useSoupAstItemsQuery(
+ () => ({
+ params: {},
+ body: {},
+ groupBy: {
+ type: 'property',
+ propertyDefinitionId: 'priority',
+ entityType: 'TASK',
+ },
+ }),
+ () => ({ networkPaused })
+ );
});
return query!;
}
@@ -120,6 +129,7 @@ function mountAutoTransportQuery(): SoupAstItemsQuery {
describe('Soup refetch transport selection', () => {
beforeEach(() => {
testState.graphqlEnabled = false;
+ testState.restPending = false;
vi.clearAllMocks();
});
@@ -128,6 +138,30 @@ describe('Soup refetch transport selection', () => {
disposeRoot = undefined;
});
+ it('exposes paused REST requests as pending even when they are not loading', () => {
+ testState.restPending = true;
+ const query = mountAutoTransportQuery();
+ expect(query.isLoading).toBe(false);
+ expect(query.isPending).toBe(true);
+ });
+
+ it('keeps paused GraphQL requests pending until data or an error arrives, unless disabled', () => {
+ testState.graphqlEnabled = true;
+ const query = mountAutoTransportQuery(true);
+ expect(query.transport).toBe('graphql');
+ expect(query.isLoading).toBe(false);
+ expect(query.isPending).toBe(true);
+
+ groupedQuery.data.mockReturnValueOnce({ entities: [] });
+ expect(query.isPending).toBe(false);
+
+ groupedQuery.error.mockReturnValueOnce(new Error('Request failed'));
+ expect(query.isPending).toBe(false);
+
+ groupedQuery.isEnabled.mockReturnValueOnce(false);
+ expect(query.isPending).toBe(false);
+ });
+
it('forwards the channel list projection only to the flat GraphQL query', () => {
createRoot((dispose) => {
disposeRoot = dispose;
diff --git a/apps/web/src/lib/queries/soup/items.ts b/apps/web/src/lib/queries/soup/items.ts
index a073520058..46c3e95b72 100644
--- a/apps/web/src/lib/queries/soup/items.ts
+++ b/apps/web/src/lib/queries/soup/items.ts
@@ -346,6 +346,8 @@ export type SoupAstItemsQueryTransport = 'rest' | 'graphql';
export type SoupAstItemsQuery = {
readonly data: SoupAstItemsData | undefined;
readonly error: Error | null;
+ /** Includes paused initial requests, whose data resource is not readable yet. */
+ readonly isPending: boolean;
readonly isLoading: boolean;
readonly isFetching: boolean;
readonly isPlaceholderData: boolean;
@@ -459,6 +461,14 @@ export function useSoupAstItemsQuery(
? (activeGraphqlQuery().error() ?? null)
: (restQuery.error ?? null);
},
+ get isPending() {
+ if (!usesGraphql()) return restQuery.isPending;
+ const query = activeGraphqlQuery();
+ return (
+ query.isLoading() ||
+ (query.isEnabled() && query.data() === undefined && !query.error())
+ );
+ },
get isLoading() {
return usesGraphql()
? activeGraphqlQuery().isLoading()
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts
index 61fd098381..12033cce0e 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.test.ts
@@ -6,6 +6,10 @@ import type { CacheHost } from '@graphql-cache/host/types';
import { parseCacheRevision } from '@graphql-cache/protocol';
import type { Client, Operation } from '@urql/core';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
+import {
+ channelNotificationRefresh,
+ disposeChannelNotificationRefresh,
+} from '../../queries/channel/notification-refresh';
import { registerGraphqlSoupRevalidations } from '../../queries/soup/graphql/active-queries';
import {
ChannelListSoupDocument,
@@ -46,12 +50,21 @@ function setup() {
},
])
);
- const handler = createChannelListUpdatesHandler({ query } as unknown as Pick<
- Client,
- 'query'
- >);
+ const client = { query } as unknown as Client;
+ const coordinator = channelNotificationRefresh(client);
+ cleanup.push(
+ coordinator.register(
+ {
+ document: ChannelListSoupDocument,
+ variables: { input: { initial: { limit: 100 } } },
+ },
+ { enabled: true, fetching: false, filtered: true, notificationIds: [] }
+ )
+ );
+ cleanup.push(() => disposeChannelNotificationRefresh(client));
+ const handler = createChannelListUpdatesHandler(client);
cleanup.push(handler.dispose);
- return { handler, query };
+ return { handler, query, client, coordinator };
}
const deleted: GraphqlNotificationPatch = {
@@ -88,7 +101,7 @@ const newNotification: GraphqlNotificationPatch = {
};
function setupCached() {
- const { query } = setup();
+ const { query, client, coordinator } = setup();
const writeResult = {
revision: parseCacheRevision('1'),
revisionAdvanced: true,
@@ -106,11 +119,11 @@ function setupCached() {
),
};
const handler = createChannelListUpdatesHandler(
- { query } as unknown as Client,
+ client,
host as unknown as CacheHost
);
cleanup.push(handler.dispose);
- return { handler, query, host, writeResult };
+ return { handler, query, host, writeResult, coordinator };
}
describe('channel unread edge revalidation', () => {
@@ -119,17 +132,18 @@ describe('channel unread edge revalidation', () => {
await handler.onPatch(newNotification);
expect(host.writeQuery).toHaveBeenCalledOnce();
expect(query).not.toHaveBeenCalled();
- await vi.advanceTimersByTimeAsync(299);
+ await vi.advanceTimersByTimeAsync(99);
expect(query).not.toHaveBeenCalled();
await vi.advanceTimersByTimeAsync(1);
expect(query).toHaveBeenCalledOnce();
});
- it('falls back immediately if a local cache write fails', async () => {
+ it('reconciles even if a local cache write fails', async () => {
const { handler, query, host } = setupCached();
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
host.writeQuery.mockRejectedValue(new Error('cache unavailable'));
await handler.onPatch(newNotification);
+ await vi.advanceTimersByTimeAsync(100);
expect(query).toHaveBeenCalledOnce();
expect(warn).toHaveBeenCalledOnce();
});
@@ -161,14 +175,21 @@ describe('channel unread edge revalidation', () => {
expect(host.writeQuery).not.toHaveBeenCalled();
expect(query).not.toHaveBeenCalled();
});
- it('refreshes channel dots and the Chat badge immediately on a new notification', async () => {
- const { handler, query } = setup();
+ it('batches refreshes for channel dots and the Chat badge', async () => {
+ const { handler, query, coordinator } = setup();
+ cleanup.push(
+ coordinator.register(
+ { document: ChannelUnreadPresenceDocument, variables: { input: {} } },
+ { enabled: true, fetching: false, filtered: true, notificationIds: [] }
+ )
+ );
cleanup.push(
registerGraphqlSoupRevalidations(() => [
{ document: ChannelUnreadPresenceDocument, variables: { input: {} } },
])
);
handler.onPatch(newNotification);
+ await vi.advanceTimersByTimeAsync(100);
expect(query).toHaveBeenCalledTimes(2);
expect(query.mock.calls.map(([document]) => document)).toEqual([
ChannelListSoupDocument,
@@ -178,12 +199,13 @@ describe('channel unread edge revalidation', () => {
expect(query).toHaveBeenCalledTimes(2);
});
- it('replaces a pending debounce with an immediate new-notification refresh', async () => {
+ it('coalesces new notifications with pending deletions', async () => {
const { handler, query } = setup();
handler.onPatch(deleted);
- await vi.advanceTimersByTimeAsync(100);
+ await vi.advanceTimersByTimeAsync(50);
expect(query).not.toHaveBeenCalled();
handler.onPatch(newNotification);
+ await vi.advanceTimersByTimeAsync(50);
expect(query).toHaveBeenCalledOnce();
await vi.advanceTimersByTimeAsync(1000);
expect(query).toHaveBeenCalledOnce();
@@ -197,12 +219,13 @@ describe('channel unread edge revalidation', () => {
});
query.mockImplementationOnce(() => ({ toPromise: () => pending }));
handler.onPatch(newNotification);
+ await vi.advanceTimersByTimeAsync(100);
handler.onPatch(newNotification);
handler.onPatch(deleted);
await vi.advanceTimersByTimeAsync(1000);
expect(query).toHaveBeenCalledOnce();
finish?.();
- await vi.advanceTimersByTimeAsync(299);
+ await vi.advanceTimersByTimeAsync(99);
expect(query).toHaveBeenCalledOnce();
await vi.advanceTimersByTimeAsync(1);
expect(query).toHaveBeenCalledTimes(2);
@@ -263,8 +286,8 @@ describe('channel unread edge revalidation', () => {
]);
});
- it('defers hidden-tab work and cancels scheduled work on disposal', async () => {
- const { handler, query } = setup();
+ it('defers hidden-tab work and cancels scheduled work on client disposal', async () => {
+ const { handler, query, client } = setup();
vi.spyOn(document, 'hidden', 'get').mockReturnValue(true);
handler.onPatch(deleted);
await vi.advanceTimersByTimeAsync(1000);
@@ -275,6 +298,7 @@ describe('channel unread edge revalidation', () => {
expect(query).toHaveBeenCalledOnce();
handler.reconnect();
handler.dispose();
+ disposeChannelNotificationRefresh(client);
await vi.advanceTimersByTimeAsync(1000);
expect(query).toHaveBeenCalledOnce();
});
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.ts b/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.ts
index 3f264c48e0..110cb4374e 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-channel-list-updates.ts
@@ -1,7 +1,7 @@
import type { CacheHost } from '@graphql-cache/host/types';
import { cacheNewChannelUnread } from '@queries/channel/unread-cache';
import type { Client } from '@urql/core';
-import { revalidateChannelLists } from '../../queries/soup/graphql/channel-list-revalidation';
+import { channelNotificationRefresh } from '../../queries/channel/notification-refresh';
import type { GraphqlNotificationPatch } from './graphql-soup-websocket';
/** Patch delivered unread evidence locally, then reconcile bounded edges. */
@@ -10,47 +10,15 @@ export function createChannelListUpdatesHandler(
host?: CacheHost
) {
const cache = host?.disabled ? undefined : host;
+ const coordinator = channelNotificationRefresh(client);
let cacheGeneration = 0;
const unsubscribeGeneration = cache?.onCacheGenerationChanged(() => {
cacheGeneration += 1;
+ coordinator.reset();
});
let pendingPatch = Promise.resolve();
- let timer: ReturnType<typeof setTimeout> | undefined;
- let dirty = false;
- let running = false;
let disposed = false;
- const flush = async () => {
- timer = undefined;
- if (disposed || running || document.hidden || !dirty) return;
- running = true;
- dirty = false;
- try {
- await revalidateChannelLists(client);
- } finally {
- running = false;
- if (dirty) schedule();
- }
- };
- const schedule = (immediate = false) => {
- if (disposed) return;
- dirty = true;
- if (running || document.hidden) return;
- if (timer !== undefined) {
- if (!immediate) return;
- clearTimeout(timer);
- timer = undefined;
- }
- // A new notification should light the dot without the debounce delay.
- // Deliveries during this refresh still coalesce into one trailing refresh.
- if (immediate) void flush();
- else timer = setTimeout(flush, 300);
- };
- const visible = () => {
- if (dirty && !document.hidden) schedule();
- };
- document.addEventListener('visibilitychange', visible);
-
const applyNewNotification = async (
previous: Promise<void>,
patch: Extract<
@@ -62,27 +30,19 @@ export function createChannelListUpdatesHandler(
await previous;
const isCurrent = () => !disposed && generation === cacheGeneration;
if (!cache || !isCurrent()) return;
- let patched = false;
try {
- patched = await cacheNewChannelUnread(
- cache,
- patch.notification,
- isCurrent
- );
+ await cacheNewChannelUnread(cache, patch.notification, isCurrent);
} catch (error) {
console.warn('Failed to cache channel unread notification', error);
}
- // Local dots no longer await this request. Keep reconciliation for bounded
- // witnesses, unknown/cold channels, and missed updates; failures fall back
- // immediately to the existing network path.
- schedule(!patched);
+ if (isCurrent()) coordinator.onPatch(patch, true);
};
return {
- onPatch(patch: GraphqlNotificationPatch) {
+ onPatch(patch: GraphqlNotificationPatch, normalized = false) {
if (disposed) return;
if (patch.__typename === 'GraphqlCacheDeletion') {
- schedule();
+ coordinator.onPatch(patch, normalized);
return;
}
if (patch.notification.entityType !== 'CHANNEL') return;
@@ -96,13 +56,11 @@ export function createChannelListUpdatesHandler(
);
return pendingPatch;
}
- schedule(patch.__typename === 'GraphqlNewNotification');
+ coordinator.onPatch(patch, normalized);
},
- reconnect: () => schedule(),
+ reconnect: () => coordinator.reconnect(),
dispose() {
disposed = true;
- if (timer !== undefined) clearTimeout(timer);
- document.removeEventListener('visibilitychange', visible);
unsubscribeGeneration?.();
},
};
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-mutation-retry.ts b/apps/web/src/lib/service-clients/service-storage/graphql-mutation-retry.ts
index 8099e3a755..6f22a4da17 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-mutation-retry.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-mutation-retry.ts
@@ -1,3 +1,4 @@
+import { isTransientRequestError } from '@core/util/request-error';
import type { CombinedError } from '@urql/core';
/** Keep uncertain writes queued; application errors require explicit server opt-in. */
@@ -7,6 +8,5 @@ export function shouldRetryGraphqlMutation(error: CombinedError): boolean {
(error) => error.extensions.retryable === true
);
}
- const status = error.response?.status;
- return error.networkError != null && (status == null || status >= 500);
+ return isTransientRequestError(error);
}
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.ts b/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.ts
index cc9d144fb0..3e140c14e9 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-soup-websocket.ts
@@ -1,6 +1,11 @@
import { toast } from '@core/component/Toast/Toast';
+import { normalizedCacheResultMetadata } from '@graphql-cache/exchange/normalized-cache-exchange';
import type { CacheHost } from '@graphql-cache/host/types';
import type { Client, OperationResult } from '@urql/core';
+import {
+ channelNotificationRefresh,
+ disposeChannelNotificationRefresh,
+} from '../../queries/channel/notification-refresh';
import {
ActivityUpdatesDocument,
type ActivityUpdatesSubscription,
@@ -151,6 +156,7 @@ export function createGraphqlSoupSubscriptionsLifecycle(
const onPagehide = () => {
suspended = true;
+ if (currentClient) channelNotificationRefresh(currentClient).suspend(true);
// The graphql-ws client is lazy: removing all subscriptions closes the
// socket without permanently disposing it, so it can reconnect on restore.
unsubscribeAll();
@@ -158,6 +164,7 @@ export function createGraphqlSoupSubscriptionsLifecycle(
const onPageshow = (event: PageTransitionEvent) => {
if (!event.persisted || !suspended) return;
suspended = false;
+ if (currentClient) channelNotificationRefresh(currentClient).suspend(false);
lifecycle.replace(currentClient, currentHost);
};
if (options.suspendOnPagehide) {
@@ -167,6 +174,8 @@ export function createGraphqlSoupSubscriptionsLifecycle(
const lifecycle = {
replace(client?: Pick<Client, 'subscription' | 'query'>, host?: CacheHost) {
+ if (currentClient && currentClient !== client)
+ disposeChannelNotificationRefresh(currentClient);
currentClient = client;
currentHost = host;
unsubscribeAll();
@@ -199,7 +208,12 @@ export function createGraphqlSoupSubscriptionsLifecycle(
const patch = (result.data as NotificationUpdatesSubscription)
.notificationUpdates;
publishNotificationPatch(patch);
- void channelHandler.onPatch(patch);
+ const metadata = normalizedCacheResultMetadata(result);
+ void channelHandler.onPatch(
+ patch,
+ metadata?.source === 'live-network' &&
+ metadata.cacheEffectsApplied === true
+ );
}
if (result.error) {
console.warn(errorMessage, result.error);
@@ -223,6 +237,7 @@ export function createGraphqlSoupSubscriptionsLifecycle(
removeEventListener('pagehide', onPagehide);
removeEventListener('pageshow', onPageshow);
}
+ if (currentClient) disposeChannelNotificationRefresh(currentClient);
currentClient = undefined;
currentHost = undefined;
unsubscribeAll();
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts b/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
index 73c9f24bd6..72c4eec347 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-soup.ts
@@ -51,6 +51,7 @@ import {
type Client as GraphqlWsClient,
} from 'graphql-ws';
import { match } from 'ts-pattern';
+import { delegateChannelNotificationRefresh } from '../../queries/channel/notification-refresh';
import type { SoupApiItem } from './generated/schemas/soupApiItem';
import type { SoupCalendarEventSoupPropertiesField } from './generated/schemas/soupCalendarEventSoupPropertiesField';
import type { SoupCalendarEventTime } from './generated/schemas/soupCalendarEventTime';
@@ -498,6 +499,7 @@ export function getGraphqlSoupClient(): Client {
// Preserve the optimistic layer on transport failures and on
// application failures the server explicitly allows us to retry.
shouldRetryMutation: shouldRetryGraphqlMutation,
+ delegateRevalidation: delegateChannelNotificationRefresh,
}),
graphqlSoupSubscriptionExchange(graphqlWsClient),
fetchExchange,
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-update-notifications.ts b/apps/web/src/lib/service-clients/service-storage/graphql-update-notifications.ts
index 2e657bdb93..197fb1bc3b 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-update-notifications.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-update-notifications.ts
@@ -106,7 +106,10 @@ export async function executeGraphqlUpdateNotifications(
UpdateNotificationsDocument,
variables,
optimisticData,
- { uuid: crypto.randomUUID(), revalidations: getChannelListRevalidations() }
+ {
+ uuid: crypto.randomUUID(),
+ revalidations: getChannelListRevalidations(client),
+ }
).toPromise();
// A retryable transport failure keeps the normalized optimistic layer in
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.graphql
index 15cf963857..bd719ebdce 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.graphql
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.graphql
@@ -16,7 +16,7 @@ fragment ChannelListItemFields on GraphqlSoupEntity {
unreadNotifications: notifications(
filter: {
states: [UNSEEN]
- eventTypes: ["channel_mention", "channel_message_send", "channel_message_reply", "document_mention"]
+ topLevelMessagesOnly: true
}
limit: 1
) {
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.test.ts
index dedb3635ac..a7bd75bcbb 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.test.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/channel-list.test.ts
@@ -21,7 +21,7 @@ describe('bounded channel unread projection', () => {
field.arguments?.find((arg) => arg.name.value === 'limit')?.value
).toMatchObject({ kind: Kind.INT, value: '1' });
expect(print(field)).toContain('states: [UNSEEN]');
- expect(print(field)).toContain('channel_message_reply');
+ expect(print(field)).toContain('topLevelMessagesOnly: true');
expect(print(field)).not.toContain('metadata');
},
});
@@ -50,7 +50,7 @@ describe('bounded channel unread projection', () => {
expect(field.alias?.value).toBe('unreadNotifications');
expect(print(field)).toContain('limit: 1');
expect(print(field)).toContain('states: [UNSEEN]');
- expect(print(field)).toContain('channel_message_reply');
+ expect(print(field)).toContain('topLevelMessagesOnly: true');
},
});
expect(new Set(fields)).toEqual(
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread-cache-write.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread-cache-write.graphql
index 8f23f439b9..6c65385ad2 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread-cache-write.graphql
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread-cache-write.graphql
@@ -22,7 +22,7 @@ subscription ChannelUnreadCacheWrite {
unreadNotifications: notifications(
filter: {
states: [UNSEEN]
- eventTypes: ["channel_mention", "channel_message_send", "channel_message_reply", "document_mention"]
+ topLevelMessagesOnly: true
}
limit: 1
) {
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread.graphql b/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread.graphql
index 99ef1a5352..826e49b5ea 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread.graphql
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/channel-unread.graphql
@@ -10,7 +10,7 @@ query ChannelUnreadPresence($input: SoupInput!) {
unreadNotifications: notifications(
filter: {
states: [UNSEEN]
- eventTypes: ["channel_mention", "channel_message_send", "channel_message_reply", "document_mention"]
+ topLevelMessagesOnly: true
}
limit: 1
) {
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
index 76f062fb09..0cc9b56256 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql/generated/graphql.ts
@@ -14334,7 +14334,7 @@ export const SoupPropertyFieldsFragmentDoc = {"kind":"Document","definitions":[{
export const MailPreviewFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}}]} as unknown as DocumentNode<MailPreviewFieldsFragment, unknown>;
export const SoupChannelMessageFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}}]} as unknown as DocumentNode<SoupChannelMessageFieldsFragment, unknown>;
export const SoupItemPreviewFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"descriptionDocumentId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupReminder"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"scheduleType"}},{"kind":"Field","name":{"kind":"Name","value":"remindAt"}},{"kind":"Field","name":{"kind":"Name","value":"cron"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"nextRunAt"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"referencedEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"subType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}}]} as unknown as DocumentNode<SoupItemPreviewFieldsFragment, unknown>;
-export const ChannelListItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChannelListItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"eventTypes"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"channel_mention","block":false},{"kind":"StringValue","value":"channel_message_send","block":false},{"kind":"StringValue","value":"channel_message_reply","block":false},{"kind":"StringValue","value":"document_mention","block":false}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"descriptionDocumentId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupReminder"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"scheduleType"}},{"kind":"Field","name":{"kind":"Name","value":"remindAt"}},{"kind":"Field","name":{"kind":"Name","value":"cron"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"nextRunAt"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"referencedEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"subType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}}]} as unknown as DocumentNode<ChannelListItemFieldsFragment, unknown>;
+export const ChannelListItemFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChannelListItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"topLevelMessagesOnly"},"value":{"kind":"BooleanValue","value":true}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"descriptionDocumentId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupReminder"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"scheduleType"}},{"kind":"Field","name":{"kind":"Name","value":"remindAt"}},{"kind":"Field","name":{"kind":"Name","value":"cron"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"nextRunAt"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"referencedEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"subType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}}]} as unknown as DocumentNode<ChannelListItemFieldsFragment, unknown>;
export const SoupNotificationStateFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}}]} as unknown as DocumentNode<SoupNotificationStateFieldsFragment, unknown>;
export const SoupNotificationNavigationMetadataFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}}]} as unknown as DocumentNode<SoupNotificationNavigationMetadataFieldsFragment, unknown>;
export const ChannelListNotificationFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChannelListNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}}]} as unknown as DocumentNode<ChannelListNotificationFieldsFragment, unknown>;
@@ -14371,10 +14371,10 @@ export const AgentSessionMentionsDocument = {"kind":"Document","definitions":[{"
export const RecordChannelActivityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"RecordChannelActivity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"RecordChannelActivityInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"recordChannelActivity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}}]}}]}}]} as unknown as DocumentNode<RecordChannelActivityMutation, RecordChannelActivityMutationVariables>;
export const UpdateNotificationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNotifications"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateNotificationsInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateNotifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationMetadataFields"}}]}}]}}]} as unknown as DocumentNode<UpdateNotificationsMutation, UpdateNotificationsMutationVariables>;
export const UpdateNotificationsForEntityDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateNotificationsForEntity"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateNotificationsForEntityInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateNotificationsForEntity"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationStateFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"eventType"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"sent"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDocumentMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentMentionDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"documentMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMentionedInDocumentCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentMentionId"},"name":{"kind":"Name","value":"mentionId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"mentionedInDocumentCommentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlRepliedToDocumentCommentThreadMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"repliedToDocumentCommentThreadSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCommentedOnDocumentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentDocumentName"},"name":{"kind":"Name","value":"documentName"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentFileType"},"name":{"kind":"Name","value":"fileType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentCommentId"},"name":{"kind":"Name","value":"commentId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"commentedOnDocumentSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInitiativeDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionProjectName"},"name":{"kind":"Name","value":"projectName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"initiativeDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCrmDiscussionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionRecordName"},"name":{"kind":"Name","value":"recordName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionReason"},"name":{"kind":"Name","value":"reason"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionText"},"name":{"kind":"Name","value":"text"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"crmDiscussionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelInviteMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelInviteInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelInviteSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageReactionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionEmoji"},"name":{"kind":"Name","value":"emoji"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelType"},"name":{"kind":"Name","value":"channelType"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageReactionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageId"},"name":{"kind":"Name","value":"messageId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyUserId"},"name":{"kind":"Name","value":"userId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyThreadParentSenderId"},"name":{"kind":"Name","value":"threadParentSenderId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelType"},"name":{"kind":"Name","value":"channelType"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCallStartedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callStartedChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"callStartedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNewEmailMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"newEmailSender"},"name":{"kind":"Name","value":"sender"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailToEmail"},"name":{"kind":"Name","value":"toEmail"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailThreadId"},"name":{"kind":"Name","value":"threadId"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSubject"},"name":{"kind":"Name","value":"subject"}},{"kind":"Field","alias":{"kind":"Name","value":"newEmailSnippet"},"name":{"kind":"Name","value":"snippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInboxReauthRequiredMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inboxReauthRequiredEmailAddress"},"name":{"kind":"Name","value":"emailAddress"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlInviteToTeamMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamName"},"name":{"kind":"Name","value":"teamName"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamTeamInviteId"},"name":{"kind":"Name","value":"teamInviteId"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamInvitedBy"},"name":{"kind":"Name","value":"invitedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamRole"},"name":{"kind":"Name","value":"role"}},{"kind":"Field","alias":{"kind":"Name","value":"inviteToTeamSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskAssignedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskId"},"name":{"kind":"Name","value":"taskId"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedTaskName"},"name":{"kind":"Name","value":"taskName"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSubType"},"name":{"kind":"Name","value":"subType"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedAssignedBy"},"name":{"kind":"Name","value":"assignedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"taskAssignedSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderReminderId"},"name":{"kind":"Name","value":"reminderId"}},{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlCalendarEventReminderMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEventId"},"name":{"kind":"Name","value":"eventId"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderOccurrenceKey"},"name":{"kind":"Name","value":"occurrenceKey"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartsAt"},"name":{"kind":"Name","value":"startsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderEndsAt"},"name":{"kind":"Name","value":"endsAt"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderStartDate"},"name":{"kind":"Name","value":"startDate"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderTimeZone"},"name":{"kind":"Name","value":"timeZone"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventReminderMinutesBefore"},"name":{"kind":"Name","value":"minutesBefore"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAiResponseMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"aiResponseSummary"},"name":{"kind":"Name","value":"summary"}},{"kind":"Field","alias":{"kind":"Name","value":"aiResponseMessageId"},"name":{"kind":"Name","value":"messageId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrStatusChangedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedAction"},"name":{"kind":"Name","value":"action"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedPreviousStatus"},"name":{"kind":"Name","value":"previousStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedHeadBranch"},"name":{"kind":"Name","value":"headBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedBaseBranch"},"name":{"kind":"Name","value":"baseBranch"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrStatusChangedMergedAt"},"name":{"kind":"Name","value":"mergedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCheckRunMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckRunGithubId"},"name":{"kind":"Name","value":"checkRunGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckName"},"name":{"kind":"Name","value":"checkName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckStatus"},"name":{"kind":"Name","value":"checkStatus"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunConclusion"},"name":{"kind":"Name","value":"conclusion"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCheckUrl"},"name":{"kind":"Name","value":"checkUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCheckRunCompletedAt"},"name":{"kind":"Name","value":"completedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubReviewRequestedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubLogin"},"name":{"kind":"Name","value":"requestedReviewerGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubReviewRequestedRequestedReviewerGithubUserId"},"name":{"kind":"Name","value":"requestedReviewerGithubUserId"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrCommentMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentKind"},"name":{"kind":"Name","value":"commentKind"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrCommentCommentSnippet"},"name":{"kind":"Name","value":"commentSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionLocation"},"name":{"kind":"Name","value":"location"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentGithubId"},"name":{"kind":"Name","value":"commentGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionCommentUrl"},"name":{"kind":"Name","value":"commentUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrMentionTextSnippet"},"name":{"kind":"Name","value":"textSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlGithubPrReviewMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewForeignEntityId"},"name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewGithubKey"},"name":{"kind":"Name","value":"githubKey"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewOwner"},"name":{"kind":"Name","value":"owner"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewRepo"},"name":{"kind":"Name","value":"repo"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewNumber"},"name":{"kind":"Name","value":"number"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewUrl"},"name":{"kind":"Name","value":"url"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewDisplayName"},"name":{"kind":"Name","value":"displayName"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubLogin"},"name":{"kind":"Name","value":"senderGithubLogin"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubUserId"},"name":{"kind":"Name","value":"senderGithubUserId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewSenderGithubAvatarUrl"},"name":{"kind":"Name","value":"senderGithubAvatarUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewGithubId"},"name":{"kind":"Name","value":"reviewGithubId"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewUrl"},"name":{"kind":"Name","value":"reviewUrl"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewState"},"name":{"kind":"Name","value":"state"}},{"kind":"Field","alias":{"kind":"Name","value":"githubPrReviewReviewSnippet"},"name":{"kind":"Name","value":"reviewSnippet"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionSettledMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledActor"},"name":{"kind":"Name","value":"actor"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledStopReason"},"name":{"kind":"Name","value":"stopReason"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionSettledExcerpt"},"name":{"kind":"Name","value":"excerpt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionWaitingForInputMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputTurn"},"name":{"kind":"Name","value":"turn"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionWaitingForInputQuestion"},"name":{"kind":"Name","value":"question"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAgentSessionMentionedMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedSession"},"name":{"kind":"Name","value":"session"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sessionId"}},{"kind":"Field","name":{"kind":"Name","value":"sessionName"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"botName"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"announcementMessageId"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedMentionedBy"},"name":{"kind":"Name","value":"mentionedBy"}},{"kind":"Field","alias":{"kind":"Name","value":"agentSessionMentionedActionId"},"name":{"kind":"Name","value":"actionId"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationMetadataFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotifEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationNavigationMetadataFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMentionMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMentionHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMentionSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelMessageSendMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendMessageContent"},"name":{"kind":"Name","value":"messageContent"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelMessageSendSenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlChannelReplyMetadata"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelReplyHasAttachments"},"name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderDisplayName"},"name":{"kind":"Name","value":"senderDisplayName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplyChannelName"},"name":{"kind":"Name","value":"channelName"}},{"kind":"Field","alias":{"kind":"Name","value":"channelReplySenderProfilePictureUrl"},"name":{"kind":"Name","value":"senderProfilePictureUrl"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupNotificationFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNotification"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationStateFields"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupNotificationMetadataFields"}}]}}]}}]} as unknown as DocumentNode<UpdateNotificationsForEntityMutation, UpdateNotificationsForEntityMutationVariables>;
-export const ChannelListSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ChannelListSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"emailLinks"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"emailAddress"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChannelListItemFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"descriptionDocumentId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupReminder"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"scheduleType"}},{"kind":"Field","name":{"kind":"Name","value":"remindAt"}},{"kind":"Field","name":{"kind":"Name","value":"cron"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"nextRunAt"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"referencedEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"subType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChannelListItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"eventTypes"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"channel_mention","block":false},{"kind":"StringValue","value":"channel_message_send","block":false},{"kind":"StringValue","value":"channel_message_reply","block":false},{"kind":"StringValue","value":"document_mention","block":false}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode<ChannelListSoupQuery, ChannelListSoupQueryVariables>;
+export const ChannelListSoupDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ChannelListSoup"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"emailLinks"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"emailAddress"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ChannelListItemFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"nextCursor"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupEntityIdentityFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"isFavorited"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupPropertyFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlProperty"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"propertyDefinitionId"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"isMultiSelect"}},{"kind":"Field","name":{"kind":"Name","value":"specificEntityType"}},{"kind":"Field","name":{"kind":"Name","value":"isSystem"}},{"kind":"Field","name":{"kind":"Name","value":"isMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"value"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlBooleanPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"boolValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlNumberPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"numberValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlStringPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"stringValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlDatePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"dateValue"},"name":{"kind":"Name","value":"value"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSelectOptionPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"optionIds"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlEntityReferencePropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"references"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"entityId"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"specificMessageId"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlLinkPropertyValue"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"urls"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"MailPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlMailPreviewMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupChannelMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessagePreview"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"mentions"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SoupItemPreviewFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"cacheProjection"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}]},{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupEntityIdentityFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupAgentSession"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"sessionName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"isArchived"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"botId"}},{"kind":"Field","name":{"kind":"Name","value":"harness"}},{"kind":"Field","name":{"kind":"Name","value":"repoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"repoBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestUrl"}},{"kind":"Field","name":{"kind":"Name","value":"workingBranch"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestState"}},{"kind":"Field","name":{"kind":"Name","value":"pullRequestId"}},{"kind":"Field","name":{"kind":"Name","value":"turnState"}},{"kind":"Field","name":{"kind":"Name","value":"bot"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"avatarUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"frecencyScore"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupInitiative"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"descriptionDocumentId"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewerPermission"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlAccessLevelPermission"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"accessLevel"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupDocument"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"documentName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"subType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlTaskSubType"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"isCompleted"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChat"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"chatName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"model"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"isPersistent"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupProject"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"projectName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailThread"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"latestInboundMessageTs"}},{"kind":"Field","name":{"kind":"Name","value":"mailAllPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailDraftPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"mailSentPreview"},"directives":[{"kind":"Directive","name":{"kind":"Name","value":"cacheOnly"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"MailPreviewFields"}}]}},{"kind":"Field","alias":{"kind":"Name","value":"emailName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"senderEmail"}},{"kind":"Field","name":{"kind":"Name","value":"senderName"}},{"kind":"Field","name":{"kind":"Name","value":"senderPhotoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"isImportant"}},{"kind":"Field","name":{"kind":"Name","value":"isSignal"}},{"kind":"Field","name":{"kind":"Name","value":"projectId"}},{"kind":"Field","name":{"kind":"Name","value":"sortTs"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"sfsPhotoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"messageId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"messageListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"labelListVisibility"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"channelName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"channelType"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"organizationId"}},{"kind":"Field","alias":{"kind":"Name","value":"channelTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"interactedAt"}},{"kind":"Field","name":{"kind":"Name","value":"isParticipant"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"role"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"latestNonThreadMessage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupChannelMessageFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannelMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"senderId"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"effectiveUpdatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"replyCount"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCall"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"callChannelId"},"name":{"kind":"Name","value":"channelId"}},{"kind":"Field","name":{"kind":"Name","value":"channelName"}},{"kind":"Field","name":{"kind":"Name","value":"createdBy"}},{"kind":"Field","name":{"kind":"Name","value":"customName"}},{"kind":"Field","name":{"kind":"Name","value":"summary"}},{"kind":"Field","name":{"kind":"Name","value":"startedAt"}},{"kind":"Field","name":{"kind":"Name","value":"endedAt"}},{"kind":"Field","name":{"kind":"Name","value":"durationMs"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"attended"}},{"kind":"Field","name":{"kind":"Name","value":"participants"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userId"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"guests"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"joinedAt"}},{"kind":"Field","name":{"kind":"Name","value":"leftAt"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCrmCompany"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"crmTeamId"},"name":{"kind":"Name","value":"teamId"}},{"kind":"Field","alias":{"kind":"Name","value":"crmCompanyName"},"name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"emailSync"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewedAt"}},{"kind":"Field","name":{"kind":"Name","value":"domains"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupForeignEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"foreignEntityId"}},{"kind":"Field","name":{"kind":"Name","value":"foreignEntitySource"}},{"kind":"Field","name":{"kind":"Name","value":"storedForId"}},{"kind":"Field","name":{"kind":"Name","value":"storedForAuthEntity"}},{"kind":"Field","name":{"kind":"Name","value":"sourceMetadata"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupReminder"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"reminderDescription"},"name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"scheduleType"}},{"kind":"Field","name":{"kind":"Name","value":"remindAt"}},{"kind":"Field","name":{"kind":"Name","value":"cron"}},{"kind":"Field","name":{"kind":"Name","value":"timezone"}},{"kind":"Field","name":{"kind":"Name","value":"nextRunAt"}},{"kind":"Field","name":{"kind":"Name","value":"enabled"}},{"kind":"Field","name":{"kind":"Name","value":"completedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"referencedEntity"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"entityType"}},{"kind":"Field","name":{"kind":"Name","value":"fileType"}},{"kind":"Field","name":{"kind":"Name","value":"subType"}}]}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupCalendarEvent"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"calendarEventTitle"},"name":{"kind":"Name","value":"title"}},{"kind":"Field","alias":{"kind":"Name","value":"calendarEventStatus"},"name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"time"}},{"kind":"Field","name":{"kind":"Name","value":"conferenceUrl"}},{"kind":"Field","name":{"kind":"Name","value":"isReadOnly"}},{"kind":"Field","name":{"kind":"Name","value":"ownerId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupPropertyFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ChannelListItemFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEntity"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SoupItemPreviewFields"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"topLevelMessagesOnly"},"value":{"kind":"BooleanValue","value":true}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]} as unknown as DocumentNode<ChannelListSoupQuery, ChannelListSoupQueryVariables>;
export const ChannelUnreadMembershipCacheWriteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ChannelUnreadMembershipCacheWrite"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]}}]}}]} as unknown as DocumentNode<ChannelUnreadMembershipCacheWriteQuery, ChannelUnreadMembershipCacheWriteQueryVariables>;
-export const ChannelUnreadCacheWriteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"ChannelUnreadCacheWrite"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"soupUpdates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"eventTypes"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"channel_mention","block":false},{"kind":"StringValue","value":"channel_message_send","block":false},{"kind":"StringValue","value":"channel_message_reply","block":false},{"kind":"StringValue","value":"document_mention","block":false}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ChannelUnreadCacheWriteSubscription, ChannelUnreadCacheWriteSubscriptionVariables>;
-export const ChannelUnreadPresenceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ChannelUnreadPresence"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"eventTypes"},"value":{"kind":"ListValue","values":[{"kind":"StringValue","value":"channel_mention","block":false},{"kind":"StringValue","value":"channel_message_send","block":false},{"kind":"StringValue","value":"channel_message_reply","block":false},{"kind":"StringValue","value":"document_mention","block":false}]}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ChannelUnreadPresenceQuery, ChannelUnreadPresenceQueryVariables>;
+export const ChannelUnreadCacheWriteDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"subscription","name":{"kind":"Name","value":"ChannelUnreadCacheWrite"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"soupUpdates"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"SoupUpdated"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"item"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"topLevelMessagesOnly"},"value":{"kind":"BooleanValue","value":true}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ChannelUnreadCacheWriteSubscription, ChannelUnreadCacheWriteSubscriptionVariables>;
+export const ChannelUnreadPresenceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ChannelUnreadPresence"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SoupInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"user"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"soup"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"InlineFragment","typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupChannel"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","alias":{"kind":"Name","value":"unreadNotifications"},"name":{"kind":"Name","value":"notifications"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"filter"},"value":{"kind":"ObjectValue","fields":[{"kind":"ObjectField","name":{"kind":"Name","value":"states"},"value":{"kind":"ListValue","values":[{"kind":"EnumValue","value":"UNSEEN"}]}},{"kind":"ObjectField","name":{"kind":"Name","value":"topLevelMessagesOnly"},"value":{"kind":"BooleanValue","value":true}}]}},{"kind":"Argument","name":{"kind":"Name","value":"limit"},"value":{"kind":"IntValue","value":"1"}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"state"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ChannelUnreadPresenceQuery, ChannelUnreadPresenceQueryVariables>;
export const DeleteEntityPropertyDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteEntityProperty"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"entityType"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlPropertyTargetEntityType"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"entityId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"entityPropertyId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteEntityProperty"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"entityType"},"value":{"kind":"Variable","name":{"kind":"Name","value":"entityType"}}},{"kind":"Argument","name":{"kind":"Name","value":"entityId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"entityId"}}},{"kind":"Argument","name":{"kind":"Name","value":"entityPropertyId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"entityPropertyId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"graphqlTypeName"}},{"kind":"Field","name":{"kind":"Name","value":"entityId"}}]}}]}}]} as unknown as DocumentNode<DeleteEntityPropertyMutation, DeleteEntityPropertyMutationVariables>;
export const SetEmailThreadArchivedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetEmailThreadArchived"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SetEmailThreadArchivedInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setEmailThreadArchived"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"inboxVisible"}}]}}]}}]} as unknown as DocumentNode<SetEmailThreadArchivedMutation, SetEmailThreadArchivedMutationVariables>;
export const SaveEmailDraftDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SaveEmailDraft"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SaveEmailDraftInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"saveEmailDraft"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"draftId"}},{"kind":"Field","name":{"kind":"Name","value":"draft"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"EmailThreadMessageFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"thread"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"EmailThreadMessageFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"GraphqlSoupEmailMessage"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"threadId"}},{"kind":"Field","name":{"kind":"Name","value":"replyingToId"}},{"kind":"Field","name":{"kind":"Name","value":"linkId"}},{"kind":"Field","name":{"kind":"Name","value":"subject"}},{"kind":"Field","name":{"kind":"Name","value":"snippet"}},{"kind":"Field","name":{"kind":"Name","value":"internalDateTs"}},{"kind":"Field","name":{"kind":"Name","value":"sentAt"}},{"kind":"Field","name":{"kind":"Name","value":"isRead"}},{"kind":"Field","name":{"kind":"Name","value":"isStarred"}},{"kind":"Field","name":{"kind":"Name","value":"isSent"}},{"kind":"Field","name":{"kind":"Name","value":"isDraft"}},{"kind":"Field","name":{"kind":"Name","value":"hasAttachments"}},{"kind":"Field","name":{"kind":"Name","value":"scheduledSendTime"}},{"kind":"Field","name":{"kind":"Name","value":"from"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"to"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"cc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bcc"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"email"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"photoUrl"}}]}},{"kind":"Field","name":{"kind":"Name","value":"labels"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"providerLabelId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}},{"kind":"Field","name":{"kind":"Name","value":"bodyText"}},{"kind":"Field","name":{"kind":"Name","value":"bodyHtmlSanitized"}},{"kind":"Field","name":{"kind":"Name","value":"bodyMacro"}},{"kind":"Field","name":{"kind":"Name","value":"calendarInvitations"}},{"kind":"Field","name":{"kind":"Name","value":"bodyReplyless"}},{"kind":"Field","name":{"kind":"Name","value":"attachments"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"providerId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}},{"kind":"Field","name":{"kind":"Name","value":"sfsId"}},{"kind":"Field","name":{"kind":"Name","value":"contentId"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachmentsDraft"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"draftId"}},{"kind":"Field","name":{"kind":"Name","value":"fileName"}},{"kind":"Field","name":{"kind":"Name","value":"contentType"}},{"kind":"Field","name":{"kind":"Name","value":"sha"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"s3Key"}}]}},{"kind":"Field","name":{"kind":"Name","value":"attachmentsForwarded"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"__typename"}},{"kind":"Field","name":{"kind":"Name","value":"attachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"draftId"}},{"kind":"Field","name":{"kind":"Name","value":"providerAttachmentId"}},{"kind":"Field","name":{"kind":"Name","value":"messageProviderId"}},{"kind":"Field","name":{"kind":"Name","value":"filename"}},{"kind":"Field","name":{"kind":"Name","value":"mimeType"}},{"kind":"Field","name":{"kind":"Name","value":"sizeBytes"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<SaveEmailDraftMutation, SaveEmailDraftMutationVariables>;
diff --git a/crates/graphql_notification/src/loaders/test.rs b/crates/graphql_notification/src/loaders/test.rs
index 0378552c27..e2f0b4a0b3 100644
--- a/crates/graphql_notification/src/loaders/test.rs
+++ b/crates/graphql_notification/src/loaders/test.rs
@@ -100,6 +100,7 @@ async fn aliases_and_entities_batch_without_mixing_full_and_limited_results() {
let response = schema
.execute(
r#"{
+ roots: notifications(entity: "one", filter: {states: [UNSEEN], topLevelMessagesOnly: true}, limit: 1) { id state }
full: notifications(entity: "one") { id state }
unread: notifications(entity: "one", filter: {states: [UNSEEN]}, limit: 1) { id state }
other: notifications(entity: "two", filter: {states: [UNSEEN]}, limit: 1) { id state }
@@ -113,7 +114,7 @@ async fn aliases_and_entities_batch_without_mixing_full_and_limited_results() {
assert_eq!(json["unread"][0]["state"], "UNSEEN");
assert_eq!(json["other"].as_array().unwrap().len(), 1);
let calls = calls.lock().unwrap();
- assert_eq!(calls.len(), 2, "one batch per selection, not per entity");
+ assert_eq!(calls.len(), 3, "one batch per selection, not per entity");
assert!(
calls
.iter()
@@ -122,7 +123,7 @@ async fn aliases_and_entities_batch_without_mixing_full_and_limited_results() {
assert_eq!(
calls
.iter()
- .find(|(_, _, query)| query.limit == Some(1))
+ .find(|(_, _, query)| query.limit == Some(1) && !query.top_level_messages_only)
.unwrap()
.1
.len(),
diff --git a/crates/graphql_notification/src/query.rs b/crates/graphql_notification/src/query.rs
index 994d3db8bf..3f93aa9f18 100644
--- a/crates/graphql_notification/src/query.rs
+++ b/crates/graphql_notification/src/query.rs
@@ -12,6 +12,8 @@ pub struct GraphqlNotificationFilter {
pub states: Option<Vec<GraphqlNotificationState>>,
/// Event names to include; omitted or empty means every event type.
pub event_types: Option<Vec<String>>,
+ /// Only notifications about top-level channel messages, including mentions but excluding reactions.
+ pub top_level_messages_only: Option<bool>,
}
impl GraphqlNotificationFilter {
@@ -25,6 +27,7 @@ impl GraphqlNotificationFilter {
query.states = states.into_iter().map(Into::into).collect();
}
query.event_types = self.event_types.unwrap_or_default();
+ query.top_level_messages_only = self.top_level_messages_only.unwrap_or_default();
query.limit = limit
.map(u32::try_from)
.transpose()
diff --git a/crates/notification/src/domain/models/entity_query.rs b/crates/notification/src/domain/models/entity_query.rs
index 192d1477e4..7614604392 100644
--- a/crates/notification/src/domain/models/entity_query.rs
+++ b/crates/notification/src/domain/models/entity_query.rs
@@ -10,6 +10,9 @@ pub struct EntityNotificationQuery {
pub states: Vec<NotificationState>,
/// Event names to include; an empty list includes every event type.
pub event_types: Vec<String>,
+ /// Only notifications about channel messages outside a thread, including mentions
+ /// but excluding reactions. Apply before limiting so replies cannot hide unread roots.
+ pub top_level_messages_only: bool,
/// Maximum records per entity, newest first. None preserves the full edge.
pub limit: Option<u32>,
}
@@ -19,6 +22,7 @@ impl Default for EntityNotificationQuery {
Self {
states: NotificationState::ACTIVE.to_vec(),
event_types: Vec::new(),
+ top_level_messages_only: false,
limit: None,
}
}
diff --git a/crates/notification/src/outbound/entity_notifications.rs b/crates/notification/src/outbound/entity_notifications.rs
index 90ce91c648..84b054503d 100644
--- a/crates/notification/src/outbound/entity_notifications.rs
+++ b/crates/notification/src/outbound/entity_notifications.rs
@@ -74,11 +74,16 @@ pub(super) async fn get_filtered_entity_notifications(
AND un.deleted_at IS NULL
AND un.state = ANY($4::notification_state[])
AND (cardinality($5::text[]) = 0 OR n.notification_event_type = ANY($5))
+ AND (NOT $7::bool OR (
+ n.notification_event_type IN ('channel_message_send', 'channel_mention', 'document_mention')
+ AND COALESCE(n.metadata->>'threadId', n.metadata->>'thread_id') IS NULL
+ ))
ORDER BY un.created_at DESC, un.notification_id DESC
LIMIT $6
) matched
"#,
user_id.as_ref(), &ids, &types, &query.states as _, &query.event_types, limit,
+ query.top_level_messages_only,
).fetch_all(pool).await?;
for row in rows {
diff --git a/crates/notification/src/outbound/entity_notifications/test.rs b/crates/notification/src/outbound/entity_notifications/test.rs
index 9bb0a3fc1b..f1d268f3c4 100644
--- a/crates/notification/src/outbound/entity_notifications/test.rs
+++ b/crates/notification/src/outbound/entity_notifications/test.rs
@@ -137,6 +137,7 @@ async fn filters_before_limit_per_entity_and_preserves_full_reads(pool: PgPool)
states: vec![NotificationState::Unseen],
event_types: vec![Message::TYPE_NAME.into()],
limit: Some(1),
+ ..Default::default()
};
let entities = vec![
channel.clone(),
@@ -202,3 +203,122 @@ async fn filters_before_limit_per_entity_and_preserves_full_reads(pool: PgPool)
.unwrap();
assert!(empty[&channel].is_empty());
}
+
+#[derive(Clone, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+struct Mention {
+ message_id: String,
+ thread_id: Option<String>,
+}
+impl Notification for Mention {
+ const TYPE_NAME: &'static str = "channel_mention";
+}
+
+#[derive(Clone, Serialize, Deserialize)]
+struct LegacyMention {
+ message_id: String,
+ thread_id: String,
+}
+impl Notification for LegacyMention {
+ const TYPE_NAME: &'static str = "channel_mention";
+}
+
+#[derive(Clone, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+struct Reaction {
+ message_id: String,
+}
+impl Notification for Reaction {
+ const TYPE_NAME: &'static str = "channel_message_reaction";
+}
+
+#[sqlx::test(migrator = "MACRO_DB_MIGRATIONS")]
+async fn top_level_filter_finds_older_mentions_before_limiting(pool: PgPool) {
+ let viewer = MacroUserIdStr::try_from_email("[email protected]").unwrap();
+ let channel = EntityType::Channel.with_entity_string(Uuid::now_v7().to_string());
+ let root = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Mention {
+ message_id: "root".into(),
+ thread_id: None,
+ },
+ )
+ .await;
+ let reply = insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Mention {
+ message_id: "reply".into(),
+ thread_id: Some("root".into()),
+ },
+ )
+ .await;
+ insert(&pool, &viewer, channel.clone(), None, Call).await;
+ insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ LegacyMention {
+ message_id: "legacy-reply".into(),
+ thread_id: "root".into(),
+ },
+ )
+ .await;
+ insert(
+ &pool,
+ &viewer,
+ channel.clone(),
+ None,
+ Reaction {
+ message_id: "root".into(),
+ },
+ )
+ .await;
+ let query = EntityNotificationQuery {
+ states: vec![NotificationState::Unseen],
+ top_level_messages_only: true,
+ limit: Some(1),
+ ..Default::default()
+ };
+ let result = get_filtered_entity_notifications(
+ &pool,
+ viewer.clone(),
+ vec![channel.clone()],
+ query.clone(),
+ )
+ .await
+ .unwrap();
+ assert_eq!(result[&channel].len(), 1);
+ assert_eq!(result[&channel][0].notification_id, root);
+ pool.mark_notifications_seen(&viewer, &[root])
+ .await
+ .unwrap();
+ let result =
+ get_filtered_entity_notifications(&pool, viewer.clone(), vec![channel.clone()], query)
+ .await
+ .unwrap();
+ assert!(
+ result[&channel].is_empty(),
+ "reply mentions, reactions, and calls do not badge the channel"
+ );
+ let full =
+ get_filtered_entity_notifications(&pool, viewer, vec![channel.clone()], Default::default())
+ .await
+ .unwrap();
+ assert_eq!(
+ full[&channel].len(),
+ 5,
+ "full hydration keeps every notification"
+ );
+ assert!(
+ full[&channel]
+ .iter()
+ .any(|row| row.notification_id == reply && row.state == NotificationState::Unseen)
+ );
+}
diff --git a/docs/AGENT_GUIDE/channels.md b/docs/AGENT_GUIDE/channels.md
index 11267badc8..767c640575 100644
--- a/docs/AGENT_GUIDE/channels.md
+++ b/docs/AGENT_GUIDE/channels.md
@@ -304,6 +304,23 @@ A newer message navigation cancels a pending jump to latest. Scrolling manually
or choosing another destination also cancels the initial target's delayed fallback.
A touch tap leaves pending navigation intact; a vertical finger drag cancels it.
+The **Unread notification** chip points to the most recent unread notification.
+There is only one chip: above the list for a target above the viewport, or below
+for a target below it. The number counts distinct parent-message threads across
+the channel, not individual notifications. Three replies and a mention in the
+same thread count as one; reactions do not count. Clicking jumps to the target
+and expands its thread. A collapsed unread reply in a visible thread is reachable
+with the bottom chip. A visible target has no chip. Notifications are marked seen
+when their message mounts, including virtualized overscan. Collapsed replies that
+are not rendered remain unread.
+The count and target update as notifications arrive or become seen. Check an old
+thread receiving a new reply while a newer thread is also unread: the chip must
+point upward to the old thread, still show two stacks, and preserve the scroll
+position until clicked. Check a target below the viewport, loading an unloaded
+parent, and switching channels while notifications are loading. Loading this
+channel's notification edge must not delay its messages or activate the global
+GraphQL notification feed.
+
The `[data-channel-scroll]` element is the scroll surface. Its virtualized rows are
keyed by message ID; offscreen rows are normally absent from the DOM.
@@ -311,6 +328,10 @@ On a cold channel open, verify that delayed bot/agent mention requests leave the
messages and composer visible. Expand a thread while its replies are still
loading: existing preview replies should remain visible until the full list
arrives. Repeat after reopening the channel to cover both cold and cached data.
+Scrolling a collapsed thread into view must keep its timeline preview unchanged,
+without fetching or revealing the full reply list. Cached replies from a previous
+expansion must not enlarge that preview either. Explicit expansion, replying,
+and message/unread-chip navigation may still open the thread.
Channel messages, thread replies, reactions, edits, deletions, and typing go
through the shared message API at `GET|POST /dss/messages/channel/<id>` and its
@@ -354,6 +375,22 @@ In Chat, the detail uses the shared channel top bar with Messages, Attachments,
Participants, and Calls tabs (when calls are enabled). A message target switches
back to Messages; changing unread notifications does not restart navigation.
+On desktop, switching conversations selects and mounts the cached conversation
+immediately. Messages load alongside the notification refresh. Explicit message
+or search targets apply immediately; ordinary opens start at the bottom. Notification
+results never change the destination. With a slow connection, switch channels
+quickly: an earlier
+response must not switch back or mark that earlier channel read.
+
+A transient notification-fetch failure keeps the conversation and composer mounted
+while notifications are unavailable. Recovery marks top-level message notifications
+seen without moving the conversation. No notification read marking runs
+from an abbreviated list result, even if that result is empty. Access failures
+show **Conversation unavailable** and stay hidden during retry until access is
+confirmed. A route without cached channel metadata shows **Loading conversation**
+until its channel arrives. Mobile and opening in a new split retain the block
+host's existing notification-before-navigation flow.
+
The title bar's **Hide navigation** control hides the whole rail. Reopen it with
**Show navigation** (the hamburger) immediately before the conversation title.
Chat remembers this choice independently of other workspaces and restores it
@@ -371,10 +408,9 @@ optional `Favorites` section and the
independently paginated `Channels` and `DMs` sections. Favorites appears when
the user has channel favorites and only lists channels. Channel favorites open
in the shared channel detail. Shift-clicking a favorite, channel, or DM opens that
-conversation in a new split instead. For loaded rows, shift-click refreshes the
-notification selection and carries the most recent unread message or reply target
-into the split. A read conversation opens at latest. Split opens mark only the
-row's thread-scoped notifications, and only after the split is opened or reused.
+conversation in a new split instead. Shift-click refreshes the notification
+selection and opens at latest. Split opens mark top-level notifications seen,
+including mentions and reactions, only after the split is opened or reused.
Deferred navigation waits until the destination is applied; an unavailable split
must leave unread state unchanged. Join-only channels remain
blocked after hydration, including on mobile.
@@ -565,24 +601,29 @@ request must not show a load-error message over valid search hits or replace
**No results**, including during debounce and short local-only queries. Search
failures still show their own error; clearing search restores the browse error.
With `enable-graphql-soup` enabled, open an unread conversation from each tab
-and return to the list: its top-level notifications should be read, including
-ones older than the global notification feed's loaded page. Notifications for
-separate thread stacks remain unread until that thread is opened. From each mobile
-tab, also tap a conversation whose only unread notification is a reply: it should
-open that reply, not latest. Navigation uses the full hydrated edge while read
-marking remains thread-scoped, matching desktop rail and shift-click opens.
-
-On desktop, each click on a conversation in the Chat rail opens its most recent
-currently unread notification, including replies in threads. Read notifications
-are not retained as click targets: once a channel has no unread
-notifications, clicking it opens the latest message. Explicit search hits still
-open their matched message. Verify repeated clicks after read-state updates and
-after a new notification arrives; previously read targets must not loop around.
+and return to the list: all notifications on top-level messages should be seen,
+including mentions and reactions older than the global feed's loaded page.
+Replies and mentions inside threads remain unread. Channel-view unread badges
+only represent top-level messages and mentions; unread replies and reactions do
+not contribute to that badge. Top-level reactions are still marked seen on open. Verify an older unread root behind a newer reply still badges.
+Inbox retains its own thread-stack behavior.
+
+Each ordinary conversation click opens the bottom, including re-clicks,
+shift-clicks, mobile opens, reloads, and favorites. Explicit search hits and message
+links still open their target. Each accepted click marks top-level notifications
+from the full loaded edge seen; an abbreviated list edge is never sufficient.
+A rejected selection or unavailable split must not mark the conversation read.
+Non-participant rows retain their membership status and do not mark notifications.
+Shift-click a favorite whose channel is not loaded in the rail: its membership
+and full notification edge load before the split opens with the same top-level
+read policy. Selecting another channel while that request is pending must cancel
+the pending open; failed lookups must not open a split or mark anything seen.
With GraphQL enabled, the app-shell Chat badge uses `ChannelUnreadPresence`: only
-channel IDs and at most one unread notification ID/state per channel, with a
+channel IDs and at most one unread top-level message/mention ID/state per channel, with a
500-channel candidate bound and no history, message previews, or metadata. It
-shares the channel lists' refreshes after notification patches, mark-read, and
+excludes replies, thread mentions, and reactions, matching the channel-row badges
+in both GraphQL and REST modes. It shares the channel lists' refreshes after notification patches, mark-read, and
reconnect. Merely rendering that badge, subscribing to realtime notifications,
or applying local read/done overrides must not start the full `SoupNotifications`
feed. Check this with document-mention notifications disabled too (the production
@@ -599,7 +640,8 @@ per channel through an aliased, filtered `notifications` edge. An empty edge mea
no unread messages; invites and call notifications do not light the dot. Recent
cards still use the latest-message preview. Full notification edges load only for
an opened unread conversation, so mark-read and message targeting retain their
-complete thread-scoped inputs. Reopening a conversation must refresh that full
+complete top-level inputs in Chat and thread-scoped inputs in Inbox. Reopening
+a conversation must refresh that full
edge even within 30 seconds; mark-read waits for the refresh rather than using
older cached notifications. Failed lookups and successful lookups with no matching
channel show **Conversation unavailable** with **Retry**, never permanent loading.
diff --git a/rules/ast-grep/ts-feature-components-presentational.yml b/rules/ast-grep/ts-feature-components-presentational.yml
index cfea66a6f0..25990f79cf 100644
--- a/rules/ast-grep/ts-feature-components-presentational.yml
+++ b/rules/ast-grep/ts-feature-components-presentational.yml
@@ -13,6 +13,7 @@ note: |-
untyped wire JSON for property-changed rows. In block-agent, `ui/` is
the presentation layer and `component/` is the composition layer.
files:
+ - apps/web/src/features/channels-view/components/ChannelDetailView*
- apps/web/src/features/channel/components/channel-invite*
- apps/web/src/features/projects/components/**
- apps/web/src/features/block-agent/ui/**
diff --git a/rules/ast-grep/ts-feature-data-no-ui.yml b/rules/ast-grep/ts-feature-data-no-ui.yml
index b4980fbad8..6c958efcc4 100644
--- a/rules/ast-grep/ts-feature-data-no-ui.yml
+++ b/rules/ast-grep/ts-feature-data-no-ui.yml
@@ -11,6 +11,8 @@ note: |-
with fake clients and controllers with fake capabilities; neither imports
rendering code, including block-agent’s `ui/` and `component/` layers.
files:
+ - apps/web/src/features/channels-view/queries/channel-detail-source*
+ - apps/web/src/features/channels-view/primitives/create-channel-detail*
- apps/web/src/features/channel/queries/channel-invite*
- apps/web/src/features/channel/primitives/create-channel-invites*
- apps/web/src/features/projects/queries/**
diff --git a/rules/ast-grep/ts-feature-layers-use-context.yml b/rules/ast-grep/ts-feature-layers-use-context.yml
index 898cc82fb9..b6e4cbf91e 100644
--- a/rules/ast-grep/ts-feature-layers-use-context.yml
+++ b/rules/ast-grep/ts-feature-layers-use-context.yml
@@ -15,6 +15,10 @@ note: |-
`files` in each ts-/tsx-feature-* rule. Block-agent uses `ui/` for
presentation and `component/` for composition.
files:
+ - apps/web/src/features/channels-view/queries/channel-detail-source*
+ - apps/web/src/features/channels-view/primitives/create-channel-detail*
+ - apps/web/src/features/channels-view/context/channel-detail-source*
+ - apps/web/src/features/channels-view/components/ChannelDetailView*
- apps/web/src/features/channel/queries/channel-invite*
- apps/web/src/features/channel/primitives/create-channel-invites*
- apps/web/src/features/channel/components/channel-invite*
diff --git a/rules/ast-grep/tsx-feature-components-presentational.yml b/rules/ast-grep/tsx-feature-components-presentational.yml
index 03bfe850d2..68d7e62cb3 100644
--- a/rules/ast-grep/tsx-feature-components-presentational.yml
+++ b/rules/ast-grep/tsx-feature-components-presentational.yml
@@ -13,6 +13,7 @@ note: |-
untyped wire JSON for property-changed rows. In block-agent, `ui/` is
the presentation layer and `component/` is the composition layer.
files:
+ - apps/web/src/features/channels-view/components/ChannelDetailView*
- apps/web/src/features/channel/components/channel-invite*
- apps/web/src/features/projects/components/**
- apps/web/src/features/block-agent/ui/**
diff --git a/rules/ast-grep/tsx-feature-data-no-ui.yml b/rules/ast-grep/tsx-feature-data-no-ui.yml
index a88e1c2bdc..b8ec642459 100644
--- a/rules/ast-grep/tsx-feature-data-no-ui.yml
+++ b/rules/ast-grep/tsx-feature-data-no-ui.yml
@@ -11,6 +11,8 @@ note: |-
with fake clients and controllers with fake capabilities; neither imports
rendering code, including block-agent’s `ui/` and `component/` layers.
files:
+ - apps/web/src/features/channels-view/queries/channel-detail-source*
+ - apps/web/src/features/channels-view/primitives/create-channel-detail*
- apps/web/src/features/channel/queries/channel-invite*
- apps/web/src/features/channel/primitives/create-channel-invites*
- apps/web/src/features/projects/queries/**
diff --git a/rules/ast-grep/tsx-feature-layers-use-context.yml b/rules/ast-grep/tsx-feature-layers-use-context.yml
index 6ddcc709e0..0414d5a09a 100644
--- a/rules/ast-grep/tsx-feature-layers-use-context.yml
+++ b/rules/ast-grep/tsx-feature-layers-use-context.yml
@@ -15,6 +15,10 @@ note: |-
`files` in each ts-/tsx-feature-* rule. Block-agent uses `ui/` for
presentation and `component/` for composition.
files:
+ - apps/web/src/features/channels-view/queries/channel-detail-source*
+ - apps/web/src/features/channels-view/primitives/create-channel-detail*
+ - apps/web/src/features/channels-view/context/channel-detail-source*
+ - apps/web/src/features/channels-view/components/ChannelDetailView*
- apps/web/src/features/channel/queries/channel-invite*
- apps/web/src/features/channel/primitives/create-channel-invites*
- apps/web/src/features/channel/components/channel-invite*
diff --git a/static_assets/schema.graphql b/static_assets/schema.graphql
index cd40c9473e..7f13719bdd 100644
--- a/static_assets/schema.graphql
+++ b/static_assets/schema.graphql
@@ -3689,6 +3689,10 @@ input GraphqlNotificationFilter {
Event names to include; omitted or empty means every event type.
"""
eventTypes: [String!]
+ """
+ Only notifications about top-level channel messages, including mentions but excluding reactions.
+ """
+ topLevelMessagesOnly: Boolean
}
"""