LibreChat/config
Marco Beretta de9d46fcd4
🔎 perf: Index-Bound Word-Prefix Search for Users and Groups (#16719)
* perf: Debounce People Picker Search

* perf: Index-Bound Word-Prefix Search for Users and Groups

Principal search and admin user search matched name, email and username
with case-insensitive regexes, which scan the whole users collection.
Users and groups now store lowercase, accent-folded token arrays derived
from each searchable field, indexed with tenantId, and searches match
anchored token prefixes. Schema middleware keeps the tokens in sync on
save, insertMany and update queries. Documents written before the tokens
existed stay findable through a fallback branch until
npm run migrate:search-tokens backfills them; startup warns while any
remain.

* perf: Build Search Token Indexes in the Backfill Migration

* fix: Reconcile Stale Search Tokens and Close Write-Path Gaps

The backfill now compares every document's tokens with its source fields and
repairs stale ones, so writes from an older server during a rolling deploy are
recoverable by rerunning it. Undefined assignments no longer clear tokens,
upsert inserts initialize every token field, every query word is required,
relevance scoring folds accents like the filter does, and the startup check
counts both collections in parallel and owns its error logging.

* perf: Drop the Second People Picker Debounce

SearchPicker already debounces query changes by 500ms; the extra 300ms delay
in UnifiedPeopleSearch stacked on top of it.

* fix: Match Nothing for Queries Over the Word Cap

Dropping the query word cap let one request build an unbounded filter. Restore
a 16 word cap, but a longer query now matches nothing instead of ignoring its
extra words, so a cap never produces a false positive.

* test: Cover Word-Prefix People Search and the Token Backfill End to End

* fix: Tokenize Fields an Upsert Copies From Its Filter

MongoDB copies equality conditions from an upsert's filter into the inserted
document, so their token fields now derive from that value instead of being
initialized empty.

* fix: Rank Accent-Folded User Matches Like the Search Filter

* test: Run the Token Backfill Without Blocking the Playwright Worker

* perf: Index Search Tokens Tenant First for Scoped Searches and Ignore Undefined Unsets

* test: Skip the Module-Scope Index Rebuild When the Scenario Runs the Backfill

* fix: Exit the Search Token Migration When Redis Clients Stay Open

* perf: Probe for Missing Search Tokens at Startup Instead of Counting Them

* test: Explain the Startup Probe the Warning Actually Issues

* fix: Keep Search Token Fields Out of Serialized Users and Groups

* fix: Keep the Admin Search Legacy Fallback Anchored at the Field Start

* fix: Score Groups Only on the Fields Search Matches

* perf: Start the Search Token Probe Alongside the Permission Checks

* fix: Warn at Startup When the Search Token Indexes Were Never Built

* fix: Score People Search Matches With the Filter's Word Separators

* perf: Check the Token Indexes Before Probing for Unmigrated Documents

* test: Drive the Failed Startup Probe Past the Index Check

* fix: Score People Search Matches Independently of Word Order
2026-10-16 22:41:37 +02:00
..
__tests__ 🗑️ fix: Route Delete-User CLI Through the Shared Account Erasure Cascade (#17033) 2026-10-14 23:53:16 +02:00
add-balance.js
ban-user.js
circular-deps.mjs 📦 feat: Scaffold the @librechat/chat Package (#16964) 2026-10-10 21:00:10 +02:00
connect.js
create-error-convo.js 📡 fix: Explain Model Streams That Die Mid-Response (#16415) 2026-09-27 15:21:20 -04:00
create-user.js 💬 refactor: ChatForm UI redesign with unified palette (#14473) 2026-10-01 03:46:18 +00:00
delete-banner.js
delete-user.js 🗑️ fix: Route Delete-User CLI Through the Shared Account Erasure Cascade (#17033) 2026-10-14 23:53:16 +02:00
deployed-update.js 🚚 chore: Point Repository and Image References at LibreChat-AI (#16005) 2026-09-23 23:08:36 -04:00
flush-cache.js
helpers.js 🔒 fix: Hide Password Input in Reset CLI (#14923) 2026-08-18 07:50:47 -04:00
invite-user.js 🖍️ refactor: Typed Console Colors and Hardened Script Helpers (#14778) 2026-08-12 22:48:36 -04:00
jest.config.js
jest.setup.logging.cjs 🔇 refactor: Quiet Framework Logging in Unit Tests (#15363) 2026-08-30 15:26:30 -04:00
jest.workers.cjs 🧠 perf: Recycle Backend Jest Workers Past 1GB (#17098) 2026-10-16 22:15:10 +02:00
list-balances.js 🗄️ perf: Cut Serial and Redundant Database Reads (#16711) 2026-10-03 10:41:47 -04:00
list-users.js 📃 fix: Enforce Terms Acceptance on the Server and Mark Backfilled Consent (#17063) 2026-10-14 17:45:28 +02:00
migrate-agent-permissions.js
migrate-code-file-duplicates.js 🧹 chore: Migrate Legacy Duplicate Code Files Blocking Dedupe Index (#14593) 2026-08-02 06:41:21 -04:00
migrate-orphaned-agent-files.js
migrate-prompt-permissions.js
migrate-search-tokens.js 🔎 perf: Index-Bound Word-Prefix Search for Users and Groups (#16719) 2026-10-16 22:41:37 +02:00
migrate-shared-link-permissions.js
migrate-tenant-indexes.js 🛗 fix: Add Tenant Index Upgrade Migration (#15767) 2026-09-09 00:10:40 -04:00
migrate-terms-timestamp.js 📃 fix: Enforce Terms Acceptance on the Server and Mark Backfilled Consent (#17063) 2026-10-14 17:45:28 +02:00
packages.js 📦 feat: Scaffold the @librechat/chat Package (#16964) 2026-10-10 21:00:10 +02:00
reset-meili-sync.js
reset-password.js 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
reset-terms.js 📃 fix: Enforce Terms Acceptance on the Server and Mark Backfilled Consent (#17063) 2026-10-14 17:45:28 +02:00
set-balance.js 🏦 fix: Reserve Credits for In-Flight Requests (#15879) 2026-09-13 12:53:19 -04:00
smart-reinstall.js
stop-backend.js
test-subdirectory-setup.sh
update-banner.js
update.js 🖍️ refactor: Typed Console Colors and Hardened Script Helpers (#14778) 2026-08-12 22:48:36 -04:00
user-stats.js 🗄️ perf: Cut Serial and Redundant Database Reads (#16711) 2026-10-03 10:41:47 -04:00