* Improve log data sanitization
Extract the log sanitizer into its own module, match field names regardless of case and separators, extend the filtered fields, sanitize Sentry extras as a whole, keep serializable values such as dates, and apply the depth limit only to nested objects.
* Call toJSON once when sanitizing log data
* 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
* chore: Vendorize throng as ClusterManager
* fix: Force kill workers after grace period, skip fork if shutting down
* fix: Give workers their full shutdown timeout before the primary exits
* chore: Use a named export for ShutdownHelper
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>
* perf: lazy-load jsdom in DocumentHelper to keep it off startup path
DocumentHelper is imported by the Document and Collection models, so its
eager `import { JSDOM } from "jsdom"` pulled jsdom (~140ms) into every
server process at boot. jsdom is only needed by toEmailDiff for HTML
export, so load it lazily there — matching the existing pattern in the
sibling ProsemirrorHelper.toHTML.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* perf: defer AWS CRT signer load out of the startup path
S3Storage had a top-level `import "@aws-sdk/signature-v4-crt"` side effect
that loaded the native CRT binding (~140ms) whenever the module was
imported — which happens at boot via the Attachment model in every
process, even for local-storage deployments that never construct S3Storage.
Move the import into the S3Storage constructor so the native binding only
loads when S3 storage is actually instantiated, keeping it off the startup
path for local-storage deployments.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* perf: load dd-trace only when APM is enabled
tracer.ts imported dd-trace unconditionally, so the library (which patches
Node internals on require, ~35-80ms) loaded at startup in every process —
including the common self-hosted case where DD_API_KEY is unset and APM
does nothing. tracer.ts is the first import in server/index.ts, so this
cost is fully serial on the boot path.
Require dd-trace only when DD_API_KEY is set; otherwise fall back to a
no-op tracer covering the surface used by callers (scope/startSpan and a
no-op span), so tracing.ts and the named helpers work unchanged. The
dd-trace/ext/tags import used by tracing.ts is a standalone constants
module and does not pull in the full tracer.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Client disconnects mid-response surface as "Premature close" errors from
Node's stream end-of-stream helper. These are expected and add noise to
Sentry, similar to the EPIPE/ECONNRESET errors already filtered.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* chore: Replace lodash with es-toolkit
Migrate all direct lodash imports to es-toolkit/compat for a smaller,
faster, lodash-compatible utility library. Transitive lodash usage from
other packages remains unchanged.
* fix: Restore isPlainObject semantics in CanCan policy
The lodash migration aliased `isObject` to `lodash/isPlainObject` and
the codemod incorrectly mapped the local name to es-toolkit's `isObject`,
which also returns true for arrays and functions. This caused condition
objects in policy definitions to be skipped, breaking authorization
checks across the codebase.
* fix: Restore unicode-aware length counting in validators
es-toolkit/compat's size() returns string.length, while lodash's _.size()
counts unicode code points. Switch to [...value].length to preserve the
previous behavior so multi-byte characters like emoji count as one.
* chore: promote no-explicit-any from warn to error and resolve violations
Upgrades the oxlint rule severity and removes all 40 existing
`no-explicit-any` warnings across the codebase. Most call sites gained
proper types (SharedEditor refs, JSONNode/JSONMark for ProseMirror JSON
walking, DocumentsStore, dd-trace `Span` parameter inference, prosemirror
Fragment public API in place of internal `(fragment as any).content`).
A few load-bearing `any` uses were preserved with scoped disable
comments where changing the type would cascade widely (Sequelize JSONB
columns on `Event`, the `withTracing` higher-order function generic,
`Extension.options` consumed by many subclasses, dd-trace's `req`
patching).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* chore: resolve no-redundant-type-constituents and test/mock no-explicit-any warnings
Clears 36 lint warnings: all 5 no-redundant-type-constituents, 6
no-misused-spread (via narrowing getPartitionWhereClause's return type
to WhereAttributeHash), and 25 no-explicit-any in test/mock files.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* chore: resolve no-base-to-string warnings in tests
Convert userProvisioner try/catch error assertions to Jest's
.rejects.toThrow() idiom, and cast webhook test body to string.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* chore: resolve no-explicit-any warnings in cancan and tracing
Tighten types in the cancan policy framework and tracing decorators.
Constructor / generic-function upper bounds keep `any` where TypeScript
variance requires it, scoped to single-line oxlint-disable comments.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* chore: enable typescript/restrict-template-expressions lint rule
Coerce values of unknown type with explicit String() and tighten typing
for template literal expressions across the codebase.
* fix: restore --line-height on Card for fadeOut ::after gradient
* Upgrade Prettier to v3.6.2 and eslint-plugin-prettier to v5.5.1
- Upgraded prettier from ^2.8.8 to ^3.6.2 (latest version)
- Upgraded eslint-plugin-prettier from ^4.2.1 to ^5.5.1 for compatibility
- Applied automatic formatting changes from new Prettier version
- All existing ESLint and Prettier configurations remain compatible
* Applied automatic fixes
* Trigger CI
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
* Fix various linting errors
This commit addresses several linting warnings reported by ESLint:
- @typescript-eslint/no-shadow:
- I renamed variables in inner scopes to avoid conflicts with variables in outer scopes in the following files:
- server/commands/accountProvisioner.ts
- server/commands/documentDuplicator.ts
- server/commands/documentMover.ts
- server/commands/teamProvisioner.test.ts
- server/commands/teamProvisioner.ts
- server/commands/userInviter.ts
- server/commands/userProvisioner.ts
- server/emails/templates/BaseEmail.tsx
- @typescript-eslint/no-explicit-any:
- I replaced `any` with more specific types (Record<string, unknown> or void) in the following files:
- server/emails/templates/BaseEmail.tsx
- server/emails/templates/InviteEmail.tsx
- server/emails/templates/SigninEmail.tsx
- server/logging/Logger.ts
These changes improve code clarity and type safety without altering functionality.
* Update BaseEmail.tsx
* lint
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>