Commit Graph
3156 Commits
Author SHA1 Message Date
Tom Moor 1268d5c250 fix: Account for Entra UPN during signin
closes #12973
2026-07-12 11:56:44 -04:00
Tom MoorandClaude f5b45e3d88 feat: section-aware unfurl previews for heading links (#12857)
* feat: section-aware unfurl previews for heading links

When a link targets a specific heading (URL hash anchor), the hover
preview now shows the content of that section rather than the top of
the document.

Adds DocumentHelper.getAnchorContent which extracts the Markdown for the
section beginning at the heading matching a given anchor, spanning until
the next heading of the same or higher level. The urls.unfurl endpoint
passes the URL hash through to the document presenter for both internal
and public share links.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185Tt87p63vsnAC8oGSLLRs

* fix: retain heading anchor in internal document unfurl url

The internal-document unfurl branch never passed a url to the presenter,
so the response fell back to document.url without the hash. Clicking the
hover preview then navigated to the top of the document rather than the
summarized section. Re-append the anchor in the presenter fallback so the
unfurl points at the same heading it previews.

Also supports the mention anchorId path: document mentions serialize their
anchorId into the href hash, which flows through this same path.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-11 08:05:56 -04:00
石岳峰andsyf2211 8b5f9cd456 fix(mcp): return text content for empty list tool results (#12864)
* fix(mcp): return text content for empty list tool results

When MCP list tools return zero items, success([]) previously produced
an empty content array. Anthropic's MCP connector rejects that format.

Return a single JSON text block for empty arrays so clients can
distinguish no results from a broken tool response.

Fixes #12858

* test(mcp): handle empty list sentinel in integration tests

Add parseMcpListContent helper for the [] sentinel block and update
list tool tests that can receive zero results.

* test(mcp): fix list_collections type assertion in integration test

---------

Co-authored-by: syf2211 <syf2211@users.noreply.github.com>
2026-07-10 19:34:56 -04:00
6a14ac8ae6 feat: Slab importer (#12859)
* Add Slab importer backed by the Markdown import pipeline

Slab exports a zip of Markdown documents that is structurally identical to
the Outline Markdown export, with one difference: images are referenced as
remote signed URLs rather than files inside the archive.

Rather than build a parallel importer, this reuses the Markdown task and
processor and teaches the shared import pipeline to download remote images:

- Enable per-page attachment upload for the Markdown task. The base
  APIImportTask already downloads remote image/video/attachment URLs and
  rewrites them to internal redirect URLs; the Markdown task previously
  opted out because its attachments live in the zip.
- Make the base upload step skip URLs that are already internal, so local
  zip attachments (resolved to redirect URLs during rewriteMarkdown and
  uploaded from the archive in onAllTasksCompleted) pass through untouched
  while remote URLs are fetched and re-hosted. Also guards the URL rewrite
  against nodes not present in the download map.
- Introduce IntegrationService.Slab as a distinct, importable service that
  routes through the Markdown task/processor, so imports are tracked and
  labelled as "Slab" with no duplicated import logic.
- Wire the create API (schema + route), the import settings UI (Slab card
  and dialog), and a placeholder logo asset.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o

* Add shell SlabAPIImportTask as a Slab-specific seam

Slab imports previously ran through MarkdownAPIImportTask directly. Introduce
a thin SlabAPIImportTask subclass so Slab gets its own task name (for
scheduling, tracing, and retries) and a dedicated place to override
behavior as Slab exports diverge from the generic Markdown shape.

The subclass inherits all conversion/attachment/persistence logic and only
overrides scheduleNextTask to keep the whole import chain on the Slab class.
MarkdownImportsProcessor now selects the task implementation by the import's
service when scheduling the first task.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o

* Unwrap single root "slab" directory in Slab imports

Slab exports wrap the entire workspace in a single top-level directory named
"slab". Without handling this, the import produces one "slab" collection
containing everything, instead of mapping each workspace area to its own
collection.

Add a `resolveCollectionRootNodes` seam on the Markdown bootstrap phase
(default: pass entries through unchanged) and override it in SlabAPIImportTask
to descend into a lone, case-insensitive "slab" root directory so its child
directories become collections. Paths are left intact, so the attachment
manifest, completion re-walk, and internal-link resolution stay consistent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o

* Use the filename, not the first heading, as the title for Slab imports

In Slab a document's leading heading is real content, not its title — the
filename is authoritative. Add an `extractTitle` option to
DocumentConverter.convert (default true, preserving existing callers) that,
when false, skips lifting a leading H1 into the title and leaves it in the
body. Expose it through a `shouldExtractTitleFromHeading` seam on the
Markdown task and override it in SlabAPIImportTask. With no extracted title,
the page falls back to the filename-derived title.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o

* Update logo

* Narrow MarkdownAPIImportTask generic back to Markdown

Slab imports now run through SlabAPIImportTask, so the base Markdown task no
longer handles the Slab service directly and its generic can return to
Markdown-only. SlabAPIImportTask keeps a Markdown | Slab union on its
scheduleNextTask override, which is required so the override stays a valid
(contravariant) override of the base's Markdown-typed parameter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o

* Optimised images with calibre/image-actions

* reorder

* Move Slab importer into its own plugin

Restructure the Slab importer to live in plugins/slab, mirroring the Notion
plugin, instead of being threaded through the core Markdown importer.

- plugins/slab/server registers SlabImportsProcessor (Hook.Processor) and
  SlabAPIImportTask (Hook.Task). The processor extends MarkdownImportsProcessor
  to claim the Slab service and schedule the Slab task; the task keeps its
  Slab-specific overrides (remote image download, root "slab" dir unwrap,
  filename-as-title).
- plugins/slab/client registers the Slab import card (Hook.Imports) and owns
  the import dialog.
- Revert MarkdownImportsProcessor to Markdown-only and drop the hardcoded Slab
  card from the Import settings screen.

The Slab service enum, import schema, and create route remain in core, as the
Notion plugin's equivalents do.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o

* Generalize DropToImport to accept an importable service

DropToImport previously branched on `format` to map MarkdownZip/JSON/Slab
to specific imports.create calls, with a dead collections.import fallback.
Replace this with a single `service` prop and one generic imports.create
call. Core no longer hardcodes any service name (notably the Slab plugin
service), and the Markdown, JSON, and Slab dialogs each pass their service.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-07-10 19:05:08 -04:00
Tom MoorandClaude Opus 4.8 96372c97b6 fix: Hand desktop sign-in back to the app on self-hosted deployments (#12952)
* fix: Hand desktop sign-in back to the app on self-hosted deployments

The desktop `/desktop-redirect` handoff — which bounces the transfer token
back into the app via the `outline://` protocol — was nested inside the
`env.isCloudHosted && team.subdomain` branch of `signIn`. On a self-hosted
deployment that branch is never taken, so a desktop OIDC (or any) sign-in fell
through to the single-domain path, which set an `accessToken` cookie in the
browser and redirected to the app's home. The desktop app never received the
token and appeared to hang on the SSO screen.

Move the desktop handoff out of the cloud-hosted guard so it runs for every
deployment. The cloud sessions cookie is still written for cloud-hosted teams
(web and desktop alike), and the web / single-domain redirects are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wv8LuN54DQoxofSoWmTPVK

* refactor: Encode transfer token in redirect URLs and clarify comment

Address PR review: URL-encode the transfer token before interpolating it into
the desktop-redirect and auth/redirect query strings so the value can't
truncate the query if the token format ever changes, and reword the comment
that inaccurately described a cookie being set in this branch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wv8LuN54DQoxofSoWmTPVK

* docs: Trim desktop redirect comment

Remove the trailing explanation added earlier; the comment reads cleaner
without it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wv8LuN54DQoxofSoWmTPVK

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-10 17:42:33 -04:00
Tom Moor 3539278653 chore: Flaky test (#12957) 2026-07-10 22:33:35 +02:00
Tom Moor 361c875d04 fix: Presigned POST with accelerate (#12946) 2026-07-09 05:27:38 -04:00
ZhuoYang Wu(阿离) 49952b971f feat: Add HTML input support to MCP create_document (#12943) 2026-07-09 03:51:36 -04:00
Tom MoorandClaude Fable 5 032379da93 feat: Add support for OIDC provider returning JWT from userinfo endpoint (#12879)
* feat: Add support for OIDC provider returning JWT from userinfo endpoint

closes #12878

* PR feedback

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 16:28:13 +02:00
Tom MoorandClaude Fable 5 d15fb6c6bc Change MCP _update tools to return error with no changes (#12890)
* fix: Reject document updates that contain no updatable fields

A documents.update request carrying a valid id but no recognized body
field (e.g. text omitted, or an unmapped key stripped by validation)
previously returned 200 OK while writing nothing, so API and MCP
callers could believe content was persisted when nothing changed.

documentUpdater now throws a ValidationError when none of the
updatable properties are provided, making the no-op fail loud with a
400 for both the REST route and the MCP update_document tool. Requests
that only signal an editing session (done) or publish a draft continue
to work.

Closes #12875

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCYPC1guJ85BezXLNw8Zjo

* fix: Error on MCP document update with no fields provided

Scope the no-op guard to the MCP surface only, and derive it from the
provided input rather than a hardcoded list of properties: any key
other than id counts, since the tool schema already strips
unrecognized fields.

Closes #12875

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCYPC1guJ85BezXLNw8Zjo

* fix: Base MCP no-op update detection on whether the document changed

Compare the document's revisionCount before and after documentUpdater
runs instead of inspecting the request input. Every save increments
revisionCount, so an unchanged count means nothing was persisted —
this catches both requests with no recognized fields and requests
whose values are identical to the current document.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCYPC1guJ85BezXLNw8Zjo

* fix: Extend no-op update detection to all MCP update tools

Apply the same fail-loud behavior to update_collection and
update_comment: check model.changed() before saving and return an
error when the request would persist nothing. Mark all three update
tools as non-idempotent since retrying an already-applied update now
returns an error rather than a second success.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCYPC1guJ85BezXLNw8Zjo

* chore: Fix punctuation in no-op update error messages

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCYPC1guJ85BezXLNw8Zjo

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-08 08:31:35 -04:00
Tom MoorandClaude Fable 5 a1d0520c9f Add missing JSDoc to exported members in app and server utils (#12940)
* Add missing JSDoc to exported members in app and server utils

Documents all exported functions, classes, enums, and constants in
app/utils and server/utils that were missing JSDoc, per the project
documentation guidelines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AsEQYA8zN813thxu7GjjzU

* Use @returns tag to match codebase convention

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AsEQYA8zN813thxu7GjjzU

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-08 08:30:11 -04:00
Tom MoorandClaude Fable 5 3fcef8d68e fix: validateUrlNotPrivate hardening (#12938)
* fix: Validate all DNS records in validateUrlNotPrivate SSRF check

A hostname with multiple A/AAAA records would pass validation as long as
the first record returned was public, even if another record pointed at a
private or link-local address the connection could actually use. Resolve
with { all: true } and reject if any record is private and not allowlisted.

Also wrap DNS resolution failures in InvalidRequestError so an unresolvable
hostname returns a clean 400 instead of an unhandled ENOTFOUND.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UotVRi1xphwNwAchiZZNi5

* chore: Add explicit type for resolved DNS addresses

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UotVRi1xphwNwAchiZZNi5

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-08 08:28:39 -04:00
Tom MoorandCopilot Autofix powered by AI d67e682594 fix: Math formulas not rendering correctly in HTML/PDF output (#12939)
* fix: Math formulas not rendering correctly in HTML/PDF output

* Fix version exactly.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-08 08:50:57 +00:00
Tom MoorandClaude Fable 5 db1d93f9b5 perf: Use SCAN and batched UNLINK instead of KEYS in CacheHelper.clearData (#12934)
* perf: Use SCAN and batched UNLINK instead of KEYS in CacheHelper.clearData

The KEYS command blocks the Redis event loop while it walks the entire
keyspace, which stalls all other clients on large installations —
notably on startup where the whole unfurl cache prefix is cleared.
Replace it with incremental SCAN iteration and delete the matched keys
in batches with UNLINK, which reclaims memory asynchronously, so
neither discovery nor deletion blocks the server. Adds test coverage
for CacheHelper including multi-page prefix clears.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K9AAwaGTLVQZnp7uv5Ebj

* fix: Address review comments on CacheHelper.clearData

Unlink each SCAN batch as the scan progresses instead of buffering all
matching keys in memory, repeating until a full pass matches nothing so
implementations with unstable scan cursors still clear every key. Wrap
the operation in try/catch with logging for consistency with the other
CacheHelper methods, and mark constants as readonly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015K9AAwaGTLVQZnp7uv5Ebj

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-08 04:42:02 -04:00
Tom MoorandClaude Opus 4.8 8ea04c3bd4 fix: Skip attachment work in exports when includeAttachments is false (#12933)
Gate the workspace attachment-size query behind includeAttachments so it
no longer runs when attachments are excluded, and thread includeAttachments
through the single-document export path (previously hardcoded to true).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 10:20:18 +02:00
Tom Moor d3c085462d fix: Sensitive fields can leak into logging when non-primitive (#12910) 2026-07-06 22:57:43 +02:00
Tom Moor ec3b26241f chore: Reduce file scanning in PluginManager on startup (#12911) 2026-07-06 22:57:39 +02:00
Tom MoorandClaude Fable 5 2b6ee79778 fix: all _FILE suffix secrets in env are cemented at startup (#12889)
* fix: Resolve _FILE env secrets lazily to avoid clobbering third-party variables

The Docker-style secrets support added in #11906 eagerly copied every
*_FILE environment variable into its base variable at boot. This broke
AWS SDK credential refresh on EKS Pod Identity: the rotating token in
AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE was frozen into the static
AWS_CONTAINER_AUTHORIZATION_TOKEN variable, which the SDK prefers and
never re-reads, so S3 access failed once the boot-time token expired.
It similarly resolved the standard OpenSSL SSL_CERT_FILE CA bundle into
Outline's SSL_CERT setting, failing validation at startup.

File secrets are now resolved lazily through a proxy when a variable is
read off the environment export, which limits resolution to variables
declared on the Environment classes, and SSL_CERT_FILE is explicitly
reserved for OpenSSL.

Fixes #12885

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqP3Gb29iG5bJmhYuEAAjF

* refactor: Generalize reserved file variable documentation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqP3Gb29iG5bJmhYuEAAjF

* refactor: Clear SSL_CERT_FILE in test environment instead of reserving it

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqP3Gb29iG5bJmhYuEAAjF

* docs: Trim withFileSecrets JSDoc

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MqP3Gb29iG5bJmhYuEAAjF

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-06 16:14:03 -04:00
Tom Moor a60373118c fix: Handle transient errors in HealthMonitor (#12913) 2026-07-06 16:13:32 -04:00
Tom Moor 3e5d21fa11 fix: revisions.list response too large (#12822) 2026-06-30 13:35:30 -04:00
Tom Moor ec3200c7d2 chore: babel -> swc (#12821)
* chore: babel -> swc

* Add ls guard

* PR feedback
2026-06-29 17:11:02 -04:00
Tom MoorandClaude Opus 4.8 695042b2af feat: Batch RPC endpoint (#12820)
* batch RPC endpoint

* Clamp batch socket timeout between 15s and 25s

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 02:39:30 -04:00
Cassiano Vailati 34907e1500 fix: Add WWW-Authenticate header to /mcp 401 responses (#12834)
* 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.
2026-06-25 21:21:15 -04:00
Cassiano Vailati 4845da08ac fix: Make client_name optional on /oauth/register (#12836)
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.
2026-06-25 20:49:41 -04:00
Tom MoorandClaude Opus 4.8 7b809ab48c fix: Avoid SequelizeEmptyResultError when team is missing in CollectionsProcessor (#12837)
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>
2026-06-25 20:49:09 -04:00
Tom MoorandClaude Opus 4.8 6a81426181 fix: Avoid SequelizeEmptyResultError in AvatarProcessor (#12838)
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>
2026-06-25 20:49:05 -04:00
Tom MoorandClaude Opus 4.8 e237e6df47 fix: Handle deleted user or team in UserCreatedProcessor (#12839)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 20:49:02 -04:00
Yinhao HuangandClaude Opus 4.8 6286d08171 feat: support presigned PUT uploads for S3-compatible storage (#12748)
* 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>
2026-06-24 21:05:16 -04:00
Tom Moor c3669a1f1a fix: Guard against orphaned jobs in queue (#12819) 2026-06-24 17:54:08 -04:00
Tom Moor 5f236935bc fix: CleanupDemotedUserTask throws on deleted user (#12818)
closes #12815
2026-06-24 17:54:01 -04:00
Tom Moor 97c6cc3ab3 fix: Guard missing key in manifest (#12806) 2026-06-23 21:16:20 -04:00
Tom MoorandClaude Opus 4.8 e646b14225 fix(test): restore plugin loading under Vite 8 (#12792)
* 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>
2026-06-22 21:41:47 -04:00
Tom MoorandClaude Opus 4.8 19a4922ed1 fix: Ensure mention in doc emails always include context (#12787)
* 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>
2026-06-22 19:28:26 -04:00
Tom MoorandClaude Opus 4.8 7cff0911cd fix: Notion import crash on empty table ("Index 0 out of range") (#12775)
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>
2026-06-22 18:34:23 -04:00
Tom Moor bd013dbfa5 fix: Remove quote flattening on markdown serialization (#12774)
* fix: Remove quote flattening on markdown serialization

closes #12773

* PR feedback
2026-06-21 18:36:00 -04:00
Tom Moor e1a6c986b7 Remove settings from integration presenter (#12770)
* Remove settings from integration presenter

* refactor
2026-06-21 15:06:10 -04:00
Tom MoorandClaude Opus 4.8 b2bf82d78b Add composite (userId, createdAt) index for searches.list (#12767)
* Add composite (userId, createdAt) index for searches.list

The searches.list endpoint filters by userId/teamId and orders by
createdAt DESC, but search_queries only had single-column indexes. Since
a row is inserted on every search, the table grows large and the planner
must either fetch and sort a user's entire search history or scan the
createdAt index until enough matching rows are found — both proportional
to history size rather than page size.

Add a composite index on (userId, createdAt) so the query can seek
directly to the user's rows in createdAt order and stop after LIMIT rows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wAHcneY9eV4fZtCBq8Ue3

* Drop redundant userId and unused createdAt indexes on search_queries

With the new (userId, createdAt) composite index in place, the
single-column userId index is fully redundant (covered as a leftmost
prefix) and the createdAt index is unused — no query orders or filters
by createdAt without also constraining userId. Dropping both removes
index-maintenance overhead on the high-write search_queries table. The
teamId index is kept for the team permanent deleter.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wAHcneY9eV4fZtCBq8Ue3

* Use CONCURRENTLY for search_queries index changes to avoid table locks

Switch the composite index creation and the redundant index drops to raw
CREATE/DROP INDEX CONCURRENTLY IF [NOT] EXISTS so the migration takes no
blocking lock on the high-traffic search_queries table. The migration
runner (Umzug) does not wrap migrations in a transaction, so CONCURRENTLY
is safe here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013wAHcneY9eV4fZtCBq8Ue3

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-21 08:01:56 -04:00
Tom Moor 1265d23482 fix: Viewer can disclose existing shared document (#12769) 2026-06-21 08:00:16 -04:00
Tom MoorandClaude Opus 4.8 8cd23e40bf fix: Vertically center empty state in notifications popover (#12764)
* fix: Vertically center empty state in notifications popover

The empty state relied on percentage heights to center, but the
height chain was broken by the outer container only setting min/max
height. Switch to flexbox growth so the scroll region fills the
available space and the empty message centers reliably.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J7kMKxnH5gfziT5GNgsXZW

* chore: Add development util to create test notifs

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-20 21:42:18 -04:00
Tom MoorandClaude Opus 4.8 4383324b30 feat: Add setting to enable guest commenting (#12591)
* Treat legacy boolean commenting preference as disabled

Teams not yet migrated to the CommentingAccess enum may still have a
boolean `false` stored for the commenting preference. Guard the
enabled checks so `false` reads as disabled rather than enabled.

* Move commenting setting from Details to Security settings

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 11:26:05 -04:00
Tom MoorandClaude Opus 4.8 cd4b324f5a chore: Upgrade dd-trace and Sentry (node/react) to v10 (#12759)
Bumps dd-trace to ^5.109.0 and @sentry/node + @sentry/react to ^10.58.0,
migrating off APIs removed in the Sentry v8 major: BrowserTracing /
reactRouterV5Instrumentation, Sentry.Handlers.parseRequest, and
Sentry.configureScope.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 20:50:45 -04:00
Tom Moor 3b4f2ddac0 chore: Vendorize sequelize-encrypted (#12757) 2026-06-19 17:24:42 -04:00
Tom MoorandClaude Opus 4.8 f5f81f8d3a feat: Record search query duration in milliseconds (#12755)
* feat: Record search query duration in milliseconds

Adds a `duration` column to search_queries that stores how long each
search took, including result presentation time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 16:39:50 -04:00
Tom Moor 4c36bd83de fix: Prevent concurrent OAuth refresh attempts from revoking grant (#12752)
* Prevent concurrent refresh attempts from revoking grant

* test
2026-06-19 15:58:51 -04:00
Tom MoorandClaude Opus 4.8 f7f0e9fdfe chore: Remove dead ImportTask base class (#12741)
The FileOperation-based ImportTask was superseded by the APIImportTask
pipeline (JSON/Markdown/Notion) in #12361 and #12380. Nothing extends or
imports it any longer.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 18:47:25 -04:00
Tom Moor 0ba430e111 fix: Newlines in block fences in table cells (#12740)
* fix: Newlines in block fences in table cells

closes #12736

* refactor
2026-06-18 18:21:50 -04:00
Tom Moor 66eee9007f chore: Upgrade to Typescript 6 (#12737)
* chore: Upgrade TypeScript to 6.0
2026-06-18 17:34:05 -04:00
Tom Moor 06c5188184 fix: Importer fails after stripping emoji within mark on first line (#12730) 2026-06-17 22:53:50 -04:00
Tom Moor 7ad35252fd fix(mcp): Documents shared directly with user not accessible through list tool (#12717)
* fix: Documents shared directly with user not accessible through list tool

closes #12716

* fix
2026-06-17 20:29:17 -04:00
Tom MoorandClaude Opus 4.8 8183c8e032 fix: Allow webhook urls without a top-level domain when self-hosted (#12728)
* fix: Allow webhook urls without a top-level domain when self-hosted

Webhook URL validation required a top-level domain, rejecting valid
internal hostnames such as http://webhook on self-hosted installations.
The TLD requirement is now only enforced when cloud hosted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* refactor: Extract webhook url validation into reusable IsUrl decorator

Move the conditional top-level domain validation into a reusable IsUrl
validator alongside the other model validators, and restore mocks
between create tests to keep hosting mode isolated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test: Move webhook url validation tests onto IsUrl validator

The top-level domain validation is owned by the IsUrl decorator, so test
it directly via a collocated unit test rather than through the
webhookSubscriptions API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* PR feedback

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 20:29:03 -04:00