Commit Graph
3651 Commits
Author SHA1 Message Date
Tom Moor 4cf4e7b8ae chore: Drop redundant teamId UUID check 2026-11-25 09:23:13 -05:00
Tom Moor 3816ca2f52 perf: Scope the collection owner filter subquery to the team 2026-11-25 09:19:07 -05:00
Tom Moor bbc3e5724c Merge remote-tracking branch 'origin/main' into claude/document-owners
# Conflicts:
#	server/commands/subscriptionCreator.ts
#	server/routes/api/collections/collections.ts
#	server/routes/api/documents/documents.ts
2026-11-24 15:16:22 -05:00
Tom MoorandClaude Opus 5.5 00b124d03c chore: Rename APIContext to Context and flatten its fields (#14684)
* chore: Rename APIContext to Context and flatten its fields

Auth and transaction now live directly on the context instead of in
ctx.state and a nested ctx.context, and model helpers read them directly.
APIContext remains as a deprecated alias.

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

* chore: Remove deprecated APIContext alias

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

* fix: Read auth from context in OAuth provider callbacks

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

* chore: Add withUser and withTransaction context helpers

Replaces manual createContext rebuilds that copy fields from an existing context.

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

* chore: Remove arbitrary property access from Koa context types

AppContext and Context no longer inherit the any index signature from
Koa's DefaultContext, custom fields are declared explicitly, and importing
Koa's loose Context type is disallowed by lint.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-23 23:17:06 -05:00
Tom Moor 147014c6d6 fix: Claim transfer tokens atomically on redemption (#14693) 2026-11-23 19:41:24 -05:00
Tom Moor 6576bc832a perf: Add subscriptions documentId index for document delete cascade (#14688) 2026-11-23 09:20:27 -05:00
813b0bd5d6 Validate MCP document update edit modes (#14678)
Co-authored-by: Tom Moor <380914+tommoor@users.noreply.github.com>
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
2026-11-20 14:31:40 -05:00
Tom Moor 95f31d361f fix: Owner selection and membership edge cases
- Remove document owners from the legacy plan
- Selecting yourself in the share picker only suggests other users that can
  be owners, and you are not suggested next to groups or guests
- Users that make themselves an owner through the API get the manage
  permission, so they are listed in the share panel
2026-11-20 11:55:16 -05:00
Tom Moor 37c79b3193 Merge remote-tracking branch 'origin/main' into claude/document-owners
# Conflicts:
#	app/scenes/Settings/Notifications.tsx
#	shared/i18n/locales/en_US/translation.json
#	shared/types/plans.ts
#	shared/utils/PlanHelper.ts
2026-11-20 11:19:15 -05:00
Tom Moor 1465b7ea80 feat: Show export completion in the notifications center (#14673)
* feat: Show export completion in the notifications center

Exports now create an in-app notification with the export name, status,
format and a download button. Export emails are sent from the notification
with a one-minute delay, so they are skipped once the notification is read.

* fix: Avoid nested button in export notification and keep it after delete

* fix: Revoke export notifications when access to the source is lost

* fix: Remove icon from export notification download cue
2026-11-20 11:17:15 -05:00
Tom Moor 620ef924a1 Improve log data sanitization (#14671)
* 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
2026-11-19 17:59:44 -05:00
Tom Moor e0fb40baaa fix: Halve indexed document text until the search vector fits (#14646) 2026-11-19 17:57:25 -05:00
Tom Moor db71a3edad fix: Tighten permissions on documents.users (#14670) 2026-11-19 17:56:37 -05:00
Tom Moor 0171534400 feat: Allow admins to reconnect an authentication provider (#14649)
Reconnecting updates the existing provider row in place so that member
authentications stay linked when the external domain or tenant changes.
2026-11-18 22:36:53 -05:00
Tom Moor 6d82287a08 fix: Do not download relative attachment paths in API imports (#14650) 2026-11-18 22:36:26 -05:00
Tom Moor a95a970fcb fix: Replace deprecated url.parse() and add lint rule to ban it (#14644) 2026-11-18 21:38:46 -05:00
Tom Moor 072c7c537f fix: Poll for the migrations lock so concurrent index builds cannot hang (#14641) 2026-11-18 19:58:23 -05:00
Tom Moor 5f9144b50b fix: Allow URLs in the name of MCP OAuth clients (#14643) 2026-11-18 19:58:08 -05:00
Tom Moor c7955616fe fix: Respect unsubscribe for invite accepted emails, use workspace language (#14640) 2026-11-18 19:06:39 -05:00
Tom MoorandClaude Opus 5.5 f9d995e6f1 perf: Add cached Integration.findEnabledByTeamIdAndService lookup (#14635)
* perf: Add cached Integration.findEnabledByTeamIdAndService lookup

Caches a lightweight projection of a team's integrations for a service in
Redis so event processors can cheaply check whether a team uses a service,
e.g. from shouldQueue, before creating a job. The cache is invalidated after
commit by model lifecycle hooks.

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

* chore: Remove comment from Integration cache invalidation

* perf: Skip queueing Slack jobs for teams without a matching post integration

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 08:20:15 -05:00
Tom Moor 090cea4121 fix: Revalidate cached locale catalogs after upgrades (#14632) 2026-11-18 07:58:36 -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 8893cb26e6 perf: Batch linked document lookups in BacklinksProcessor (#14613)
* perf: Batch linked document lookups in BacklinksProcessor

* test: Cover batched backlink lookups

* test: Remove query count test
2026-11-16 18:55:07 -05:00
Tom Moor bb7372ab05 perf: Avoid loading collection structure when fetching document shares (#14611)
* perf: Avoid loading collection structure when fetching document shares

* fix: Do not return inherited shares for archived documents
2026-11-16 18:45:31 -05:00
17ed709a80 Prevent guests from joining groups and creating custom emoji (#14606)
* Prevent guests from joining groups and creating custom emoji

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

* Enhance user retrieval with transaction lock

Add lock option to User.findByPk for transaction safety

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-11-16 23:42:06 +00:00
Tom Moor 4e8dfa39f2 fix: Name batch requests correctly in APM and trace each sub-request (#14603)
* fix: Name batch requests correctly in APM and trace each sub-request

* fix: Tag status on failed batch request spans
2026-11-16 18:39:07 -05:00
Tom Moor c0288df8eb fix: Reduce error noise while the database is read-only or unavailable (#14599)
* fix: Reduce error noise while the database is read-only or unavailable

* fix: Let websocket clients reconnect after a slow authentication
2026-11-15 12:40:59 -05:00
Tom Moor f834259b51 refactor: Move owner logic into Document and Collection model methods
- addOwner, removeOwner, grantOwnerAccess and setOwnerIds on both models,
  locking the row so concurrent owner changes are kept
- Owner events are created by an update hook from the change in ownerIds
- The manageOwners check runs at the route level when ownerIds is sent
- Removes the documentOwners and collectionOwners command modules
- Removes duplicate owner tests
2026-11-14 22:07:58 -05:00
Tom Moor 24991192e8 fix: Limit owners to 5, use no key update locks when adding owners 2026-11-14 20:43:49 -05:00
Tom Moor 451241f880 Merge remote-tracking branch 'origin/main' into claude/document-owners
# Conflicts:
#	app/scenes/Search/Search.tsx
#	shared/i18n/locales/en_US/translation.json
2026-11-14 19:59:33 -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 c3274d17d1 Redesign search filters with a scalable chip bar (#14589)
* Redesign search filters

* Design refinement

* Search filter polish: chip states, Text components, Published filter

* Encode search filters as <field>.<operator> URL params

Filters read and write a standard <field>.<operator>=<value> format, a
bare key reads as eq, and the previous dateFilter, statusFilter and
titleFilter params are still read.

* Add custom date ranges to search date filters

Updated, Created and Published get a Custom option that opens a range
calendar in a modal. The range is stored as <field>.gte and <field>.lte
dates and sent to the API as whole days in local time.

* Keep date filter chip shown while its range dialog is open

* Align calendar with modal edges

The calendar had its own 12px padding, so in modals it sat inside the
title and footer edges. The popovers that need the space now pad it.

* Search filter refinements: menu height, chip spacing, steady results line

* Simplify search filters and address review comments

Parse each filter once per URL change, unify URL writes, share status and
date helpers with the server, add a maxHeight prop to MenuContent, ignore
counts from obsolete searches, and show the empty state for filter-only
searches.

* Refine filter chip remove button and skip animation on auto-opened menus
2026-11-14 12:00:47 -05:00
Tom Moor 6a6987ec2d perf: Faster mention suggestions (#14583)
* perf: Faster mention suggestions

Limit each section of suggestions.mention to 1s so a slow query does not
delay the others, debounce mention and link editor requests, ignore stale
responses, and use title search in the link editor.

* fix: Include presentation in the mention suggestion time limits

* test: Use a fixed name in the collection member name filter test
2026-11-13 22:37:49 -05:00
Tom Moor 4fd9b60400 fix: Fetch Azure profile photo in UploadUserAvatarTask instead of during login (#14584) 2026-11-13 18:15:55 -05:00
Tom Moor 2206588aa8 feat: Expiry column and expiry menu for shared links (#14579)
* feat: Expiry column and expiry menu for shared links

Adds an Expires column to the shared links table and a Set expiry submenu
with presets, a custom date dialog and removal. Also loads document
memberships in shares.list so the update policy is correct.

* fix: Hide share expiry menu when workspace sharing is disabled

* refactor: Load share document memberships in the list query
2026-11-13 09:29:30 -05:00
Tom Moor 587c211f57 fix: Do not overwrite canceled or finished imports from import tasks (#14578) 2026-11-13 08:40:05 -05:00
Tom Moor 8df9c854fa fix: Error imports that have nothing to import (#14577)
An import with no input, or a Notion import with no shared pages, stayed in an active state with no tasks. This blocked new imports for the team until the creator canceled it.
2026-11-13 08:33:36 -05:00
Tom Moor 6fd7eb7cf0 chore: Share import state lists from the Import model (#14575) 2026-11-13 08:05:13 -05:00
Tom Moor 4fd8b0731e fix: Limit archive contents read during imports (#14576) 2026-11-13 08:04:58 -05:00
Tom Moor 67fbbc6fcc Merge remote-tracking branch 'origin/main' into claude/document-owners
# Conflicts:
#	server/commands/documentUpdater.ts
#	server/mcp/tools/documents.ts
#	server/routes/api/documents/schema.ts
2026-11-12 23:09:00 -05:00
Tom Moor e0895fc548 Refine authentication token handling (#14572) 2026-11-12 23:00:42 -05:00
Tom Moor 97055b2d80 chore: Split server/routes/index.ts into focused routers (#14556)
Move static assets, shares, embeds and the app catch-all into their own
routers, and extract workspace redirect and render option logic so the
index file only composes middleware in order.
2026-11-12 21:52:06 -05:00
Tom Moor 2276ee2ecb Set lock_timeout on request transactions (#14563)
* Set lock_timeout on request transactions

Lock waits in API transactions now fail after 5s with a 503 instead of
holding a pool connection until the statement timeout.

* Map query timeouts to request_timeout in batch sub-requests
2026-11-12 21:51:48 -05:00
Tom Moor 631114129e perf: Lock only the target row in locked queries with joins (#14564) 2026-11-12 21:48:14 -05:00
Tom Moor ecb27a7132 fix: Scope import attachment queries to the importing team (#14557) 2026-11-12 19:06:15 -05:00
Tom Moor f04a300bed perf: Add index for inherited group permission lookups (#14560) 2026-11-12 19:05:44 -05:00
Tom Moor e262f3bd17 perf: Add partial createdAt index for stuck import task scan (#14565) 2026-11-12 18:59:43 -05:00
Tom Moor d066c98bde fix: Remove vestigial done flag from document updates (#14561)
Creating a revision immediately when the user clicks Done raced the collaboration server's save debounce, producing a stale revision followed by a second one and duplicate Slack notifications.
2026-11-12 18:57:50 -05:00
Tom Moor 72a72dc735 fix: Popularity score update blocks inserts that reference documents (#14558)
* fix: Use FOR NO KEY UPDATE when locking documents for popularity scores

* test: Cover popularity update with a key share lock held
2026-11-12 18:55:35 -05:00
Tom Moor f95761dddf perf: Use FOR NO KEY UPDATE where locked rows are only updated (#14559)
* perf: Use FOR NO KEY UPDATE where locked rows are only updated

Rows that other tables reference by foreign key are now locked with
FOR NO KEY UPDATE when the transaction only updates or soft-deletes
them, so concurrent inserts that reference the row are not blocked.

* test: Collaborative save does not wait for foreign key inserts
2026-11-12 18:54:37 -05:00