LibreChat/client/src/hooks/SSE
Danny Avila 9cb5ac63f8
🫧 refactor: Clear Drafts and Surface Error on Expired SSE Stream (#12309)
* refactor: error handling in useResumableSSE for 404 responses

- Added logic to clear drafts from localStorage when a 404 error occurs.
- Integrated errorHandler to notify users of the error condition.
- Introduced comprehensive tests to validate the new behavior, ensuring drafts are cleared and error handling is triggered correctly.C

* feat: add STREAM_EXPIRED error handling and message localization

- Introduced handling for STREAM_EXPIRED errors in useResumableSSE, updating errorHandler to provide relevant feedback.
- Added a new error message for STREAM_EXPIRED in translation files for user notifications.
- Updated tests to ensure proper error handling and message verification for STREAM_EXPIRED scenarios.

* refactor: replace clearDraft with clearAllDrafts utility

- Removed the clearDraft function from useResumableSSE and useSSE hooks, replacing it with the new clearAllDrafts utility for better draft management.
- Updated localStorage interactions to ensure both text and file drafts are cleared consistently for a conversation.
- Enhanced code readability and maintainability by centralizing draft clearing logic.
2026-03-19 14:51:28 -04:00
..
__tests__ 🫧 refactor: Clear Drafts and Surface Error on Expired SSE Stream (#12309) 2026-03-19 14:51:28 -04:00
index.ts 🚏 chore: Remove Resumable Stream Toggle (#11258) 2026-01-07 20:37:35 -05:00
useAdaptiveSSE.ts 🚏 chore: Remove Resumable Stream Toggle (#11258) 2026-01-07 20:37:35 -05:00
useAttachmentHandler.ts 🗂️ feat: Better Persistence for Code Execution Files Between Sessions (#11362) 2026-01-28 17:44:32 -05:00
useContentHandler.ts 🌊 feat: Resumable LLM Streams with Horizontal Scaling (#10926) 2025-12-19 12:14:19 -05:00
useEventHandlers.ts 🎞️ refactor: Image Rendering with Preview Caching and Layout Reservation (#12114) 2026-03-06 19:09:52 -05:00
useResumableSSE.ts 🫧 refactor: Clear Drafts and Surface Error on Expired SSE Stream (#12309) 2026-03-19 14:51:28 -04:00
useResumeOnLoad.ts 🚏 chore: Remove Resumable Stream Toggle (#11258) 2026-01-07 20:37:35 -05:00
useSSE.ts 🫧 refactor: Clear Drafts and Surface Error on Expired SSE Stream (#12309) 2026-03-19 14:51:28 -04:00
useStepHandler.ts 🆔 fix: Atomic File Dedupe, Bedrock Tokens Fix, and Allowed MIME Types (#11675) 2026-02-07 13:26:18 -05:00