UBERF-8433: Support for archived workspaces (#6937)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-11-12 18:06:51 +07:00
committed by GitHub
parent 1afe8ef326
commit a220fac255
29 changed files with 506 additions and 119 deletions
+13 -2
View File
@@ -42,7 +42,13 @@ import core, {
toFindResult,
type MeasureContext
} from '@hcengineering/core'
import { PlatformError, UNAUTHORIZED, broadcastEvent, getMetadata, unknownError } from '@hcengineering/platform'
import platform, {
PlatformError,
UNAUTHORIZED,
broadcastEvent,
getMetadata,
unknownError
} from '@hcengineering/platform'
import { HelloRequest, HelloResponse, RPCHandler, ReqId, type Response } from '@hcengineering/rpc'
@@ -241,7 +247,12 @@ class Connection implements ClientConnection {
Analytics.handleError(new PlatformError(resp.error))
this.closed = true
this.websocket?.close()
this.opt?.onUnauthorized?.()
if (resp.error?.code === UNAUTHORIZED.code) {
this.opt?.onUnauthorized?.()
}
if (resp.error?.code === platform.status.WorkspaceArchived) {
this.opt?.onArchived?.()
}
}
console.error(resp.error)
return