From b5aefcf3a83d9b5fac411bbe34f2281f0aeabe56 Mon Sep 17 00:00:00 2001 From: SandipBajracharya Date: Thu, 19 Feb 2026 20:06:04 +0545 Subject: [PATCH 1/2] fix(OUT-3164): prevent file sync from assembly to dbx when connection is false --- src/features/webhook/assembly/api/webhook.controller.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/features/webhook/assembly/api/webhook.controller.ts b/src/features/webhook/assembly/api/webhook.controller.ts index 5619d55..09c0c19 100644 --- a/src/features/webhook/assembly/api/webhook.controller.ts +++ b/src/features/webhook/assembly/api/webhook.controller.ts @@ -19,6 +19,11 @@ export const handleWebhookEvent = async (req: NextRequest) => { const dropboxConnectionService = new DropboxConnectionsService(user) const connection = await dropboxConnectionService.getConnectionForWorkspace() + if (!connection.status) { + console.info(`Sync is not enabled for this workspace. Skipping webhook event`) + return NextResponse.json({}) + } + if (!connection.refreshToken) throw new APIError('No refresh token found', httpStatus.NOT_FOUND) if (!connection.accountId) throw new APIError('No accountId found', httpStatus.NOT_FOUND) From 50cd98ab22992b9dfee92357eeb892e565a39379 Mon Sep 17 00:00:00 2001 From: SandipBajracharya Date: Thu, 19 Feb 2026 20:51:17 +0545 Subject: [PATCH 2/2] fix(OUT-3164): update filename sanitization process --- src/utils/filePath.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utils/filePath.ts b/src/utils/filePath.ts index 211cc1b..95093f8 100644 --- a/src/utils/filePath.ts +++ b/src/utils/filePath.ts @@ -82,6 +82,15 @@ export function sanitizePath(path: string) { } export function sanitizeFileNameForAssembly(filename: string): string { + return unorm + .nfd(filename) // decompose accents + .replace(/[\u0300-\u036f]/g, '') // remove diacritics + .replace(/[^a-zA-Z0-9._/() -]/g, '_') // replace special chars with _ + .replace(/_+/g, '_') // collapse multiple _ + .replace(/^_+|_+$/g, '') // trim _ from ends +} + +export function getFaultyPath(filename: string): string { return unorm .nfd(filename) // decompose accents .replace(/[\u0300-\u036f]/g, '') // remove diacritics