Commit Graph
3344 Commits
Author SHA1 Message Date
Tom Moor 6d94af2c85 chore: upgrade Zod and enable compilation (#13647) 2026-09-04 09:38:58 -04:00
Tom MoorandClaude Fable 5.1 899fb8a22e feat: Add Open Knowledge Format (OKF) export (#13644)
* feat: Add Open Knowledge Format (OKF) export

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Separate OKF frontmatter from body, use team URL for resource

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Use OKF initials avatar in export dialog

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Use GlobeIcon for OKF export format

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 08:15:07 -04:00
Tom Moor 948fca8800 fix: Guard missing response in error handler (#13637) 2026-09-04 05:05:13 -04:00
Tom MoorandClaude Fable 5.1 012188635b chore: Remove unused validation helpers and getDataTransferItems (#13632)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-03 20:29:37 -04:00
Tom MoorandClaude Fable 5 e26b7d8cba Add indexes on user foreign key columns (#13631)
* fix: Add index on documents.createdById

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: Cover remaining user foreign key columns in index migration

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix: Limit index migration to at-scale tables

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 20:28:11 -04:00
Tom MoorandClaude Fable 5 b17f2611bf chore: React 18 upgrade (#13559)
* React 18 upgrade

* fix: Force synchronous React rendering in server HTML export

React 18 can defer a legacy ReactDOM.render commit when sync work is
queued, leaving exported component nodes empty. Wrap the render in
flushSync, and flush unmount-scheduled passive effects before global
env cleanup so React never runs without a window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* refactor: Move server ComponentView to createRoot

ReactDOM.render and unmountComponentAtNode are removed in React 19.
flushSync around root.render keeps the mount synchronous for the
HTML-export path, which reads the DOM immediately after.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Enable CI

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-03 01:43:47 -04:00
Tom MoorandClaude 33f2b93530 fix: Escape MCP attachment PUT upload command arguments (#13613)
Applies the same shell quoting introduced for the POST branch in #13597
to the presigned PUT branch, so user-supplied content type and filename
values cannot break out of the suggested curl command's quoting.


Claude-Session: https://claude.ai/code/session_011rde2HKVLJC4GWU4wHcrKz

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-02 19:20:53 -04:00
dependabot[bot]andTom Moor 182c60c696 chore(deps-dev): bump @faker-js/faker from 8.4.1 to 10.5.0 (#13618)
* chore(deps-dev): bump @faker-js/faker from 8.4.1 to 10.5.0

Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 8.4.1 to 10.5.0.
- [Release notes](https://github.com/faker-js/faker/releases)
- [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md)
- [Commits](https://github.com/faker-js/faker/compare/v8.4.1...v10.5.0)

---
updated-dependencies:
- dependency-name: "@faker-js/faker"
  dependency-version: 10.5.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* faker.name -> faker.person

* chore: update vulnerable transitive dependencies

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2026-09-02 23:20:23 +00:00
Tom Moor 495f2a5830 perf: Use follower for exports (#13617)
* perf: Use follower for exports

* fix: Skip empty attachment queries in JSON exports
2026-09-02 23:06:15 +00:00
Tom Moor 8b799966b7 perf: move cleanup reads to follower (#13616)
* perf: run cleanup scans on follower

* perf: move document cleanup reads to follower
2026-09-02 19:02:57 -04:00
Tom Moor 9e6b98e12b perf: limit document search trigger updates (#13615) 2026-09-02 09:10:21 -04:00
Tom MoorandClaude Fable 5.1 b2a1e10e48 Batch large table deletes in teamPermanentDeleter (#13610)
* fix: batch large deletes in teamPermanentDeleter to shorten lock time

Delete events, collections, and documents in batches of ids outside the
final transaction so row locks are held briefly instead of for the whole
team deletion, which blocked the hourly old-events cleanup for hours.

* fix: type batched destroy helper structurally

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix: guard whole team deletion with a non-blocking mutex

Move the concurrency guard from the final transaction to the whole
routine so a second worker skips before running the batched deletes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 06:12:12 -04:00
Tom Moor d9f78bbeb1 fix: Deadlock on cleanup task retry (#13598)
* fix: Deadlock on cleanup task retry

* Add transaction advisory lock around team deletion
2026-09-01 08:51:00 -04:00
Tom Moor 92af44f4b6 fix: preserve quoted tables during document patches (#13604) 2026-09-01 03:23:52 -04:00
Tom MoorandClaude Opus 5 9d29580e7f fix: Apply document download policy to revision export (#13603)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 03:14:30 -04:00
Tom Moor 22a1e1d45b fix: Match PWA chrome to active theme (#13599) 2026-09-01 02:36:30 -04:00
Tom Moor f44fad4380 fix: Preserve MCP attachment form values (#13597)
* fix: Preserve MCP attachment form values

* fix: Escape MCP attachment form arguments

* fix: Support current TypeScript library target
2026-09-01 02:12:39 -04:00
Tom MoorandClaude Opus 5 d55e7f37e5 fix: Raise OAuth redirect_uris limit and log client errors (#13583)
Dynamic client registration rejected any client sending more than 10
redirect URIs. The limit is now 20, shared between the register and
update schemas, and the error reports how many were received.

OAuth client errors were swallowed without reaching logs or Sentry,
leaving a failing integration invisible beyond its status code. 4xx
responses are now logged with the reason.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 19:49:28 -04:00
Tom MoorandClaude Opus 5 f49b047648 feat: Convert @ prefixed Markdown links to mentions on server writes (#13403)
* checkpoint

* feat: Convert @ prefixed links to mentions on server Markdown writes

A Markdown link preceded by "@" now becomes a mention when brought in
through the documents API, MCP, or an import, so an exported mention
survives a round trip instead of degrading to a plain link.

The editor rule creates a generic mention carrying the href, and the
type of resource it points at is resolved by the plugin that recognizes
the URL through a new MentionProvider hook. Mentions of external
resources also serialize to their real URL rather than a mention:// URI,
so the reference resolves outside of Outline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Escape values interpolated into rendered mention HTML

markdown-it leaves markup in a link label intact when html is disabled,
so the label and attributes are escaped before being written into the
tag.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 17:42:28 -04:00
Tom MoorandClaude Opus 5 d2697d354e fix: Respect heading number preference in HTML export (#13563)
Heading numbers are drawn by a ProseMirror decoration, and the server
strips all plugin decorations before it serializes, so exported HTML
always came out unnumbered.

Compute the same labels during export and write them to the rendered
headings as a data attribute, which the exported editor styles already
render. A revision takes the preference from the document it belongs to.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 15:27:02 -04:00
Tom Moor 4cb691c658 chore: Reduce cardinality of datadog metrics (#13565)
* chore: Reduce cardinality of datadog metrics

* address feedback
2026-08-27 15:07:50 -04:00
Tom Moor aab83e8378 fix: Reliability of count-based limit checks (#13542)
* fix: Make count-based limit checks reliable under concurrency

Limits enforced by counting rows before an insert could be exceeded by
requests that ran at the same time, as each one read the same count
before any of them had written. Add a LockHelper that takes a Postgres
advisory lock for the remainder of the transaction, and use it to
serialize the check for webhook subscriptions, team domains, share
subscriptions and pins. The counts now also run on the transaction so
they include rows written earlier in the same request.

* Remove excessive tests

* Also guard simultaneous row removal
2026-08-24 19:14:55 -04:00
Tom Moor 5956f20713 fix: Return 404 for unhandled paths under the MCP endpoint (#13541)
Unknown paths below /mcp, and the origin-level /sse probe, fell through to
the catch-all and rendered the application shell with a 200. Remote MCP
clients that probe for the legacy HTTP+SSE transport before falling back to
streamable HTTP read that as a successful handshake, then fail to connect.
2026-08-23 21:20:52 -04:00
Tom MoorandClaude Opus 5 72aa0f0063 fix: Remove associated notifications when access is lost (#13208)
* review

* Revoke notifications when a document is moved

Moving a document into a collection the recipient cannot read leaves a
notification holding the title and text, so schedule a revocation check
for each recipient of the moved document and its descendants.

Also adds coverage proving drafts are revoked through the document path,
and notes why the scoped query includes them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 21:10:44 -04:00
Tom Moor d551ead073 feat: Filter DSL for collections.list (#13442)
* feat: Filter DSL for collections.list

Adds the structured `filters` expression language to collections.list,
matching documents.list and documents.search. Supported fields are name,
createdAt, updatedAt, archivedAt, createdById and permission, each validated
against its column type at the input layer.

Deprecates the ad-hoc `query` and `statusFilter` params, which now translate
into filter leaves so that one code path serves both shapes, and returns a 400
when a caller combines them with `filters`.

Note that `query` matching is no longer accent-insensitive, as the unaccent
comparison is replaced by the shared iLike conversion.

* fix: Make filter expressions assignable to a JSON request body

Filters are sent as a JSON body, but `FilterCondition` and `FilterGroup` were
interfaces, which TypeScript does not give an implicit index signature, and
`FilterValue` admitted a `Date` that JSON cannot carry. Both stores worked
around this by asserting the request body to JSONObject, which suppressed
checking of every other field as well.

Declare the two shapes as type aliases and drop `Date` from the value union so
a filter type-checks against the request body directly, and remove the
assertions from the collection and document stores.

* feat: Restrict filter fields to a set of accepted values

Add an optional `values` set to a filter field definition, checked against
scalar and array values at the input layer so that an unsupported value returns
a 400 rather than an empty result or, for a field backed by a Postgres enum, a
database error. A field with a fixed value set is matched exactly, so pattern
operators are rejected for it in the same way as for non-text columns.

Apply it to `permission` on collections.list.

* refactor: Build the list_collections name filter with the filter DSL

The MCP tool carried its own copy of the unaccent name comparison that
collections.list used before it moved to the DSL. Build the clause with
buildWhere instead, so both paths match names the same way, and drop the
replacements plumbing it needed.
2026-08-23 16:03:10 -04:00
Tom Moor 46ada3c178 feat: Advertise markdown representation of shared documents (#13527)
Shared links return markdown when the client asks for it, but there was no
way to discover this short of guessing the .md suffix.

- Vary on Accept so shared caches key the two representations correctly
- Send a Link rel="alternate" header, discoverable with a HEAD request
- Emit a matching link tag alongside the canonical in the head
- Apply the same cache directives to markdown as the HTML response
2026-08-22 22:33:03 -04:00
Tom MoorandClaude Opus 5 def3a42752 feat: Record who deleted a document (#13484)
* feat: Record who deleted a document

The trash inferred the deleting user from lastModifiedById, so a nested page
kept whoever last edited it and deleting a document rewrote its edit history.
Add a dedicated deletedById column and set it from the base model.

- Migration adds the column, backfills from lastModifiedById, and validates the
  foreign key without holding an exclusive lock. The backfill runs in batches
  against a temporary index covering only the rows still to write, so it stays
  linear on a large table, and every statement is idempotent because the
  migration cannot run in a transaction.
- ParanoidModel records the acting user on destroy and clears it on restore,
  for any model that has the column. Sequelize soft deletes with the same UPDATE
  that stamps deletedAt, so the value costs no extra query.
- Deleting a document no longer touches lastModifiedById on its descendants.
- Present the deleting user, batched in presentDocuments, and use it for the
  trash notice and the document meta line rather than the last editor.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Do not overwrite an eager loaded deleting user when batching

The batch lookup in presentDocuments skipped documents that already carried the
association, but the assignment loop ran for all of them, so a document that
arrived with deletedBy loaded was reset to null and fell back to a per-document
query. Assign only where the association is missing, and deduplicate the ids so
a page deleted by one person asks for one row rather than one per document.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 21:49:31 -04:00
Tom Moor 631c8f82fc Stricter validation of team preferences (#13507)
* fix: Stricter validation of team preferences

* Omit unknown keys in presenters
2026-08-22 18:18:01 -04:00
Tom Moor d77dcdf853 fix: Document update rejected when preferences are null (#13525)
The client serializes all @Field properties on save, so documents created
before the preferences column existed post `preferences: null`, which the
update and create schemas rejected.
2026-08-22 15:23:51 +00:00
Tom Moor da13eb5de2 fix: Treat unreadable request stream as a client closed request (#13524)
raw-body throws a 500 'stream is not readable' when the request stream is
already destroyed at parse time, which means the client went away. Map it to
ClientClosedRequestError so it reports 499 and is not sent to the bug tracker.
2026-08-22 15:16:23 +00:00
Tom MoorandClaude Opus 5 41616f73cc feat: Filter DSL for users.list (#13456)
* feat: Filter DSL for users.list

Add the structured filter expression language already used by documents.list
and documents.search to users.list, over an allowlist of id, name, email,
role, createdAt, updatedAt, lastActiveAt and suspendedAt.

Supersedes the ad-hoc ids, emails, role and filter parameters, which are now
deprecated and translated into the DSL so a single path builds the query. The
same translation backs the list_users MCP tool, which held a duplicate copy of
the status handling.

Field specs gain an optional value allowlist, so an unknown role is rejected
at the input layer rather than reaching the enum column. Suspended users
remain invisible to non-admins and excluded by default, unless the expression
references suspendedAt.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Collapse the duplicate suspended user predicate

The non-admin invariant and the default exclusion pushed the same clause for
non-admins in the default case. Both rules are now one predicate: suspended
users are visible to admins only, and then only on request.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Drop the legacy parameters from the list_users MCP tool

The MCP surface has no backwards compatibility burden, so it takes the filter
DSL directly instead of the deprecated role and status parameters. This gives
the model date ranges, OR groups and name matching, which the old enum pair
could not express.

The field allowlist moves next to the other user filter helpers so the REST
schema and the tool share one definition rather than the tools directory
reaching into the routes.

Drops the unreachable Date member of FilterValue. Dates cross the wire as ISO
8601 strings, a Date instance fails every field kind, and zod cannot represent
it in the JSON Schema the MCP tool list is built from.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* revert: Retain legacy role/filter params in the list_users MCP tool for now

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Revert MCP changes

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 10:47:32 -04:00
Tom MoorandClaude Fable 5 662bad7108 Add heading numbering display preference for documents (#13522)
* Add heading numbering display preference for documents

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix isRemoteTransaction call for new signature on main

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix inTable detection for headings after a nested table

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Move from deco to pseudoclass

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-22 09:44:42 -04:00
Tom Moor fa1b529bef Allow reordering sidebar sections by dragging their headers (#13505)
* wip

* Center reorder cursors between sections, detect empty sections with CSS

* Deduplicate persisted sidebar section order

* fix: Stricter zod type

* Remove DraggableSection unit tests
2026-08-21 21:09:13 -04:00
Tom MoorandClaude Opus 5 7652d26d07 fix: Consistent rate limiter keys across path variants (#13504)
* fix: Normalize path when keying rate limiters

The router matches paths case-insensitively and with an optional trailing
slash, so those variants each received their own quota. Collapse them onto
a single key at both registration and consumption.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* feedback

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 00:59:21 +00:00
Tom MoorandClaude Opus 5 2beacf9d56 fix: Rate limit response headers and first-request accounting (#13506)
* fix: Rate limit response headers and first-request accounting

Retry-After and RateLimit-Reset are both defined as a whole number of
seconds. Retry-After was sent as a fraction and RateLimit-Reset as a full
date string, neither of which a client can act on.

A route limiter is registered by middleware that runs after the point where
quota is consumed, so the first request to reach a path in each process was
never charged against it. Charge it at registration time instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: Cover rate limit headers and first request accounting

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 20:54:57 -04:00
Tom MoorandClaude Fable 5 67b53220ce perf: Limit PWA precache and skip service worker on share views (#13519)
* perf: Cache JS chunks on first use instead of precaching entire build

The service worker precached every JS chunk (~590 files) in the
background for every visitor. Chunks are content-hashed and immutable,
so a CacheFirst runtime route provides the same repeat-visit behavior
while only fetching chunks that are actually used.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* perf: Do not register service worker on public share views

Anonymous share visitors gain nothing from the worker or the PWA
cache, shares always require the API. The server now exposes an
isShare flag in window.env and the client skips registration when
it is set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 20:54:30 -04:00
Tom Moor e88b6ad28c Exclude archived documents from MCP document search by default (#13518) 2026-08-21 19:36:23 -04:00
Tom Moor 1a1a3398e0 fix: Do no report expired wss auth to error tracker (#13488) 2026-08-19 08:06:58 -04:00
Tom Moor 87da583bc1 fix: Provide a ResizeObserver stub when rendering documents server-side (#13478)
jsdom does not implement ResizeObserver, so a PDF attachment preview in a
publicly shared document threw from a React passive effect during HTML
rendering. Effect errors are not caught by the node view fallback, so the
uncaught exception took down the process.

Fixes OUTLINE-CLOUD-D14
2026-08-18 19:11:42 -04:00
Tom MoorandClaude Opus 5 a118cd613f fix: Uploads fail when the file name contains an accented character (#13480)
The file name added to Content-Disposition was written into the header
unencoded whenever it fell inside Latin-1, so é, ü and ñ survived as raw
high bytes. Request signing hashes header values as UTF-8 while Node
writes them as Latin-1, giving the storage provider different bytes to
those that were signed, and the upload was rejected.

Pass an ASCII-only fallback so any such name is carried in the RFC 5987
filename* parameter instead. Browsers still read the original name from
there, so the extension is preserved.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 19:10:53 -04:00
Tom MoorandClaude Opus 5 e4905a97b8 feat: Filter the trash by who deleted an item and when (#13474)
Viewing the trash showed everything the whole workspace had deleted, which
is noisy for anyone looking for their own document. Default the view to the
items the current user deleted, and add user and date filters — matching the
shape of the search filters — to widen it again.

- Attribute a deleted subtree to the acting user. Deleting a document only
  recorded the actor against the document itself, so nested pages kept
  whoever last edited them and would have been hidden from their deleter.
- Move documents.deleted onto the filter DSL, exposing deletedById and
  deletedAt. deletedById is mapped to the column that currently records the
  deleting user, so adding a dedicated column later leaves the API unchanged.
- Lift the date filter duration map into shared, where search and the trash
  both read it rather than keeping a copy each.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 08:33:58 -04:00
Tom MoorandClaude Opus 5 6905c9ba9c fix: Stabilize signed attachment urls so browser caches can be reused (#13462)
* fix: Stabilize signed attachment urls so caches can be reused

Every call to getSignedUrl produced a unique signature, so the same
attachment was downloaded again for each URL. On a public share the
first image was fetched twice at full size: once by the preload scanner
from the server-rendered HTML, and again when the client rendered the
document from the API response.

- Round the signing timestamp down to a window so repeated signatures of
  the same key are identical. The window is capped at half the requested
  lifetime, so a URL is always valid for at least half of expiresIn and
  never outlives the lifetime it had before.
- Apply to all three signing paths: the S3 presigner, CloudFront, and
  the JWT used by local storage.
- Sign the share page HTML with the same lifetime the API presenter
  uses, so the two agree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: Freeze time in signed url tests

The suites read the wall clock, so two calls could straddle a signing
window boundary and fail intermittently. Freeze the clock at a time
offset from a boundary, then advance it explicitly to cover both cases:
within a window the signature holds, across a boundary it rotates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 17:35:23 -04:00
Tom MoorandClaude Opus 5 eaad1a71dc React SSR editor nodes (#13113)
* Render React node views in server-side HTML export

Passes nodeViews to the headless EditorView used for export so that nodes
with a React component render with it, matching the editor, and falling
back to toDOM when a component cannot render server-side.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Let nodes opt out of component rendering in static HTML

Replaces the hardcoded set of node names in the server nodeViews factory with
an allowComponentInStaticHTML getter on Extension, so a node declares the
behavior alongside its own definition rather than in a server file that does
not know about it.

Mention opts out: its component requires stores and a router, so it always
threw and fell back to toDOM, at the cost of a React render, an exception and
a log line per node. A document with 100 mentions now exports in ~12ms rather
than ~25ms and emits no warnings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Yield one less macrotask turn when flushing React effects

Only two turns are needed: the first flushes passive effects, the second fires
Frame's own setTimeout(0) whose setState commits the iframe. The third turn
absorbed nothing that the components produce.

Each turn is roughly a millisecond of idle time held inside the render lock, on
every export — including plain documents, share page SSR and notification
emails — so dropping it takes a small export from ~6ms to ~4ms.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 16:36:13 -04:00
Tom Moor a59a01cffe fix: Serialize external mentions as links in exported markdown (#13459)
* fix: Serialize external mentions as links in exported markdown

GitHub issue, pull request and project mentions carry the real URL in
`href`, but always serialized to a mention:// reference that cannot be
resolved outside of Outline. Write a plain link instead when the
commonMark serializer option is set, and set that option on the paths
where markdown leaves the platform – document and revision export, zip
exports, and the public share markdown response.

* Sanitize external mention url before navigation
2026-08-16 14:14:20 -04:00
Tom MoorandClaude Opus 5 7f54d5ea10 Re-authorize collaboration connections when access changes (#13454)
* feat: Re-authorize collaboration connections when access changes

Collaboration connections are authorized once, when the websocket is first
established, so a connection outlives changes to the access it was granted.

Add a processor that publishes access changes to the collaboration servers
over Redis. Each server closes the connections it holds within the scope of
the change and clients reconnect, at which point they are authorized as
normal. Authorization stays in one place, the published scope only has to
cover the connections that may be affected.

The API update subscriber now shares a single Redis connection rather than
opening its own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Log an access change once rather than per connection

Every closed connection is already logged by LoggerExtension, so record the
reason and the number of connections affected once instead. The count also
makes a scope that matches nothing visible.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 12:49:34 -04:00
Tom Moor 94dbdccccd fix: Nested drafts deleted when parent document is permanently deleted (#13453)
The parentDocumentId clear in documentPermanentDeleter inherited the Document
default scope, so draft, template, and trial children were never detached and
the foreign key cascade removed them along with the parent.
2026-08-15 20:21:35 -04:00
Tom MoorandClaude Opus 5 9f30b033f3 fix: Match base domain on a label boundary when parsing hosts (#13419)
* fix: Match the base domain on a label boundary

Domain parsing looked for the base domain anywhere in the host, so a host
that merely contained it was classified as a subdomain of the install
rather than as a custom domain. Compare against the end of the host
instead, and reuse the same helper for the custom domain CNAME check.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: Normalize host case and trailing root label

Hostnames are case-insensitive and may be given in fully qualified form
with a trailing dot, so normalize both before comparing against the base
domain. Without this a host such as MyTeam.Example.Com is classified as a
custom domain and a valid CNAME target is rejected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 13:25:42 -04:00
Tom Moor fc4fe65155 feat: Filter DSL (#12176)
* feat: Normalized filter DSL for documents.list and search

Add a structured filter expression language (field/operator/value leaves
composed with AND/OR groups) shared by documents.list, documents.search and
documents.searchTitles. Values are validated against each field's column type
and per-field operator allowlists at the input layer, and translated to
Sequelize where-clauses server-side.

Supersedes the ad-hoc statusFilter/dateFilter/collectionId/userId parameters,
adds ISO 8601 duration matching for date fields, documentId subtree expansion
for search, and preserves draft visibility and collection authorization.

* chore: Fix flaky Encrypted "different key" test

AES-256-CBC is unauthenticated, so decrypting with the wrong key only
raises "bad decrypt" when the garbage plaintext has invalid PKCS#7 padding
(~255/256 of the time). Roughly 1 in 245 runs it decrypts to a non-matching
value instead of throwing, failing the strict toThrow assertion. Accept
either outcome, mirroring the adjacent tampered-data test.

* Hardening
2026-08-15 13:25:10 -04:00
Tom MoorandClaude Opus 5 4b319702f8 fix: API updates published to wrong Redis when collaboration Redis is separate (#13437)
The APIUpdateExtension subscriber connects to REDIS_COLLABORATION_URL when
set, but notifyUpdate always published on the default client, which is bound
to REDIS_URL. With a separate collaboration instance the notification never
reached the collaboration processes, so connected editors did not see API
edits until reload.

Publish on RedisAdapter.collaborationClient, which falls back to the default
client when no collaboration URL is configured.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 07:33:20 -04:00
Tom MoorandClaude Fable 5 e66f0d887b fix: Restart worker when queue health check cannot complete (#13431)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 07:19:08 -04:00