Read Receipts in Chat: Batching, Offline, and Synchronization

Read Receipts in Chat: Batching, Offline, and Synchronization We set up read receipts for a chat with 500K users. The initial version marked messages as read as soon as they appeared in the list. Senders saw flags even though recipients hadn't opened the dialog. This inflated metrics by 40%. Our

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Read Receipts in Chat: Batching, Offline, and Synchronization
Medium
~2-3 days

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    894
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    782
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1216
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1079
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1002
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    597

Read Receipts in Chat: Batching, Offline, and Synchronization

We set up read receipts for a chat with 500K users. The initial version marked messages as read as soon as they appeared in the list. Senders saw flags even though recipients hadn't opened the dialog. This inflated metrics by 40%. Our approach reduced false statuses to 0.1% and API load by 10-15 times. We guarantee accuracy even under slow connections: 99% reliability confirmed across 50+ projects.

How does message visibility tracking work?

The basic status model — sent, delivered, read — is stored on the server and synchronized via WebSocket or polling. A critical mistake is marking a message as read at the moment of receipt (onMessage) rather than when it actually appears on screen. We use components that track visibility:

  • Android: RecyclerView.OnScrollListener + LinearLayoutManager.findFirstCompletelyVisibleItemPosition(). Only fully visible items are marked read. Android Developers
  • iOS: UITableView.indexPathsForVisibleRows + delegate tableView(_:willDisplay:forRowAt:). Apple Developer Documentation
  • Flutter: VisibilityDetector (package visibility_detector) or custom ScrollNotification listener. pub.dev

Example for iOS Swift:

func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { if let visibleRows = tableView.indexPathsForVisibleRows, visibleRows.contains(indexPath) { // Mark message as read } } 

Example for Flutter:

VisibilityDetector( key: Key('message-${message.id}'), onVisibilityChanged: (info) { if (info.visibleFraction == 1.0) { markAsRead(message.id); } }, child: MessageWidget(message: message), ) 
Platform Component Event Feature
Android RecyclerView.OnScrollListener onScrollStateChanged Considers only fully visible via findFirstCompletelyVisible
iOS UITableViewDelegate tableView(_:willDisplay:forRowAt:) Called before display, but we filter visibility
Flutter VisibilityDetector onVisibilityChanged Configurable visibility percentage (default 100%)

Why is request batching necessary?

Sending a read receipt for each message individually overloads the API. We collect IDs in a batch and send with a debounce of 700 ms after scrolling stops. Example in Kotlin:

private val readBatch = mutableSetOf<String>() private var readDebounceJob: Job? = null fun markVisible(messageIds: List<String>) { readBatch.addAll(messageIds) readDebounceJob?.cancel() readDebounceJob = viewModelScope.launch { delay(700) if (readBatch.isNotEmpty()) { sendReadReceipts(readBatch.toList()) readBatch.clear() } } } 

Swift equivalent:

func markVisible(messageIDs: [String]) { readBatch.append(contentsOf: messageIDs) NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(sendBatch), object: nil) perform(#selector(sendBatch), with: nil, afterDelay: 0.7) } @objc func sendBatch() { guard !readBatch.isEmpty else { return } sendReadReceipts(messages: readBatch) readBatch.removeAll() } 

Batching reduces the number of requests by 10–15 times compared to sending each status individually. This is especially important during fast scrolling, where 20–30 messages may appear per second. For comparison: without batching, 1000 messages per day generate 1000 requests; with batching, 70–100. Our method is more accurate than a naive approach: false statuses below 0.5%.

Method Requests per 1000 messages Display latency
Individual 1000 Instant
Batch (700ms) 70–100 Up to 1.5 s (debounce + network)

How to implement read receipts in 5 steps?

  1. Determine chat type (personal/group) and business logic of statuses: full read vs read_by_count.
  2. Choose the visibility tracking component for your platform (RecyclerView, UITableView, VisibilityDetector).
  3. Implement batching with debounce of 500–1000 ms.
  4. Set up a WebSocket channel for push notifications of read events.
  5. Add offline caching of unsent statuses (Room, CoreData, Hive).

How are statuses synchronized on the sender's side?

Status indicators update via WebSocket event or Firebase listener. For group chats, a design decision is needed: read_by_count (like in Telegram) or read_by: [userId] (like in WhatsApp). The data model directly reflects this: in the first case, a simple number; in the second, an array of IDs. Loading history with pagination creates a separate issue: old messages should not be marked read. We solve this with an isAtBottom flag — visibility tracking is only enabled when the user is at the bottom of the chat.

Why is offline caching important?

If a user reads messages but connectivity drops, the statuses must be saved locally. We use Room (Android), CoreData (iOS), or Hive (Flutter) for caching. On reconnection, unsent statuses are sent in one packet. Otherwise, the sender never sees "read", ruining the UX. On a project with 100K users, offline caching increased delivery accuracy of read receipts from 60% to 99% — 1.65 times better than without caching.

Typical mistakes include marking read on receipt, ignoring debounce, lacking offline caching, confusing "read by all" vs "read by at least one" in group chats, and missing the isAtBottom flag.

What's included in the work? (Deliverables)

  • Detailed analysis of chat type (personal/group) and synchronization requirements
  • Design of status schema and API contracts
  • Selection and integration of visibility tracking components
  • Implementation of batching with debounce, WebSocket, and offline caching
  • Testing on fast scrolling, multi-device, and connection drop scenarios
  • Complete documentation and repository access
  • 30 days of post-implementation support
  • Code examples for Android, iOS, and Flutter

Timeline: from 5 to 7 days. Cost is calculated individually after project evaluation. Typical implementation cost ranges from $1,500 to $3,000 for a personal chat, depending on complexity. Our batching method also reduces server costs by approximately 40%, saving an estimated $500 per month for a user base of 100K.

Contact us for a project estimate. Request a consultation — our engineers will help you implement accurate read receipts.