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
{{ message }}
Repository navigation
[P3] Multi-markdown import path has no aggregate size guard #1155
stagePickedNonJsonFiles (src/components/studio/views/import-staging.ts) reads every picked Markdown file into memory with await file.text() and has no aggregate size cap. A folder pick containing thousands of large notes buffers them all before parsing.
Asymmetry
The sibling import paths are guarded:
JSON branch (use-export-handlers.ts): checkImportSize(file.size) before FileReader.
Zip branch: readVaultZip enforces MAX_VAULT_ZIP_BYTES, MAX_VAULT_ZIP_ENTRIES, MAX_VAULT_UNCOMPRESSED_BYTES.
Acceptance criteria
Folder/multi-markdown picks enforce a total-bytes cap consistent with the existing import limits, failing closed with the standard import-failed toast.
Covered by a unit test that stages an oversized batch and observes the rejection (test must be seen to fail without the guard — LESSON-041).
Found during post-CI review of PR #1154 (review comment); not a merge blocker.
Aggregate cap added to the shared Markdown import service: batch total and per-file character limits fail closed before any parse (checkVaultLimits, packages/dks-core/src/markdown.ts), and the staging layer surfaces the rejection as an i18n'd toast (src/components/studio/views/import-staging.ts).
Covered by src/lib/import/markdown-import.test.ts (oversized batch/total) and the dks-core suite.
Activity
feat(studio): data integrity, storage health, and shared core (plans/…
d-oit commentedon Nov 19, 2026
Implemented in #1178 (committed as 90246d1).
checkVaultLimits,packages/dks-core/src/markdown.ts), and the staging layer surfaces the rejection as an i18n'd toast (src/components/studio/views/import-staging.ts).src/lib/import/markdown-import.test.ts(oversized batch/total) and the dks-core suite.