Fix messages loading (#8865)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2025-05-07 08:17:21 +04:00
committed by GitHub
parent ff4b03f596
commit b864fc6f91
19 changed files with 554 additions and 625 deletions
+518 -585
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -43,9 +43,9 @@
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/client": "^0.6.18",
"@hcengineering/collaborator-client": "^0.6.4",
"@hcengineering/communication-client-query": "0.1.174",
"@hcengineering/communication-sdk-types": "0.1.174",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-client-query": "0.1.175",
"@hcengineering/communication-sdk-types": "0.1.175",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/core": "^0.6.32",
"@hcengineering/diffview": "^0.6.0",
"@hcengineering/notification": "^0.6.23",
+3 -1
View File
@@ -65,12 +65,14 @@ import {
createNotificationContextsQuery,
createNotificationsQuery,
createLabelsQuery,
initLiveQueries
initLiveQueries,
type MessageQueryParams
} from '@hcengineering/communication-client-query'
import { getCurrentWorkspaceUuid, getFilesUrl } from './file'
export { createMessagesQuery, createNotificationsQuery, createNotificationContextsQuery, createLabelsQuery }
export type { MessageQueryParams }
interface Connection extends PlatformConnection {
findMessages: (params: FindMessagesParams, queryId?: number) => Promise<Message[]>
+1 -1
View File
@@ -42,7 +42,7 @@
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/attachment-resources": "^0.6.0",
"@hcengineering/card": "^0.6.0",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/contact-resources": "^0.6.0",
"@hcengineering/core": "^0.6.32",
+1 -1
View File
@@ -51,7 +51,7 @@
"@hcengineering/ui-next": "^0.6.0",
"@hcengineering/view": "^0.6.13",
"@hcengineering/view-resources": "^0.6.0",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"svelte": "^4.2.19"
}
}
+1 -1
View File
@@ -41,7 +41,7 @@
"dependencies": {
"@hcengineering/presence": "^0.6.0",
"@hcengineering/presentation": "^0.6.3",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/core": "^0.6.32",
"@hcengineering/ui": "^0.6.15",
"@hcengineering/setting": "^0.6.17",
+1 -1
View File
@@ -42,7 +42,7 @@
"@hcengineering/card": "^0.6.0",
"@hcengineering/card-resources": "^0.6.0",
"@hcengineering/chat": "^0.6.0",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/contact-resources": "^0.6.0",
"@hcengineering/core": "^0.6.32",
+2 -2
View File
@@ -40,8 +40,8 @@
"dependencies": {
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/client": "^0.6.18",
"@hcengineering/communication-sdk-types": "0.1.174",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-sdk-types": "0.1.175",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/core": "^0.6.32",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/rpc": "^0.6.5",
+1 -1
View File
@@ -44,7 +44,7 @@
"dependencies": {
"@hcengineering/card": "^0.6.0",
"@hcengineering/communication": "^0.6.0",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/core": "^0.6.32",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/presentation": "^0.6.3",
@@ -65,7 +65,7 @@
context={notificationContext}
{scrollDiv}
{contentDiv}
{position}
bind:position
shouldScrollToStart={active && position === MessagesNavigationAnchors.ConversationStart && shouldScrollToStart}
{isLoadingBefore}
on:change
@@ -13,8 +13,8 @@
<script lang="ts">
import { Card } from '@hcengineering/card'
import { FindMessagesParams, type Message, NotificationContext, Window } from '@hcengineering/communication-types'
import { createMessagesQuery, getCommunicationClient } from '@hcengineering/presentation'
import { type Message, NotificationContext, Window } from '@hcengineering/communication-types'
import { createMessagesQuery, getCommunicationClient, type MessageQueryParams } from '@hcengineering/presentation'
import { getCurrentAccount, SortingOrder } from '@hcengineering/core'
import { createEventDispatcher, onDestroy, onMount, tick } from 'svelte'
import { MessagesGroup as MessagesGroupPresenter, MessagesLoading } from '@hcengineering/ui-next'
@@ -36,7 +36,6 @@
const communicationClient = getCommunicationClient()
const query = createMessagesQuery()
const loadPageThreshold = 200
const scrollToNewThreshold = 50
const initialLastView = context?.lastView
@@ -117,7 +116,7 @@
}
}
function getBaseQuery (): FindMessagesParams {
function getBaseQuery (): MessageQueryParams {
if (position === MessagesNavigationAnchors.ConversationStart) {
return {
card: card._id,
@@ -136,12 +135,7 @@
reactions: true,
order,
limit,
created:
unread && initialLastView != null
? {
greaterOrEqual: initialLastView
}
: undefined
from: unread && initialLastView != null ? initialLastView : undefined
}
}
@@ -168,11 +162,11 @@
function shouldLoadPrevPage (): boolean {
const topOffset = getTopOffset()
return topOffset > -1 && topOffset <= loadPageThreshold
return topOffset > -1 && topOffset <= 300
}
function shouldLoadNextPage (): boolean {
return getBottomOffset() <= loadPageThreshold
return getBottomOffset() <= 200
}
function loadMore (): void {
+1 -1
View File
@@ -40,7 +40,7 @@
"dependencies": {
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/card": "^0.6.0",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/contact-resources": "^0.6.0",
"@hcengineering/core": "^0.6.32",
+1 -1
View File
@@ -61,7 +61,7 @@
"dependencies": {
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/analytics-service": "^0.6.0",
"@hcengineering/communication-server": "0.1.174",
"@hcengineering/communication-server": "0.1.175",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/core": "^0.6.32",
"@hcengineering/kafka": "^0.6.0",
@@ -48,7 +48,7 @@
"@hcengineering/server-core": "^0.6.1",
"@hcengineering/server-notification-resources": "^0.6.0",
"@hcengineering/text-core": "^0.6.0",
"@hcengineering/communication-sdk-types": "0.1.174",
"@hcengineering/communication-types": "0.1.174"
"@hcengineering/communication-sdk-types": "0.1.175",
"@hcengineering/communication-types": "0.1.175"
}
}
+1 -1
View File
@@ -43,7 +43,7 @@
"@hcengineering/core": "^0.6.32",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/server-core": "^0.6.1",
"@hcengineering/communication-sdk-types": "0.1.174",
"@hcengineering/communication-sdk-types": "0.1.175",
"@hcengineering/server-contact": "^0.6.1",
"@hcengineering/contact": "^0.6.24"
}
+2 -2
View File
@@ -36,8 +36,8 @@
},
"dependencies": {
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/communication-sdk-types": "0.1.174",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-sdk-types": "0.1.175",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/core": "^0.6.32",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/query": "^0.6.12",
+2 -2
View File
@@ -41,8 +41,8 @@
"dependencies": {
"@hcengineering/account-client": "^0.6.0",
"@hcengineering/analytics": "^0.6.0",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-sdk-types": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/communication-sdk-types": "0.1.175",
"@hcengineering/core": "^0.6.32",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/rpc": "^0.6.5",
+2 -2
View File
@@ -61,8 +61,8 @@
"@hcengineering/analytics-service": "^0.6.0",
"@hcengineering/api-client": "^0.6.0",
"@hcengineering/card": "^0.6.0",
"@hcengineering/communication-rest-client": "0.1.174",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-rest-client": "0.1.175",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/contact": "^0.6.24",
"@hcengineering/core": "^0.6.32",
"@hcengineering/mail": "^0.6.0",
+5 -5
View File
@@ -57,11 +57,11 @@
"dependencies": {
"@hcengineering/api-client": "^0.6.0",
"@hcengineering/card": "^0.6.0",
"@hcengineering/communication-types": "0.1.174",
"@hcengineering/communication-shared": "0.1.174",
"@hcengineering/communication-yaml": "0.1.174",
"@hcengineering/communication-sdk-types": "0.1.174",
"@hcengineering/communication-rest-client": "0.1.174",
"@hcengineering/communication-types": "0.1.175",
"@hcengineering/communication-shared": "0.1.175",
"@hcengineering/communication-yaml": "0.1.175",
"@hcengineering/communication-sdk-types": "0.1.175",
"@hcengineering/communication-rest-client": "0.1.175",
"@hcengineering/core": "^0.6.32",
"@hcengineering/platform": "^0.6.11",
"@hcengineering/server-client": "^0.6.0",