- presentDocuments: batch-load collection deletedAt for archived/deleted
documents so trash and archive listings no longer issue one Collection
query per document via isCollectionDeleted
- documents.search: present results through the batched presentDocuments
helper instead of one presentDocument call per result
- revisions.list: load collaborators for the whole page in a single User
query instead of one per revision, and stop fetching the unused content
and text columns when listing without content
- TextHelper.attachmentsToSignedUrls: fetch all attachments in one query
instead of one findOne per attachment id
- BacklinksProcessor: resolve linked documents and existing backlinks in
bulk queries and create missing backlinks with a single bulkCreate
- NotificationHelper: batch the per-recipient View lookup when filtering
comment notification recipients
- Add indexes covering hot queries that previously scanned: events
(teamId, createdAt) for the audit log, and shares (documentId) /
(collectionId) for shareLoader lookups
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTaaEHNxBrmBnoVa5iSJV6
* chore(deps): Remove unnecessary i18next-parser/i18next resolution
The resolution forced i18next inside the i18next-parser build tool to ^23.16.8, but i18next-parser declares it supports `^23.5.1 || ^24.2.0`. Removing the resolution lets it use the latest supported version (24.x), which is a dev-only upgrade with no runtime impact.
All other resolutions still prevent transitive packages from installing lower versions and remain required.
* fix(deps): Bump i18next-fs-backend to ^2.6.6 to address GHSA-2933-q333-qg83
Critical prototype-pollution advisory in i18next-fs-backend versions <2.6.6. Surfaced by the audit job that runs on dep changes. The bump is fully within the existing `^2.6.5` range and was already available — yarn was just holding the lockfile at 2.6.5.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: Add WWW-Authenticate header to /mcp 401 responses
RFC 9728 and the MCP authorization spec require protected resources to
include a WWW-Authenticate header on 401 responses so clients can
discover the authorization server via the resource metadata document.
* fix: Preserve existing WWW-Authenticate and guard against non-object errors
Avoid overwriting an upstream WWW-Authenticate header if one is already
present on the error (case-insensitive lookup), and only attempt to
attach headers when the thrown value is a non-null object.
RFC 7591 §2 marks every client metadata field as OPTIONAL. Outline's
schema currently treats client_name as required, which rejects MCP
clients that omit it during dynamic registration. The field becomes
optional and a generic 'Untitled application' label is used when the
caller doesn't supply one.
Drop rejectOnEmpty so a deleted team yields null and the existing optional
chaining guard short-circuits the no-op transaction.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The team or user can be deleted before the async processor runs, so
gracefully skip the avatar upload instead of throwing.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* feat(editor): support image corner drag resizing with aspect ratio lock
- Implement circular corner drag handles (ResizeTopLeft, ResizeTopRight, ResizeBottomLeft, ResizeBottomRight) using theme selection color.
- Update useDragResize hook to track coordinates as {x,y} object and handle aspect-ratio locked sizing for corner drags.
- Set overflow: visible on ImageWrapper to prevent corner handles from being clipped, and fade them in on hover.
* refactor(editor): simplify ResizeCorner styles by removing background and shadow properties
* fix(editor): fix corner resize speed and sync inputs in real-time
* fix(editor): improve corner resize cursor tracking and drag cursors
Project corner drag deltas onto the aspect-ratio vector so resizing
follows the pointer at 1x speed. Add a body class and global cursor
styles during image/media resize drags.
* refactor(editor): use relative import path inside shared directory
* fix(editor): resolve typescript type mismatch on dragging property in PDF component
* feat: support presigned PUT uploads for S3-compatible storage
Add `AWS_S3_UPLOAD_METHOD` config ("post" default / "put") so providers
that do not implement presigned POST (e.g. Cloudflare R2) can use
presigned PUT instead.
- BaseStorage.getPresignedPut() returns undefined by default; S3Storage
overrides with PutObjectCommand + getSignedUrl.
- Content-Length is signed into the presigned PUT URL so S3 rejects
uploads that do not match the declared size.
- API route and MCP tool branch on the config: only one upload method
is returned per request.
- Frontend uses existing presignedPutUrl presence check — unchanged.
- When put is configured but unsupported (e.g. LocalStorage), a clear
InvalidRequestError is returned.
Defaults to "post" — zero behavior change for existing deployments.
* refactor: return explicit upload mode instead of inferring from fields
Address review feedback from @tommoor: the client should not need to
infer the upload method from the presence of presigned-PUT-specific
fields. The API now returns an explicit `mode` ("put" | "post"), and the
PUT branch uses generic `url` / `headers` fields so the client has no
special knowledge of "presigned puts".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor: use this.getBucket() in presigned post/put methods
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* fix: correct find-and-replace highlight positions for CJK/Hangul text
The in-document find feature searched over `deburr(text) + text` and assumed
the deburred prefix had the same length as the original, mapping match indices
with `m.index - text.length`. `deburr` normalizes to NFD form, which decomposes
precomposed CJK/Hangul syllables (e.g. "강" is one UTF-16 code unit but
decomposes into three jamo), so the deburred prefix is longer than the original.
This broke the boundary assumption, producing misaligned highlights, undercounted
matches, and out-of-bounds positions (the "array index out of bounds" console
error from expandCollapsedCodeBlockForCurrentMatch).
Replace the length-based offset math with an explicit index map built by
`deburrWithMap`, which records the original index of every emitted code unit.
The text is searched both deburred (diacritic-insensitive) and verbatim, with
each match translated back to its true position via the map.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKAYuiMFqpBNbCPirhe8yk
* refactor: extract deburrWithMap into its own module with unit tests
Move the diacritics-stripping/index-map helper out of the extension into a
dedicated module so it can be unit-tested in isolation without pulling in the
editor's React/ProseMirror component tree. Add tests covering ASCII, diacritics,
Hangul (NFD-expanded) text, ASCII matches surrounded by CJK, and surrogate pairs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKAYuiMFqpBNbCPirhe8yk
* perf: add fast path to deburrWithMap to avoid per-character work
Only build the per-character index map when deburring actually changes the
string length (NFD-decomposed CJK/Hangul, expanded ligatures). For ASCII and
ordinary accented Latin text – where length is preserved and indices line up
1:1 – return an identity mapping with no per-character table, and skip the
redundant second search pass over deburred text when it equals the original.
Within the slow path, skip normalization of ASCII characters.
This keeps the common case as cheap as a single deburr() call (~0.4ms/keystroke
on a 100k-char document) and roughly halves the mixed-CJK cost.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKAYuiMFqpBNbCPirhe8yk
* test: cover interleaved ASCII and Hangul in deburrWithMap
Verify the index map stays consistent when ASCII characters (which take the
fast skip branch) are interleaved with Hangul characters (which decompose under
NFD), so every ASCII match still resolves to its exact original code unit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKAYuiMFqpBNbCPirhe8yk
* fix: skip zero-length deburred matches and reduce slow-path allocations
Address review feedback on the CJK find-and-replace fix:
- A regex match against the deburred text can cover only part of a decomposed
sequence (e.g. a single jamo of a Hangul syllable), which maps back to a
zero-length range in the original text. Recording such a range made replace
behave like an insert (from === to); skip matches where to <= from.
- Build the deburred string in the slow path by joining an array of parts once
instead of repeated string concatenation in the loop, keeping it linear with
less allocation churn.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TKAYuiMFqpBNbCPirhe8yk
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix: Retain location state when clicking on hash links in doc and TOC
* fix: Pass explicit location fields when navigating to hash links
Avoid spreading history.location (which carries internal fields like key)
and preserve the href's query string for absolute same-path links.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Refactor to patchLocation helper
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
The secrets context is not available in step-level if conditions, which
made the workflow file invalid. Map the secret to an env var and test
that instead.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* fix(test): restore plugin loading under Vite 8
Vite 8 dropped support for extglob negation (`!(...)`) in glob patterns,
so the test setup's plugin glob matched zero files and no plugin routes
were registered, causing every plugin API test to 404. Use Vite's
array-with-negative-patterns syntax to exclude test and schema files.
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* ci: run relative-ci agent action only when key secret is present
* ci: gate RelativeCI step on secret directly, drop redundant env block
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: umbraci <umbraci@qq.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* fix: Include surrounding container in document mention emails
getNodeForMentionEmail only preserved tables and checkbox lists around a
mention; mentions inside bullet/numbered lists, blockquotes and notices were
returned as a bare paragraph with their structure stripped. Add those
containers so the snippet keeps its context.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor: Resolve mention position and walk ancestors for email snippet
Replace the top-down scan-and-guess over a block-node allowlist with a single
position resolve and an ancestor walk. Behaviour is unchanged — same outermost
container, minified to the child on the path to the mention — but extraction is
idiomatic ProseMirror and drops the redundant subtree traversals.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* refactor: Size-bound mention email snippet, drop container special-casing
Replace the per-type container allowlist and minify logic with a single rule:
climb the mention's ancestor chain outward and keep the largest complete block
that still fits a character budget. This drops all special-casing, is robust to
new node types, and naturally bounds snippet size.
Semantics change accordingly — a small container is now shown whole (with its
sibling rows/items) rather than minified to the mention's child, degrading to an
inner block once the container overflows the budget. Tests updated to match.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* feat: Window mention email snippet to nearby list items
Lists can be long, so instead of including the whole list as the size-bounded
walk would, trim a surrounding list to the mentioned item plus one sibling on
either side. Uses the nearest list ancestor so nested lists show the items
closest to the mention. Non-list content keeps the size-bounded behaviour.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix: Ensure mention in doc emails always include context
* PR feedback
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
An empty Notion table was converted to a schema-invalid table node with
no rows. Node.fromJSON accepts it, but Markdown serialization then crashed
in renderTable's node.child(0), surfacing only "Index 0 out of range for <>".
Drop empty tables in the Notion converter, and guard renderTable against
tables with no rows so any source is handled safely.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>