* fix: preserve Insights with guarded ACL role updates
* test: settle ACL index builds before opening the transaction
* fix: replace ACL mask partitions with single-operator bit writes
* style: drop the now-unused RoleBits import
* fix: make ACL role replacement one atomic guarded write
* fix: export the permission write retry ceiling
* fix: retry ACL mutations per document and preserve atomic permissions
---------
Co-authored-by: Lia <lia@librechat.ai>
* 🧭 fix: Resolve People Picker Search Types Once
The people picker access check and the principal search handler each parsed
the requested principal types on their own: the check honored both `type`
and `types`, while the search read only `types` and treated an absent or
unrecognized filter as every type. Searches now use the types the access
check resolved, so a request without a usable filter covers only the types
the role can view, and the Entra ID lookup follows the same set.
Moves the access check into packages/api as createPeoplePickerAccess.
* 🧭 refactor: Move Principal Search Handler into packages/api
Lifts the search-principals handler into createPrincipalSearch with its
database and Microsoft Graph calls injected, leaving the controller as
wiring. The people picker access check now takes a plain permissions
shape instead of the stored role document.
* 🧭 refactor: Type Principal Search Requests Without Stored User Documents
The exported request type now names the query, headers and the few user
fields the handlers read, instead of extending ServerRequest and its IUser.
* 🧯 fix: Remove revoked agents from user favorites
When agent access is revoked, the agent remained in the user's favorites
causing repeated 403 errors on page load. Backend now cleans up favorites
on permission revocation; frontend treats 403 like 404 and auto-removes
stale agent references.
* 🧪 fix: Address review findings for stale agent favorites cleanup
- Guard cleanup effect with ref to prevent infinite loop on mutation
failure (Finding 1)
- Use validated results.revoked instead of raw request payload for
revokedUserIds (Finding 3)
- Stabilize staleAgentIds memo with string key to avoid spurious
re-evaluation during drag-drop (Finding 5)
- Add JSDoc with param types to removeRevokedAgentFromFavorites
(Finding 7)
- Return promise from removeRevokedAgentFromFavorites for testability
- Add 7 backend tests covering revocation cleanup paths
- Add 3 frontend tests for 403 handling and stale cleanup persistence