Skip to content

Commit

Permalink
bump packages, remove some eslint suppressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davwas committed Nov 16, 2023
1 parent bf353a8 commit 0978eda
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
1 change: 0 additions & 1 deletion apps/server/src/modules/tldraw/controller/tldraw.ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class TldrawWs implements OnGatewayInit, OnGatewayConnection {
},
writeState: async (docName) => {
// This is called when all connections to the document are closed.
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
await this.tldrawWsService.flushDocument(docName);
},
});
Expand Down
10 changes: 1 addition & 9 deletions apps/server/src/modules/tldraw/repo/tldraw-board.repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,16 @@ export class TldrawBoardRepo {
this.flushSize = this.configService.get<number>('TLDRAW_DB_FLUSH_SIZE') ?? 400;
this.multipleCollections = this.configService.get<boolean>('TLDRAW_DB_MULTIPLE_COLLECTIONS');

// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment
this.mdb = new MongodbPersistence(this.connectionString, {
collectionName: this.collectionName,
flushSize: this.flushSize,
multipleCollections: this.multipleCollections,
});
}

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// eslint-disable-next-line consistent-return
public async getYDocFromMdb(docName: string): Promise<Doc> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
const yDoc = await this.mdb.getYDoc(docName);
if (yDoc instanceof Doc) {
return yDoc;
}
return yDoc;
}

public updateStoredDocWithDiff(docName: string, diff: Uint8Array): void {
Expand All @@ -66,7 +59,6 @@ export class TldrawBoardRepo {
}

public async flushDocument(docName: string): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
await this.mdb.flushDocument(docName);
}
}
6 changes: 3 additions & 3 deletions apps/server/src/modules/tldraw/service/tldraw.ws.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { TldrawConfig } from '@src/modules/tldraw/config';
import { Persitence, WSConnectionState, WSMessageType, WsSharedDocDo } from '@src/modules/tldraw/types';
import { Persistence, WSConnectionState, WSMessageType, WsSharedDocDo } from '@src/modules/tldraw/types';
import WebSocket from 'ws';
import { applyAwarenessUpdate, encodeAwarenessUpdate, removeAwarenessStates } from 'y-protocols/awareness';
import { encoding, decoding, map } from 'lib0';
Expand All @@ -15,7 +15,7 @@ import { LegacyLogger } from '@src/core/logger';
export class TldrawWsService {
public pingTimeout: number;

public persistence: Persitence | null = null;
public persistence: Persistence | null = null;

public docs = new Map();

Expand Down Expand Up @@ -43,7 +43,7 @@ export class TldrawWsService {
this.pub.on('error', (err) => this.logger.error(err));
}

public setPersistence(persistence_: Persitence): void {
public setPersistence(persistence_: Persistence): void {
this.persistence = persistence_;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/modules/tldraw/types/persistence-type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { WsSharedDocDo } from '@src/modules/tldraw/domain/ws-shared-doc.do';

export type Persitence = {
export type Persistence = {
bindState: (docName: string, ydoc: WsSharedDocDo) => Promise<void>;
writeState: (docName: string, ydoc: WsSharedDocDo) => Promise<void>;
};
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@
"urlsafe-base64": "^1.0.0",
"uuid": "^8.3.0",
"winston": "^3.8.2",
"y-mongodb-provider": "^0.1.7",
"y-protocols": "^1.0.5",
"yjs": "^13.6.7"
"y-mongodb-provider": "^0.1.8",
"y-protocols": "^1.0.6",
"yjs": "^13.6.8"
},
"devDependencies": {
"@aws-sdk/client-s3": "^3.352.0",
Expand Down

0 comments on commit 0978eda

Please sign in to comment.