LibreChat/packages
Danny Avila e452a130e9
perf: Minimize group membership query in principal resolution (#14055)
getUserPrincipals resolves a user's ACL principals on nearly every
authenticated request. It fetched full group documents (including entire
memberIds arrays) only to read each group _id, and always issued a
separate User lookup for idOnTheSource.

- Project { _id: 1 } on the memberIds group query so it returns only ids
  and can be served from the { memberIds: 1 } index instead of fetching
  and decoding whole group docs.
- Accept role and idOnTheSource from the already-loaded request user and
  thread them from the capability middleware, collapsing the hot path to
  a single indexed group query (idOnTheSource: null means known-local).
2026-07-02 08:44:40 -04:00
..
api perf: Minimize group membership query in principal resolution (#14055) 2026-07-02 08:44:40 -04:00
client 🧪 ci: Resolve DataTable test infinite re-render (#13947) 2026-06-24 23:40:18 -04:00
data-provider 🧠 fix: Default Bedrock thinking maxTokens to model max output (#14058) 2026-07-01 18:29:45 -04:00
data-schemas perf: Minimize group membership query in principal resolution (#14055) 2026-07-02 08:44:40 -04:00