382 Commits
Author SHA1 Message Date
Tom Moor 41abdbec3f Add upsell settings pages for paid plan features (#14631)
* Add enterprise upsell plugin with placeholder settings pages

Introduces a new client-only `upsell` plugin that surfaces Enterprise-only
features as placeholder settings pages in the community edition, encouraging
self-hosted users to upgrade. The plugin is gated to non-cloud deployments
since the cloud edition already ships these features.

Adds:
- UpsellScene: a reusable upsell page (header, pitch, upgrade CTAs, and a
  preview of the locked settings).
- UpsellSettingRow: an upsell variant of SettingRow that renders an
  Enterprise-only setting in a locked, non-interactive state.
- EnterpriseBadge: a small badge denoting Enterprise-only features.
- Placeholder pages for Audit Log, Data Attributes, and Glean.
- A pricing URL on UrlHelper for the upgrade call to action.

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

* Add Security upsell rows and Collections upsell page

Surfaces more Enterprise-only features in the community edition:

- Adds locked upsell rows to the Security settings page for two-factor
  authentication, automatic sign-out, and an IP allowlist. These only render
  on self-hosted instances, where the real settings are not available.
- Adds a Collections placeholder page to the upsell plugin advertising
  workspace-wide collection administration.

Relocates the shared EnterpriseBadge and UpsellSettingRow components from the
plugin into app/scenes/Settings/components so core settings pages and the
plugin can both consume them without inverting the app/plugin dependency.

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

* Show plan requirement on upsell pages and sidebar

Replace the placeholder Enterprise rows with a single callout that names the
minimum plan for each feature, mark upsell items in the settings sidebar with
a muted lock, and sync PlanHelper with the plan entitlements.

* Hide entitled upsells, show Glean upsell, fix billing link

* Render upsell for settings pages without the entitlement

Settings items can declare the plan feature they need. Without it, the page
shows the upsell scene in place of the real one, and upsell plugin
placeholders give way to a real page for the same feature.
2026-11-20 08:29:16 -05:00
Tom Moor 4fca2ebc32 chore: Replace fixed sleeps and raised timeouts with signals (#14624) 2026-11-17 19:22:04 -05:00
Tom Moor 5e6cc0f191 fix: Send single batched requests directly to their endpoint (#14604)
* fix: Send single batched requests directly to their endpoint

* fix: Reject a lone batched request when dispatch throws
2026-11-16 09:09:59 -05:00
Tom Moor 4a96de653b perf: Smaller locale files and fewer locale fetches (#14592)
* perf: Smaller locale files, start i18n with stored user language, preload locale

* fix: Set spellchecker when locale is unchanged, match lng from allowlist

* refactor: Type-safe locale cache keyed by supported language

* Remove locale preload

* fix: Ignore unsupported languages in changeLanguage
2026-11-14 19:57:53 -05:00
Tom Moor a40198a97d feat: Add expiry dates for public share links (#14513)
* wip

* fix: Treat null expiresAt as no expiry when creating a share

* fix: Add bottom padding to share notices
2026-11-09 22:29:49 -05:00
Tom Moor 3cdf0c0979 fix: Keep extensions in toDropzoneAccept when there are no mime types (#14502) 2026-11-06 18:28:00 -05:00
Tom Moor f0401f83e7 chore: Remove unnecessary URL parsing (#14454) 2026-11-02 21:14:53 -05:00
Tom Moor 133fba4dd0 feat: Show workspace chooser on root domain for multiple sessions (#14013)
* feat: Show workspace chooser on root domain when signed in to several workspaces

* chore: Update translation strings
2026-11-02 20:34:02 -05:00
Tom Moor 6d7cd455e9 chore: Decouple core plugins (#14340)
* chore: Move plugin-specific integration code into plugins

Core no longer imports from or names the settings of individual plugins.
Plugins now register mention providers, issue status icons, instance URLs,
settings keys, settings and import schemas, and OAuth clients through hooks.

* fix: Recompute embed instance URLs after plugins load and match legacy issue icons by URL

* fix: Skip logo upload jobs queued without a settings path

* chore: Choose issue status icons from the unfurl state
2026-11-02 19:42:48 -05:00
Tom Moor d15d61d79d fix: Stop reporting expected client errors to Sentry (#14448) 2026-11-02 17:48:35 -05:00
Tom Moor bd7fc38ddb feat: Generate Pinyin slugs for Chinese document titles (#14375)
Slugs are now generated only on the server, which lazily loads pinyin-pro.
The client reads the path from the API rather than computing it.
2026-10-31 11:12:24 -04:00
Tom Moor 98d1e83c48 fix: Only detect the Outline desktop app, not any Electron browser (#14387) 2026-10-29 08:40:09 -04:00
Tom Moor 9aad5a4bb7 feat: Add Gitea / Forgejo integration (#14336)
* feat: Add Gitea integration for issue, pull request, and repository previews

* fix: Gitea repository previews and request deadlines

Refresh the token before repository discovery, keep repository previews when
the issue tracker is disabled, and keep the request timeout active while the
response body is read.

* chore: Use the shared fetch timeout for Gitea requests

* chore: Mention Forgejo in Gitea copy and reuse the callback URL helper

* Remove service specific getters in IntegrationsStore
2026-10-25 18:04:04 -04:00
Tom MoorandClaude Opus 5.5 28af9890f9 feat: Allow document links to suppress view recording (#14334)
* feat: Allow document links to suppress view recording

Adds a suppressView query parameter that prevents a view from being
recorded when a document is opened, removing it from the URL afterwards
so that copied links record views as normal.

* refactor: Use useConsumeQueryParam to read suppressView

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-25 11:36:19 -04:00
Tom Moor 0d13c183fd chore: Add lint rules for test conventions (#14318) 2026-10-24 14:09:36 -04:00
Tom Moor 18b229e741 fix: Do not report DOM errors caused by browser page translation (#14271) 2026-10-24 02:44:18 +00:00
Tom Moor df48cce1d3 chore: Remove es6-error dependency (#14217) 2026-10-21 22:26:18 -04:00
Tom Moor 418752c096 chore: Remove @juggle/resize-observer polyfill (#14204) 2026-10-21 18:19:04 -04:00
Tom Moor e0db189e53 feat: Run passkey login inside the desktop app (#14180)
* Run passkey login inside the desktop app when supported

Desktop apps that configure a platform authenticator expose
isPasskeySupported on the bridge. When available, the WebAuthn ceremony
runs in the app instead of the system browser. If it fails, the user can
still use a passkey from their browser.

* Name passkeys registered in the desktop app

The Chromium Touch ID authenticator reports the same AAGUID as any
Chromium browser, so passkeys from the desktop app were named
"Chromium Browser".

* Allow more than one passkey from the Chromium authenticator

The Chromium Touch ID authenticator reports the same AAGUID on every
device, so users could not register the desktop app on a second Mac.

* Disable adding passkeys in desktop apps without passkey support
2026-10-20 22:57:37 -04:00
Tom MoorandClaude Opus 5.5 5647621224 chore: Prune redundant comments and type suppressions (#14124)
* chore: Prune redundant comments and normalize lint directives

Removes comments that restate the following line and stale TODOs, drops
the passive event listener feature check now that all supported browsers
support it, and renames eslint directives to oxlint.

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

* fix: Evaluate restricted team domains at validation time

The restricted email provider list was captured when the model loaded, so
it could not follow the hosting environment and the tests that covered it
never reached the model.

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

* chore: Replace type suppressions with accurate types

Adds a Concrete helper type for registries of abstract classes, declares
missing Sequelize and refractor typings, uses public ProseMirror APIs, a
typed mock context helper in middleware tests, and a StaticLink component
for sidebar rows being edited.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 17:07:39 -04:00
Tom Moor 77e0fb1e51 fix: Group all BadGatewayError reports into one Sentry issue (#14115) 2026-10-17 09:50:52 -04:00
Tom MoorandClaude Opus 5.5 9e2565184e chore: Prune stale comments, TODOs, and type suppressions (#14092)
* chore: Remove unused lint disable directives

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

* chore: Replace TODO type suppressions with typed code

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

* chore: Remove obsolete workaround comments in tests and MediaDimension

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

* chore: Remove Tippy compatibility props from Tooltip

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

* chore: Decouple DropdownMenu props from Tooltip and clarify sharing styles

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

* chore: Remove stale retention TODOs from cleanup tasks

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

* chore: Register relations synchronously and clarify workaround comments

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

* chore: Replace Notion import TODOs with descriptive comments

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-15 08:54:37 -04:00
Tom Moor 5516c2e252 chore: Upgrade react-dropzone from 11 to 20 (#14039) 2026-10-12 11:37:31 -04:00
Tom Moor b4601a61ff feat: Support OAuth Client ID Metadata Documents for MCP clients (#14015)
* feat: Support OAuth Client ID Metadata Documents for MCP clients

MCP clients can send an https URL as their client_id. The server fetches
the metadata document at that URL and caches one team-less client row per
URL, so MCP works on the root domain without dynamic registration.

Closes #14010

* fix: Address review findings for client ID metadata documents

- Only count unexpired tokens when cleaning up metadata document clients
- Reject backslashes, whitespace and trailing host dots in client_id URLs
- Strip trailing dots before installation host comparisons
- Type clientSecret as nullable

* fix: Keep OAuth clients with pending authorization codes during cleanup

* refactor: Simplify client ID metadata document handling

- Gate metadata document fetches on the MCP preference inside the helper
- Add isMCPClient getter and a shared client ID prefix constant
- Enforce the team/metadata document CHECK in both directions
- Index oauthClientId on OAuth token and code tables
- Reuse parseDomain, clamp and time helpers

* revert: Remove pending authorization code check from OAuth client cleanup

* fix: Block all special-use addresses when fetching client metadata documents

ALLOWED_PRIVATE_IP_ADDRESSES no longer applies to client ID metadata
document requests (draft -02 section 8.6). The fetch wrapper takes an
allowIPAddressList option to override the environment list.

* fix: Reject empty userinfo in client metadata document URLs

https://@host and https://:@host have a userinfo component that the URL
parser drops, so check the raw authority (draft -02 section 3).

* fix: Accept a root path in client metadata document URLs

Draft -02 section 3 marks a root path as NOT RECOMMENDED, not invalid, so
https://example.com/ is a valid client_id. A URL with no path is still
rejected.

* fix: Reject client metadata documents with private key material

A jwks key with private or symmetric members (d, p, q, dp, dq, qi, oth,
k) makes the document invalid, so it is not cached (draft -02 section 4.1).
Public keys are still ignored.

* fix: Respect no-cache, no-store and Age for client metadata documents

no-store and no-cache now expire the cached document at once, so it is
fetched again before the next authorization. Freshness from max-age or
Expires (measured from Date) is reduced by Age before clamping (draft -02
section 5.2).

* feat: Copy DCR and CIMD client logos to file storage in the background

logo_uri was rendered directly on the consent screen, which lets the logo
host track users and change the image at any time (draft -02 sections 8.8
and 9.2). A background task now fetches the logo with the strict fetch
rules, accepts only PNG, JPEG, GIF and WebP by their leading bytes, and
stores it content addressed in the public bucket. Requests never wait for
the upload.

* fix: Match loopback redirect URIs on any port

Native apps such as Claude Code register http://localhost/callback and
then listen on a free port, so an exact match rejected them. Loopback
redirect URIs now match on any port (RFC 8252 section 7.3); the scheme,
host and path must still match, and other URIs still match exactly.

* fix: Only break the redirect URL mid-word on the consent screen

break-all on the whole notice split words such as "continue" in the
loopback warning. It now applies only to the redirect URL.

* chore: Shorten the loopback warning on the consent screen

* fix: Show the punycode host of client metadata documents on the consent screen

A lookalike Unicode host was shown as written. Hostnames now come from a
shared getHostname helper that returns the punycode form.

* refactor: Move image type detection to ImageHelper and use it for avatars

Avatars and integration logos copied from a URL are now stored only if
they are PNG, JPEG, GIF or WebP, with the content type detected from the
file data rather than the remote host.

* fix: Address review findings for OAuth client logos and metadata caching

- Count the time since the Date header as age when caching metadata
  documents, so a document is not cached past its Expires time
- Log logo scheduling failures instead of failing registration requests
- Run dynamic client registration in a transaction
- Delete copied logos from storage when no client uses them

* fix: Store one logo per OAuth client and return a distinct metadata document error

- Logos are stored per client, so a file is only deleted when its own
  client stops using it. This removes the reference count and its race.
- A metadata document that cannot be fetched or is invalid now returns
  invalid_client_metadata with the reason, not a 404. Network errors
  are only logged.
- Move scheduleOptional to BaseTask so that any task can use it.
2026-10-12 11:01:55 -04:00
Tom Moor a004b24e83 chore: Upgrade slug from 5 to 11 (#14038)
* chore: Upgrade slug from 5 to 11

* Require Node 22.12+ for require(esm), test θ transliteration

* Polyfill String isWellFormed and toWellFormed for older browsers
2026-10-11 16:13:48 -04:00
Tom Moor 8fb8f4d3d4 feat: Alt+Up/Down moves to the previous/next document in the sidebar (#14034)
* feat: Alt+Up/Down moves to the previous/next document in the sidebar

* feat: Sidebar keyboard navigation works across collections and root rows
2026-10-11 15:33:19 -04:00
Tom Moor 8f39bc2c87 fix: Resolve browser languages without a region to a supported locale (#14020) 2026-10-11 09:17:09 -04:00
Tom Moor e571208871 fix: Spelling, grammar, punctuation, and translation string errors (#14017)
* fix: Spelling, grammar, punctuation, and translation string errors

* fix: Remove duplicate period and comma splice from review feedback
2026-10-11 09:07:07 -04:00
Tom Moor a6b50dcc11 fix: Reduce false unsynced changes warnings when leaving a document (#14006)
* fix: Only warn about unsynced changes when navigating to a different document

* fix: Do not prompt about uploading images when staying on the same document

* fix: Do not report edits before the first sync as unsynced when stored locally

* fix: Treat opening a revision as leaving the document
2026-10-09 21:11:36 -04:00
Tom Moor 0e19c7d89a fix: Ignore Safari extension runtime.sendMessage errors in Sentry (#14005) 2026-10-09 21:49:53 +00:00
Tom Moor bd1d4e518a fix: Ignore CSP eval errors from injected scripts in Sentry (#14001)
Fixes OUTLINE-CLOUD-ADG
2026-10-09 21:29:05 +00:00
Tom Moor e10090b8fd fix: Ignore Telegram in-app browser bridge errors in Sentry (#13976)
Fixes OUTLINE-CLOUD-CRW
2026-10-06 09:23:17 -04:00
Tom Moor 49817d0676 fix: Document and collection mentions on public shares navigate outside the share (#13920)
On a public share, MentionDocument and MentionCollection rendered a Link to
the bare /doc/... or /collection/... path. That route is not part of the
share, so the router fell through to the authenticated app and showed the
login screen. Regular text links to the same documents were unaffected
because they go through the editor's onClickLink handler, which already
prefixes the share route.

Scope mention paths with sharedModelPath when a shareId is in context.
Moves the helper into shared/utils so the editor can use it; the app
wrapper keeps the same signature and reads ROOT_SHARE_ID from env.
2026-10-05 22:23:11 -04:00
Tom Moor b72fd33e9c fix(editor): Use lazyWithRetry for shared editor lazy components (#13868)
Moves lazyWithRetry to shared/utils so the editor's ColorSwatch and
Mentions components can use it instead of React.lazy, avoiding the
Suspense reveal throttle once the chunk is loaded.
2026-09-23 20:50:37 -04:00
Tom Moor 660fb59cee fix: Clear stale unsynced warnings after tab broadcasts (#13860) 2026-09-23 18:57:38 -04:00
Tom Moor ad04aed6ef fix: Editor content delayed by React 19 Suspense reveal throttle (#13817)
Lazy components now render synchronously once their chunk is loaded and share a
preload promise, so the editor no longer commits a fallback and waits out the
300ms retry throttle. Editor chunks are preloaded from the document route, the
sidebar hover, and the data loader. A lint rule blocks direct imports of the
editor chunk.
2026-09-20 16:54:56 -04:00
Tom Moor 9839ad8182 fix: Send analytics events through gtag and track WebMCP tool registration (#13792)
* fix: Send analytics events through gtag and track WebMCP tool registration

* Track WebMCP registration without a tool count
2026-09-18 08:58:01 -04:00
Tom Moor fe409306f4 fix: Warn before leaving a document with unsynced edits (#13738)
* fix: Warn before leaving a document with unsynced edits

* refactor: Move unsynced change tracking into CollaborationProvider

* refactor: Move collaboration event types next to CollaborationProvider

* fix: Pending changes stuck after the collaboration connection is restored

* chore: Log collaboration sync state changes in development

* fix: Report lost local persistence in the leave prompt

* fix: Stop local persistence when the initial read fails

* fix: Stop local persistence when a write aborts

* Remove test
2026-09-17 20:54:06 -04:00
Tom MoorandClaude Opus 5 cc15b088ec feat: Show a toast with actions when a file download completes in the desktop app (#13769)
* Show toast with actions when a file download completes

In the desktop app a toast is now displayed when a file finishes
downloading, with the option to open the file or reveal it in the file
manager of the operating system.

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

* Guard download bridge calls for older desktop apps

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

* Change protocol in dev for easier testing

* Use standard buttons stacked below the file name in download toast

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-17 19:36:47 -04:00
Tom Moor f9eac2733f fix: Suppress WebMCP registration warning on abort teardown (#13642)
* fix: Suppress WebMCP registration warning on abort teardown

* refactor: Coerce rejection with toError
2026-09-04 09:50:32 +00:00
Tom Moor a531c2b02e feat: WebMCP support (#13576)
* feat: WebMCP support — expose command bar actions as browser model context tools

* fix: Handle async rejection from WebMCP registerTool

* Surface errors

* Suppress action factories in webMCP
2026-09-03 01:36:05 -04:00
Tom Moor 57c110dbe5 chore: Upgrade MobX (#13554)
* Upgrade Mobx

* fix: Enforce MobX action boundaries

* fix: Wrap static observable updates in actions

* Remove iteration tests
2026-09-02 20:31:37 -04:00
Tom Moor 2dfc26f14b fix: Provision OIDC users with locale claim (#13601) 2026-09-01 02:36:21 -04:00
Tom MoorandClaude Opus 5 d8d8f2fffe Support HEIC and HEIF avatar uploads with in-browser conversion (#13577)
* feat: Support HEIC avatar uploads with in-browser conversion

HEIC and HEIF images picked for an avatar are now converted to JPEG in
the browser before the cropper opens. The browser's own decoder is used
when it supports the format, otherwise a WebAssembly decoder is loaded
on demand.

Also collects the image utilities into an ImageHelper class, fixes the
crop dialog's submit button never disabling, and stops the upload from
forwarding request headers the browser controls itself.

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

* refactor: Use only the browser's own HEIC decoder

Drops the bundled WebAssembly decoder in favour of the browser's native
support. This removes an LGPL dependency and a 3MB lazy chunk, and lets
the Content Security Policy stay as it was.

Browsers without HEIC support now get a message asking for a JPEG or PNG.

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

* docs: Add class-level JSDoc to ImageHelper

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 00:13:56 -04:00
Tom MoorandClaude Fable 5 a7aac841cf chore: Vendorize y-indexeddb persistence (#12918)
* chore: Vendorize y-indexeddb persistence

Replaces the y-indexeddb dependency with a small typed module in
app/utils/IndexeddbPersistence.ts so we have full control over the
underlying database rows. The IndexedDB schema is unchanged and remains
compatible with databases created by y-indexeddb, so existing local
caches continue to work.

Differences from upstream:
- Promise-based API (whenSynced) instead of the lib0 Observable events,
  which simplifies MultiplayerEditor and lets it handle environments
  where IndexedDB exists but cannot be opened (e.g. Firefox private
  browsing) by falling back to no local persistence.
- Skips writing an empty state row every time a document is opened.
- Exposes a public compact() to merge all rows into one on demand.

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

* chore: Remove persistence tests and fake-indexeddb dependency

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

* chore: Make trim size a private class member, drop unused custom store

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

* fix: Guard async persistence callbacks against post-cleanup state updates

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

* Added onversionchange handler

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-27 17:35:21 -04:00
Tom Moor 1ca8335717 fix: Recover from closed IndexedDB connections in store persistence (#13523)
* fix: Recover from closed IndexedDB connections in store persistence

StorePersistence cached a single IDBDatabase forever, so once the browser
or another tab closed the connection every subsequent hydrate, flush and
clear threw against a dead handle.

- Close and forget the connection on versionchange, so another tab is
  never blocked from deleting or upgrading the database
- Discard the cached connection on close, open error and blocked, and
  retry once against a fresh connection when one was closed underneath us
- Close open connections before deleteAllDatabases removes them, which
  also stops logout recreating the databases it just deleted

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

* fix: Cancel pending writes when store persistence is disabled

A debounced flush scheduled before disabling would still fire, reopening
and recreating the database that deleteAllDatabases had just removed.
2026-08-22 19:01:39 -04:00
Tom Moor 26f6ed96f0 fix: Recover from mismatched chunks after a deploy (#13489)
A dynamic import can resolve to a chunk from a different build, throwing
"does not provide an export named", which was not recognized as a chunk
error. Share one stale chunk matcher between the lazy import retry, the
error boundary, and Sentry so all three treat it as recoverable.

Fixes OUTLINE-CLOUD-D1M
2026-08-19 08:06:26 -04:00
Tom MoorandClaude f668a24663 feat: Persist policies to IndexedDB so abilities survive reload (#13138)
* feat: Persist policies to IndexedDB so abilities survive reload

Adds a StorePersistence layer that caches a store's models in IndexedDB
and hydrates them back at boot as stale data, revalidated by normal API
traffic. Enabled for the policies store, scoped per team, so cached
abilities are available immediately after a reload instead of every
policy needing a forced refetch.

- Persistence hooks in the base Store add/remove/clear methods, since
  add() updates existing models in place and map observation would miss
  those changes
- Enabled from RootStore construction (team read from localStorage) and
  again after auth.info succeeds to cover the first session after login
- Store.clear() wipes the persisted records, covering both logout paths
- deleteAllDatabases() fallback removes the policies database on
  browsers without indexedDB.databases()

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

* refactor: Opt stores into persistence via a persistable property

Stores now declare persistence with `persistable = true` and RootStore
sweeps all persistable stores, deriving each database name from the
store's apiEndpoint, instead of RootStore hard-coding the policies
store. The deleteAllDatabases fallback uses the same sweep.

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

* refactor: Simplify store persistence enablement and clearing

- Move the persistable guard into Store.enablePersistence so RootStore
  can call it unconditionally on every store
- StorePersistence derives its own database name from the store and
  teamId rather than receiving a prebuilt name
- StorePersistence.clear returns a promise, making the test deterministic
  instead of sleeping

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

* fix: Avoid re-persisting hydrated records, await clear transaction

Hydration called store.add() for every cached record, which now triggers
persist() and scheduled a flush that wrote the just-loaded data straight
back to IndexedDB at boot. Guard persist() with a hydrating flag.

clear() awaited the objectStore.clear() request rather than the enclosing
transaction, so it could resolve before commit and miss abort errors.

* lock

* iterate

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-16 14:13:06 -04:00
Tom MoorandClaude Opus 5 fcae7b3c57 fix: Pages fail to load on older browsers (#13450)
* fix: Shared pages fail to load on older browsers

Object.hasOwn is unavailable before Chrome 93 and Safari 15.4, and
es-toolkit calls it directly from isEqualWith, which useActionContext
runs on every render. Add a polyfill applied at module scope, ahead of
the other imports, so it covers dependency evaluation and first render.

Fixes OUTLINE-CLOUD-D0W

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

* Define the polyfill as non-enumerable to match the native property

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 20:14:23 -04:00
Tom Moor c316c2bbb7 perf: Reduce Sentry span volume from browser tracing (#13389)
Resource timing spans made up ~84% of all spans sent, driven by the number
of code-split chunks loaded per pageload. Filter them out along with pageload
connection phases and performance mark/measure entries, and halve the traces
sample rate.
2026-08-12 08:18:27 -04:00