feat: implement offline message persistence and refined UI#1096
feat: implement offline message persistence and refined UI#1096deepak0x wants to merge 7 commits intoRocketChat:developfrom
Conversation
- Added localStorage-based message persistence partitioned by room ID. - Implemented robust timestamp-based sorting for consistent message order. - Added immediate offline detection and send failure handling. - Introduced RiWifiOffLine icon with upward-opening Resend/Delete menu. - Ensured resent messages move to the bottom of the chat list. - Added session cleanup to clear offline messages on logout. - Applied formatting and linting fixes.
|
This looks good overall, but I’d prefer the Wi-Fi icon to be more understated - small and subtle, to give it a cleaner, more polished look. |
|
sure |
…tants, replace react-icons wifi with built-in Icon, make offline indicator smaller and subtler
|
Hi @Spiral-Memory, addressed all three review comments: 1. PERSISTENCE_KEY moved globally 2 & 3. Replaced Before vs After: Please let me know if any further changes are needed! |
… to built-in Icon system
|
Also removed |

This PR implements robust Offline Message Persistence along with a refined UI for failed message delivery. It ensures that messages sent while offline are not lost, allows users to recover them after a page reload, and provides a clear, intuitive interface for resending or deleting failed attempts.
Closes #1091
Screenshots/Video
Screencast.from.2026-01-23.22-34-23.online-video-cutter.com.mp4
Key Changes
1. Offline Persistence (localStorage)
Implemented
localStorage-based caching for messages that fail to send.Messages are partitioned by Room ID (
rid), ensuring they only reappear in their respective channels.Persisted messages are automatically re-injected into the message store during:
Added session cleanup logic to wipe offline caches on user logout.
2. Refined Message Sorting
Ensures global ordering consistency between:
Resend behavior: When a message is resent, its timestamp is updated to the current time, naturally moving it to the bottom of the chat.
3. UX & UI Improvements
Offline Indicator: Added a centered red
RiWifiOffLineicon for messages that fail to send.Custom Error Menu: Clicking the error icon opens an upward-positioned menu with: