You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* improvement(files): cache stream binding meta, tighten file cache-control, prune dead persist path
- Cache the agent-stream ProseMirror↔Yjs binding metadata per session and reuse it
across streamed frames instead of rebuilding it (O(doc)) every frame; matches how
y-tiptap's own binding maintains the mapping in place. Safe because the shadow doc
only ever sees the agent's own reconciles.
- Default createFileResponse to a private, no-cache policy so auth-gated bytes are never
stored in a shared cache; genuinely-public serve routes opt into public caching
explicitly.
- Serve content-addressed (key=) embedded images with an immutable private cache to
avoid re-downloading them on every doc re-open; fileId= embeds and public shares keep
revalidating (the underlying key can change / a share can be revoked).
- Drop the dead conflict.version field from the collab-doc persist result and remove the
wasted getWorkspaceFile re-read on the conflict path (the relay treats missing and
conflict identically and never read version).
- Decorate-sort the files/folders lists (compute each sort key once) and index the
move-menu subtree build (O(N) vs O(N^2)); ordering is preserved exactly.
* fix(files): serve inline images with no-cache so deletion/authorization is enforced per request
Embedded images are authenticated content whose backing file can be deleted or have its
access revoked at any time. Both key= and fileId= embeds serve
private, no-cache, must-revalidate, so every request re-runs the server-side
deletion/authorization check instead of serving a possibly-stale image from cache.
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/apply-streamed-markdown.test.ts
+37-1Lines changed: 37 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,12 @@ import { afterEach, beforeAll, describe, expect, it } from 'vitest'
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/apply-streamed-markdown.ts
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -810,10 +810,10 @@ export function LoadedRichMarkdownEditor({
810
810
if(editor.isEditable===isEditable)return
811
811
// Defer out of the render/commit phase. `isEditable` flips from collab readiness (synced + seeded),
812
812
// which is driven by a Yjs `config.observe` firing synchronously inside `Y.applyUpdate` — so this
813
-
// effect can run while React is mid-render. `setEditable` dispatches a TipTap transaction that the
814
-
// React binding commits with `flushSync`, which throws ("cannot flush while rendering") in that
815
-
// window. A microtask runs right after the current commit, before paint; re-check liveness/value
816
-
// since either can change before it fires.
813
+
// effect can run while React is mid-render. `setEditable` re-applies the view state and emits an
814
+
// `update` that the React binding commits with `flushSync`, which throws ("cannot flush while
815
+
// rendering") in that window. A microtask runs right after the current commit, before paint; re-check
816
+
// liveness/value since either can change before it fires.
0 commit comments