mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* feat(api): Filter the conversation list by date, endpoint, files and sharing
The list query takes five new facets. Dates and endpoints narrow it
directly; hasFiles matches conversations that carry at least one file;
sharedOnly resolves the user's live share links and matches their
conversation ids, since a share expires and a denormalized flag on the
conversation would outlive it.
parseConversationListFilters owns what a valid facet is, so the route keeps
the call and nothing else. A malformed date fails the request rather than
being dropped: a filter that is quietly ignored answers with the
conversations the user asked not to see. The endpoint list is bounded at 50
names of 128 characters to keep an unbounded $in out of the query.
Two indexes back the new paths: user, archived, endpoint, updatedAt on
conversations, and user, conversationId on shares.
Cursor pagination is unchanged, so a filtered list pages the same way an
unfiltered one does.
* fix(api): Read the attachment facet from messages and tighten filter parsing
The hasFiles facet matched only the conversation's own files array, which
the standard send flow never writes: uploads ride on user messages, so an
ordinary chat with an attachment was invisible to the filter. The facet
now OR-matches message-derived conversation IDs alongside the
conversation-level array.
Dates are validated as ISO 8601 before construction, so 2026-02-30 and a
bare year no longer roll over into an unintended cutoff, and a mistyped
hasFiles or sharedOnly value fails with 400 instead of reading as absent.
The endpoint count and name-length limits moved to conversationList in
configSchema and are injected into the parser, so a deployment serving
more endpoints can raise them. The shared filter resolves its IDs with
distinct and reuses the set to mark isShared, dropping the second
SharedLink query on every filtered page.
* test(api): Exercise the real list-filter parser through the convos route
The route mock re-implemented the parser loosely: it ignored the configured
endpoint limits and dropped a mistyped flag, so a route that stopped
forwarding conversationList or stopped answering 400 still passed. The mock
now wraps the real parser, and the facet tests cover a mistyped flag and an
endpoint list over the configured limit.
* test(e2e): Acceptance scenarios for the conversation list facets
Each facet is exercised against the running API with its own endpoint name, so the
rows a test seeds are the only rows the filter can return: date cutoffs on updated
and created time, an OR-matched endpoint list, an attachment that only exists on a
message, shares that are live, expiring or lapsed, malformed facets answering 400,
and a list without facets returning what it did before.
* fix(api): Read the list filter limits from the base config
conversationList never reached the resolved app config: AppService builds it from
an explicit field list and the new knob was not on it, so a configured limit was
silently ignored and the defaults always applied. It is now carried onto AppConfig.
The list route also stops resolving the caller's merged config for it. The limits
are deployment-level, and configMiddleware put principal and override reads in
front of every cache-cold sidebar request, including ones with no facets; the base
config is in memory.
* fix(api): Read a list cutoff without an offset as UTC
A timestamp without Z or an offset was handed to new Date(), which reads it in the
server's local zone, so the same request selected different conversations on hosts
in different zones. It is now UTC, matching how a date-only cutoff is read.
* test(api): Share the base-config mock across the convos route specs
* perf(api): Start the attachment and share lookups together
With hasFiles and sharedOnly both on, the message-attachment lookup finished
before the share lookup began, adding the two latencies on every page. Both are
independent user-scoped reads, so they now run in parallel.
* refactor(api): Resolve the list filter limits in one place
The 50 and 128 defaults lived in both the parser and the schema's comments. They
are now field defaults on conversationListConfigSchema, AppService resolves them
(an invalid block keeps the defaults), and the parser takes the resolved values.
The base-config read moves out of the CJS route into
resolveConversationListFilters, which receives getAppConfig from the route.
* fix(api): Keep the list config read inside the route's error handling
* perf(api): Read the list limits only when a request names endpoints
The base config sits behind the config cache, which can be Redis, so every
sidebar request paid that round trip and could fail on it even though the limits
bound only the endpoint facet. A request without endpoints now reads no config.
* fix(api): Accept list cutoffs with microsecond or finer fractions
The cutoff pattern allowed at most three fractional digits, so a valid ISO 8601
timestamp from a serializer that emits microseconds (Python, most databases)
answered 400. Any fraction is accepted now and Date keeps the milliseconds.
* fix(data-schemas): Count files attached to message content parts in the file facet
A file attached through a mid-run steer is stored on the steer content part
rather than on the message, so hasFiles=true left that conversation out.
* fix(data-schemas): Match every content-part file shape in the file facet
Replay reads a file on a content part as files[], file.file_id,
image_file.file_id or a bare file_id; the facet matched only files[].
* fix(data-schemas): Count tool and assistant attachments in the file facet
A file a tool produces is persisted on message.attachments, the one place
on a message the facet did not read, so a chat whose only file was
generated output was left out of hasFiles=true.
* fix(data-schemas): Count download-only attachments in the file facet
A code or tool result can persist an attachment with a filepath and no
file_id; the client renders any attachment with a filepath as a file,
so the facet now uses the same rule.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| convos-route-mocks.js | ||