Enhanced offline-support for Talk web + desktop clients
Open
Nobody has claimed this yet.
enhancement
feature: frontend 🖌️
Needs triage
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 586
- Avg merge
- 18h 27m
- Merged PRs (30d)
- 333
Description
[!TIP]
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Offline support
Prerequisites
- Vuex to Pinia Migration: All left Vuex stores (conversationsStore.js, messagesStore.js, participantsStore.js) must be fully migrated to Pinia.
- Optimized Message List Rendering: message display mechanism must be refactored to handle large message volumes efficiently. Instead of "easing" the entire list, implement a strategy to render only the currently visible messages plus a small buffer (context) above and below (virtual list / windowing)
Proposed Plan for Offline Support
-
Database Layer (IndexedDB)
- Pick a library (promise-based wrapper around IndexedDB):
- Dexie.js
- db.js
- RxDB
- other suggestions?
- Define Schema Design (what goes in):
- settings + local/remote capabilites
- conversations: metadata and last messages (migrate from current BrowserStorage approach)
- participants
- threads
- scheduled messages / drafts
- messages
- chat / thread blocks: coupled with messages
- polls and reactions
- Pick a library (promise-based wrapper around IndexedDB):
-
Persistence & Hydration
- APP >> DB: utilize Pinia's
$subscribein all relevant stores to trigger persistence of state changes - DB >> APP: during app initialization load data from IndexedDB into the Pinia stores
- step 2: lazy load some data on demand
- step 3: persist less data in stores, and more in db
- APP >> DB: utilize Pinia's
-
Connection Management & Operation Queue
- Monitor connection status globally (use @vueuse/core
useOnlineor custom solution) - Better handle offline state (instead of bombing with requests)
- Queue requests while offline, when the online event is detected, process the queue
- Handle conflict resolutions
- Monitor connection status globally (use @vueuse/core
-
UI/UX Enhancements
- Connectivity Indicators: status bar or badge indicating "Working Offline" or "Synchronizing..."
- Optimistic UI Extensions: Update the message list to visually distinguish states
- Toast Notifications: Provide feedback when the app successfully reconnects and finishes syncing pending changes
-
Implementation Phases
- Setup & Schema: Integrate DB wrapper and define the database structure, including tables for all identified data.
- Core Data Persistence & Eager Hydration: Implement store-to-DB synchronization and eager loading for conversations and settings
- Lazy Loading for Messages: Implement on-demand loading for messages, ensuring efficient display and pagination
- On-Demand Loading for Auxiliary Features: Implement loading for participants, chat blocks, threads, scheduled messages, polls, and reactions when their respective UI components are activated.
- Mutation Queuing: Implement the operationQueue for sending messages and other mutations while offline.
- Sync & Conflicts: Implement reconnection logic and basic conflict resolution for the operationQueue.
- UI/UX & Testing: Add visual indicators and perform rigorous offline testing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with conversationsStore.js, messagesStore.js, and participantsStore.js, then review the Vuex-to-Pinia prerequisite and the proposed IndexedDB options. Done means the stores are migrated, offline data and queued mutations support synchronization and conflict handling, and the listed UI/UX and testing phase is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- database, desktop, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100