Refresh communication queries on workspace change (#9723)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2025-08-26 19:11:24 +07:00
committed by GitHub
parent 28ad28aefe
commit 734c3bb56e
3 changed files with 9 additions and 2 deletions
+6 -1
View File
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
import { initLiveQueries, refreshLiveQueries } from '@hcengineering/communication-client-query'
import { closeLiveQueries, initLiveQueries, refreshLiveQueries } from '@hcengineering/communication-client-query'
import {
type AddAttachmentsOperation,
type AddCollaboratorsEvent,
@@ -458,3 +458,8 @@ export async function refreshCommunicationClient (): Promise<void> {
console.log('refreshCommunicationClient')
await refreshLiveQueries()
}
export async function purgeCommunicationClient (): Promise<void> {
client.close()
closeLiveQueries()
}
@@ -35,6 +35,7 @@ import platform, {
import presentation, {
loadServerConfig,
purgeClient,
purgeCommunicationClient,
refreshClient,
refreshCommunicationClient,
setClient,
@@ -175,6 +176,7 @@ export async function connect (title: string): Promise<Client | undefined> {
// We need to flush all data from memory
await ctx.with('purge-client', {}, async () => {
await purgeClient()
await purgeCommunicationClient()
})
await ctx.with('close previous client', {}, async () => {
await _client?.close()