loadAndScroll: Use one transaction to pull all data: old/new/metrics
This commit is contained in:
parent
60a53656af
commit
0163ef203b
4 changed files with 132 additions and 16 deletions
|
@ -451,6 +451,7 @@ export type DataInterface = {
|
|||
conversationId: string,
|
||||
storyId?: UUIDStringType
|
||||
) => Promise<ConversationMetricsType>;
|
||||
// getConversationRangeCenteredOnMessage is JSON on server, full message on client
|
||||
getLastConversationMessages: (options: {
|
||||
conversationId: string;
|
||||
ourUuid: UUIDStringType;
|
||||
|
@ -622,6 +623,18 @@ export type ServerInterface = DataInterface & {
|
|||
storyId?: UUIDStringType;
|
||||
}
|
||||
) => Promise<Array<MessageTypeUnhydrated>>;
|
||||
getConversationRangeCenteredOnMessage: (options: {
|
||||
conversationId: string;
|
||||
limit?: number;
|
||||
messageId: string;
|
||||
receivedAt: number;
|
||||
sentAt?: number;
|
||||
storyId?: UUIDStringType;
|
||||
}) => Promise<{
|
||||
older: Array<MessageTypeUnhydrated>;
|
||||
newer: Array<MessageTypeUnhydrated>;
|
||||
metrics: ConversationMetricsType;
|
||||
}>;
|
||||
|
||||
// Server-only
|
||||
|
||||
|
@ -681,6 +694,18 @@ export type ClientInterface = DataInterface & {
|
|||
storyId?: UUIDStringType;
|
||||
}
|
||||
) => Promise<Array<MessageAttributesType>>;
|
||||
getConversationRangeCenteredOnMessage: (options: {
|
||||
conversationId: string;
|
||||
limit?: number;
|
||||
messageId: string;
|
||||
receivedAt: number;
|
||||
sentAt?: number;
|
||||
storyId?: UUIDStringType;
|
||||
}) => Promise<{
|
||||
older: Array<MessageAttributesType>;
|
||||
newer: Array<MessageAttributesType>;
|
||||
metrics: ConversationMetricsType;
|
||||
}>;
|
||||
|
||||
// Client-side only
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue