From b061df7f7d7451f4f9850e8f970bac3f9f6a13aa Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 13 Dec 2025 14:15:06 +0000 Subject: [PATCH 1/4] Use new fastify router options --- apps/server/src/main.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/server/src/main.ts b/apps/server/src/main.ts index 8a2719302..79340d6e6 100644 --- a/apps/server/src/main.ts +++ b/apps/server/src/main.ts @@ -15,10 +15,12 @@ async function bootstrap() { const app = await NestFactory.create( AppModule, new FastifyAdapter({ - ignoreTrailingSlash: true, - ignoreDuplicateSlashes: true, - maxParamLength: 1000, trustProxy: true, + routerOptions: { + maxParamLength: 1000, + ignoreTrailingSlash: true, + ignoreDuplicateSlashes: true, + }, }), { rawBody: true, From d59539f197a65bfe44a19687dc7299aa8d1f3bc7 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sat, 13 Dec 2025 14:15:41 +0000 Subject: [PATCH 2/4] fix ai streaming --- apps/client/src/ee/ai/services/ai-search-service.ts | 8 ++++++-- apps/server/src/ee | 2 +- .../integrations/environment/environment.validation.ts | 2 +- packages/editor-ext/src/lib/utils.ts | 3 +-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/client/src/ee/ai/services/ai-search-service.ts b/apps/client/src/ee/ai/services/ai-search-service.ts index 0254f5b25..759a104ae 100644 --- a/apps/client/src/ee/ai/services/ai-search-service.ts +++ b/apps/client/src/ee/ai/services/ai-search-service.ts @@ -37,14 +37,18 @@ export async function askAi( let answer = ""; let sources: any[] = []; + let buffer = ""; if (reader) { while (true) { const { done, value } = await reader.read(); if (done) break; - const chunk = decoder.decode(value); - const lines = chunk.split("\n"); + buffer += decoder.decode(value, { stream: true }); + const lines = buffer.split("\n"); + + // Keep the last incomplete line in the buffer + buffer = lines.pop() || ""; for (const line of lines) { if (line.startsWith("data: ")) { diff --git a/apps/server/src/ee b/apps/server/src/ee index 18e00b186..075761c2d 160000 --- a/apps/server/src/ee +++ b/apps/server/src/ee @@ -1 +1 @@ -Subproject commit 18e00b18666060e43906740fd28c8a64800637c8 +Subproject commit 075761c2d9bcae7adcc3de4b1c5b8f8c3b315878 diff --git a/apps/server/src/integrations/environment/environment.validation.ts b/apps/server/src/integrations/environment/environment.validation.ts index 752e3d416..5ac1b11b4 100644 --- a/apps/server/src/integrations/environment/environment.validation.ts +++ b/apps/server/src/integrations/environment/environment.validation.ts @@ -117,7 +117,7 @@ export class EnvironmentVariables { @IsOptional() @ValidateIf((obj) => obj.AI_EMBEDDING_DIMENSION) - @IsIn(['768', '1024', '1536']) + @IsIn(['768', '1024', '1536', '2000']) @IsString() AI_EMBEDDING_DIMENSION: string; diff --git a/packages/editor-ext/src/lib/utils.ts b/packages/editor-ext/src/lib/utils.ts index a581c5812..e4e7fda42 100644 --- a/packages/editor-ext/src/lib/utils.ts +++ b/packages/editor-ext/src/lib/utils.ts @@ -3,7 +3,6 @@ import { Editor, findParentNode, isTextSelection } from "@tiptap/core"; import { Selection, Transaction } from "@tiptap/pm/state"; import { CellSelection, TableMap } from "@tiptap/pm/tables"; import { Node, ResolvedPos } from "@tiptap/pm/model"; -import Table from "@tiptap/extension-table"; import { sanitizeUrl as braintreeSanitizeUrl } from "@braintree/sanitize-url"; import { customAlphabet } from "nanoid"; @@ -289,7 +288,7 @@ export const isColumnGripSelected = ({ const node = nodeDOM || domAtPos; if ( - !editor.isActive(Table.name) || + !editor.isActive("table") || !node || isTableSelected(state.selection) ) { From 2544775266998fdd9d9f60cc036a2dd14e509491 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sun, 14 Dec 2025 13:16:40 +0000 Subject: [PATCH 3/4] fix: switch to node slim image --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 02a35ffcf..1f3b57df4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22-alpine AS base +FROM node:22-slim AS base LABEL org.opencontainers.image.source="https://github.com/docmost/docmost" FROM base AS builder @@ -13,7 +13,9 @@ RUN pnpm build FROM base AS installer -RUN apk add --no-cache curl bash +RUN apt-get update \ + && apt-get install -y --no-install-recommends curl bash \ + && rm -rf /var/lib/apt/lists/* WORKDIR /app From 732951a322c5a915220f13613d3c646c368264b2 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Sun, 14 Dec 2025 13:24:09 +0000 Subject: [PATCH 4/4] v0.24.1 --- apps/client/package.json | 2 +- apps/server/package.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/client/package.json b/apps/client/package.json index 9d45fa071..db92ac240 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,7 +1,7 @@ { "name": "client", "private": true, - "version": "0.24.0", + "version": "0.24.1", "scripts": { "dev": "vite", "build": "tsc && vite build", diff --git a/apps/server/package.json b/apps/server/package.json index c662a7acf..d7c48f07b 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "server", - "version": "0.24.0", + "version": "0.24.1", "description": "", "author": "", "private": true, diff --git a/package.json b/package.json index d9dc6d91f..14aea03fe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "docmost", "homepage": "https://docmost.com", - "version": "0.24.0", + "version": "0.24.1", "private": true, "scripts": { "build": "nx run-many -t build",