LibreChat/packages/api/src/middleware
Marco Beretta 784582850a
🧯 fix: Guard SSE Writes and Interval Cleanups Against Crashes (#17462)
* fix: Harden Timer Sweeps, SSE Writes, and Violation Counters

Guard SSE writes against ended or destroyed responses through one helper, catch and single-flight the job store and TTL cache cleanup timers, serialize in-process counter updates, cap the violation log, prune stale OAuth failure records, batch the active-job lookup, and count Redis keys with DBSIZE.

* refactor: Drop the redundant violation log entry copy

* refactor: Log single-flight sweep failures from the API package

* test: Cover active generation listing and client disconnect mid-stream

* refactor: Configure violation log retention and move title timeout into the API package

* feat: Configure OAuth failure retention through mcpSettings

* fix: Prune OAuth failures promptly under short retention
2026-10-27 23:06:58 +01:00
..
__tests__ 🏨 fix: Restore Strict Tenant Startup and Sign-In (#17441) 2026-10-26 01:08:30 +01:00
access.spec.ts
access.ts
admin.spec.ts
admin.ts
auth.spec.ts
auth.ts
balance.spec.ts
balance.ts
ban.spec.ts
ban.ts
capabilities.integration.spec.ts
capabilities.spec.ts 🧾 feat: Admin Config Write Report, Structured Issues and Deployment-Only Paths (#17395) 2026-10-24 10:01:13 +02:00
capabilities.ts 🧾 feat: Admin Config Write Report, Structured Issues and Deployment-Only Paths (#17395) 2026-10-24 10:01:13 +02:00
checkBalance.spec.ts
checkBalance.ts
code.spec.ts
code.ts
concurrency.ts 🧯 fix: Guard SSE Writes and Interval Cleanups Against Crashes (#17462) 2026-10-27 23:06:58 +01:00
contentFilter.spec.ts
contentFilter.ts
email.spec.ts
email.ts
error.spec.ts 🙈 fix: Mask Emails and Drop Personal Identifiers From Logs (#17048) 2026-10-15 15:54:27 +02:00
error.ts 🙈 fix: Mask Emails and Drop Personal Identifiers From Logs (#17048) 2026-10-15 15:54:27 +02:00
feedback.spec.ts
feedback.ts
forwarded.spec.ts 🙈 fix: Mask Emails and Drop Personal Identifiers From Logs (#17048) 2026-10-15 15:54:27 +02:00
forwarded.ts 🙈 fix: Mask Emails and Drop Personal Identifiers From Logs (#17048) 2026-10-15 15:54:27 +02:00
generationRetry.spec.ts
generationRetry.ts
index.ts 🏨 fix: Restore Strict Tenant Startup and Sign-In (#17441) 2026-10-26 01:08:30 +01:00
json.spec.ts
json.ts
management.database.spec.ts
management.spec.ts
management.ts
messageFilterPii.spec.ts ✂️ refactor: Remove Dead Helpers, Classes and Dependencies From packages/api (#17118) 2026-10-16 15:43:12 +02:00
messageFilterPii.ts ✂️ refactor: Remove Dead Helpers, Classes and Dependencies From packages/api (#17118) 2026-10-16 15:43:12 +02:00
messageIds.ts 🚿 fix: Bound Chat Message IDs and Remove Backtracking (#17388) 2026-10-24 10:16:25 +02:00
messageValidation.ts
modelBoundContent.spec.ts ✂️ refactor: Remove Dead Helpers, Classes and Dependencies From packages/api (#17118) 2026-10-16 15:43:12 +02:00
modelBoundContent.ts
modelBoundHistory.spec.ts
notFound.ts
origin.spec.ts
origin.ts
preAuthTenant.spec.ts
preAuthTenant.ts 🎨 feat: Paint the Operator Theme on a First-Ever Visit (#16962) 2026-10-14 13:16:44 +02:00
promptResolveLimiter.spec.ts ⛲ feat: Resolve Native and Langfuse Prompts by Source (#16909) 2026-10-24 13:47:52 +02:00
promptResolveLimiter.ts ⛲ feat: Resolve Native and Langfuse Prompts by Source (#16909) 2026-10-24 13:47:52 +02:00
remoteAgentAuth.spec.ts 📜 feat: Audit Admin Role, Group, Config and IdP Role Mutations (#17052) 2026-10-14 23:57:07 +02:00
remoteAgentAuth.ts 📜 feat: Audit Admin Role, Group, Config and IdP Role Mutations (#17052) 2026-10-14 23:57:07 +02:00
sanitize.spec.ts 🔑 feat: Keep Dotted Record Keys in Admin Config Writes and Publish the Config Contract (#17322) 2026-10-22 09:59:08 +02:00
sanitize.ts 🔑 feat: Keep Dotted Record Keys in Admin Config Writes and Publish the Config Contract (#17322) 2026-10-22 09:59:08 +02:00
share.spec.ts
share.ts
tenant.ts 🏨 fix: Restore Strict Tenant Startup and Sign-In (#17441) 2026-10-26 01:08:30 +01:00
tenantHeader.ts 🎨 feat: Paint the Operator Theme on a First-Ever Visit (#16962) 2026-10-14 13:16:44 +02:00
terms.spec.ts 🧾 feat: Admin Config Write Report, Structured Issues and Deployment-Only Paths (#17395) 2026-10-24 10:01:13 +02:00
terms.ts 🧾 feat: Admin Config Write Report, Structured Issues and Deployment-Only Paths (#17395) 2026-10-24 10:01:13 +02:00
twoFactor.spec.ts
twoFactor.ts