fix: Resolve CI typecheck failures and improve type safety
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Fixes CI pipeline failures caused by missing Prisma Client generation and TypeScript type safety issues. Added Prisma generation step to CI pipeline, installed missing type dependencies, and resolved 40+ exactOptionalPropertyTypes violations across service layer. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,19 +52,20 @@ export class WebSocketGateway implements OnGatewayConnection, OnGatewayDisconnec
|
||||
* @param client - The authenticated socket client containing userId and workspaceId in data.
|
||||
* @returns Promise that resolves when the client is joined to the workspace room or disconnected.
|
||||
*/
|
||||
async handleConnection(client: AuthenticatedSocket): Promise<void> {
|
||||
const { userId, workspaceId } = client.data;
|
||||
async handleConnection(client: Socket): Promise<void> {
|
||||
const authenticatedClient = client as AuthenticatedSocket;
|
||||
const { userId, workspaceId } = authenticatedClient.data;
|
||||
|
||||
if (!userId || !workspaceId) {
|
||||
this.logger.warn(`Client ${client.id} connected without authentication`);
|
||||
client.disconnect();
|
||||
this.logger.warn(`Client ${authenticatedClient.id} connected without authentication`);
|
||||
authenticatedClient.disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
const room = this.getWorkspaceRoom(workspaceId);
|
||||
await client.join(room);
|
||||
await authenticatedClient.join(room);
|
||||
|
||||
this.logger.log(`Client ${client.id} joined room ${room}`);
|
||||
this.logger.log(`Client ${authenticatedClient.id} joined room ${room}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,13 +73,14 @@ export class WebSocketGateway implements OnGatewayConnection, OnGatewayDisconnec
|
||||
* @param client - The socket client containing workspaceId in data.
|
||||
* @returns void
|
||||
*/
|
||||
handleDisconnect(client: AuthenticatedSocket): void {
|
||||
const { workspaceId } = client.data;
|
||||
handleDisconnect(client: Socket): void {
|
||||
const authenticatedClient = client as AuthenticatedSocket;
|
||||
const { workspaceId } = authenticatedClient.data;
|
||||
|
||||
if (workspaceId) {
|
||||
const room = this.getWorkspaceRoom(workspaceId);
|
||||
void client.leave(room);
|
||||
this.logger.log(`Client ${client.id} left room ${room}`);
|
||||
void authenticatedClient.leave(room);
|
||||
this.logger.log(`Client ${authenticatedClient.id} left room ${room}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user