Skip to content

Conversation

@deepak0x
Copy link
Contributor

@deepak0x deepak0x commented Jan 23, 2026

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:

    • Initialization
    • Room switching
  • Added session cleanup logic to wipe offline caches on user logout.


2. Refined Message Sorting

  • Ensures global ordering consistency between:

    • Server-fetched messages
    • Locally recovered offline messages
  • 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 RiWifiOffLine icon for messages that fail to send.

  • Custom Error Menu: Clicking the error icon opens an upward-positioned menu with:

    • Resend
    • Delete

deepak0x and others added 3 commits January 23, 2026 23:52
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Offline Message Handling and Resend/Delete UI

1 participant