- presentDocuments: batch-load collection deletedAt for archived/deleted
documents so trash and archive listings no longer issue one Collection
query per document via isCollectionDeleted
- documents.search: present results through the batched presentDocuments
helper instead of one presentDocument call per result
- revisions.list: load collaborators for the whole page in a single User
query instead of one per revision, and stop fetching the unused content
and text columns when listing without content
- TextHelper.attachmentsToSignedUrls: fetch all attachments in one query
instead of one findOne per attachment id
- BacklinksProcessor: resolve linked documents and existing backlinks in
bulk queries and create missing backlinks with a single bulkCreate
- NotificationHelper: batch the per-recipient View lookup when filtering
comment notification recipients
- Add indexes covering hot queries that previously scanned: events
(teamId, createdAt) for the audit log, and shares (documentId) /
(collectionId) for shareLoader lookups
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTaaEHNxBrmBnoVa5iSJV6
* 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.
* wip
* fix: Remove unused variable in ProsemirrorHelper.extractEmojiFromStart
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* test
* DRY
* Restore cleanup
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>