QFIX: Remove duplicate handler errors (#9084)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2025-05-25 16:32:41 +07:00 committed by GitHub
parent 91e72d98fc
commit 6bd8fff00b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 14 additions and 11 deletions

View File

@ -14,6 +14,7 @@
// limitations under the License. // limitations under the License.
// //
import { Analytics } from '@hcengineering/analytics'
import type { Doc, PropertyType } from './classes' import type { Doc, PropertyType } from './classes'
import type { Position, PullArray, QueryUpdate } from './tx' import type { Position, PullArray, QueryUpdate } from './tx'
@ -43,7 +44,12 @@ function $push (document: Doc, keyval: Record<string, PropertyType>): void {
if (doc[key] === null || doc[key] === undefined) { if (doc[key] === null || doc[key] === undefined) {
doc[key] = [kvk] doc[key] = [kvk]
} else { } else {
doc[key].push(kvk) if (Array.isArray(doc[key])) {
doc[key].push(kvk)
} else {
Analytics.handleError(new Error(`invalid array value: ${JSON.stringify(doc[key])} `))
doc[key] = [kvk]
}
} }
} }
} }

View File

@ -1,4 +1,3 @@
import { Analytics } from '@hcengineering/analytics'
import { import {
toFindResult, toFindResult,
type Class, type Class,
@ -118,7 +117,6 @@ export class PresentationPipelineImpl implements PresentationPipeline {
return toFindResult([], -1) return toFindResult([], -1)
} }
} }
Analytics.handleError(err as Error)
const status = unknownError(err) const status = unknownError(err)
await setPlatformStatus(status) await setPlatformStatus(status)
return toFindResult([], -1) return toFindResult([], -1)
@ -144,7 +142,6 @@ export class PresentationPipelineImpl implements PresentationPipeline {
return return
} }
} }
Analytics.handleError(err as Error)
const status = unknownError(err) const status = unknownError(err)
await setPlatformStatus(status) await setPlatformStatus(status)
} }
@ -178,7 +175,6 @@ export class PresentationPipelineImpl implements PresentationPipeline {
return {} return {}
} }
} }
Analytics.handleError(err as Error)
const status = unknownError(err) const status = unknownError(err)
await setPlatformStatus(status) await setPlatformStatus(status)
return {} return {}

View File

@ -318,7 +318,12 @@ class Connection implements ClientConnection {
if (resp.error !== undefined) { if (resp.error !== undefined) {
if (resp.error?.code === UNAUTHORIZED.code || resp.terminate === true) { if (resp.error?.code === UNAUTHORIZED.code || resp.terminate === true) {
Analytics.handleError(new PlatformError(resp.error)) if (
resp.error.code !== platform.status.WorkspaceArchived ||
resp.error.code !== platform.status.WorkspaceNotFound
) {
Analytics.handleError(new PlatformError(resp.error))
}
this.closed = true this.closed = true
this.websocket?.close() this.websocket?.close()
if (resp.error?.code === UNAUTHORIZED.code) { if (resp.error?.code === UNAUTHORIZED.code) {

View File

@ -284,7 +284,6 @@ async function fileUploadCallback (space: Ref<Drive>, parent: Ref<Folder>): Prom
Analytics.handleEvent(DriveEvents.FileUploaded, { ok: true, type: file.type, size: file.size, name }) Analytics.handleEvent(DriveEvents.FileUploaded, { ok: true, type: file.type, size: file.size, name })
} catch (err) { } catch (err) {
void setPlatformStatus(unknownError(err)) void setPlatformStatus(unknownError(err))
Analytics.handleEvent(DriveEvents.FileUploaded, { ok: false, name })
} }
} }

View File

@ -135,7 +135,6 @@
} }
) )
} catch (err: any) { } catch (err: any) {
Analytics.handleError(err)
setPlatformStatus(unknownError(err)) setPlatformStatus(unknownError(err))
} }
} }

View File

@ -163,7 +163,6 @@
} }
) )
} catch (err: any) { } catch (err: any) {
Analytics.handleError(err)
setPlatformStatus(unknownError(err)) setPlatformStatus(unknownError(err))
} }
} }

View File

@ -483,7 +483,6 @@
await recognize(file) await recognize(file)
} catch (err: any) { } catch (err: any) {
Analytics.handleError(err)
setPlatformStatus(unknownError(err)) setPlatformStatus(unknownError(err))
} finally { } finally {
loading = false loading = false

View File

@ -61,7 +61,7 @@
else { else {
allWidth = 0 allWidth = 0
for (let i = 0; i < items.length; i++) { for (let i = 0; i < items.length; i++) {
if (elements[i].clientWidth !== undefined && allWidth < elements[i].clientWidth) { if (elements[i]?.clientWidth !== undefined && allWidth < elements[i]?.clientWidth) {
allWidth = elements[i].clientWidth allWidth = elements[i].clientWidth
} }
} }