Every React Native app I audit with offline support has the same problem: events are being dropped and nobody knows. The queue exists, the retry logic looks fine, and the data is still wrong. Here's why.

Here’s what I find, almost without exception, when I audit a React Native app that claims to support offline analytics.
The team built an in-memory queue. When the app goes offline, events get pushed into an array. When connectivity returns, the queue flushes. It works in the dev build. It works in the demo. In production, on real devices, with real network conditions, it silently drops somewhere between 8% and 30% of events depending on session length and device memory pressure.
Nobody notices because there’s no instrumentation on the queue itself. The dashboards show lower numbers and the product team assumes users are just less active in areas with poor connectivity. They’re not. The data is gone.
This isn’t a niche edge case. Offline event loss is the most consistent finding in every React Native analytics audit I run. And it’s always fixable — the same way, with the same set of decisions.
An in-memory queue is the first thing engineers reach for, and it handles the obvious case: the user loses signal for 30 seconds, events accumulate, connectivity returns, events flush. Clean.
What it doesn’t handle:
App termination. The OS kills your app while the user is offline. Everything in memory is gone. This happens constantly on iOS (low memory, background termination) and Android (aggressive battery management on OEM builds). On a mid-range Android device in power-saving mode, background app lifetime can be under 60 seconds.
Long offline sessions. A user opens your app in airplane mode on a flight, uses it for 90 minutes, closes it. When they land and reopen the app, does your queue survive app restart? If it’s in-memory, it doesn’t.
React Native’s JavaScript runtime lifecycle. The JS bundle can be reloaded — during hot reloads in development, during OTA updates via CodePush or EAS Update, or after certain native crashes that let the app recover. Each reload wipes your in-memory state.
Memory pressure flushes. On memory-constrained devices, holding large arrays of event objects in the JS heap is a liability. Some teams add a max queue size cap; when that cap is hit, new events get dropped silently rather than the queue being persisted first.
The fix is not a smarter queue. The fix is a different storage layer.
Even teams that do persist their queue to disk get the flush timing wrong. The two most common mistakes:
Flushing on NetInfo state change only. NetInfo from @react-native-community/netinfo tells you when connectivity changes. Seems like the right hook. It’s not sufficient on its own. Network state can flip rapidly — connection drops, recovers for 2 seconds, drops again. If your flush logic triggers immediately on connected: true, you’ll fire a batch of API requests into an unstable connection, get a mix of successes and timeouts, and your retry logic has to be bulletproof (it usually isn’t).
Not flushing on AppState change to background. When a user sends your app to the background, you have a short window — roughly 5 seconds on iOS — before the app can be suspended. If the user just generated events while offline, this is your last chance to persist them before potential termination. Most implementations I audit miss this entirely.
The flush strategy I use:
NetInfo change to connected, with a 2-second debounce to let the connection stabilize.AppState moves to background — whatever is in the queue goes to disk if not already persisted.Don't rely on a background task (via react-native-background-fetch or similar) as your primary flush mechanism. Background task scheduling is unreliable across Android OEMs and iOS power states. Use it as a supplement, not a foundation.
This one is subtle and I’ve only seen it written about properly a handful of times.
You persist an event to disk: { "event": "checkout_complete", "v": 1, "properties": { "cart_value": 49.99, "item_count": 3 } }. The user stays offline for two days. You ship a new app version via OTA update. Your checkout_complete schema is now v2 — you renamed item_count to items_in_cart and added a required currency field.
When the user comes back online, your flush logic reads the v1 event off disk and tries to send it. If your ingestion endpoint does strict validation, it gets rejected silently (or with a 400 that your retry logic treats as a permanent failure and discards). If your endpoint is permissive, you get a malformed record in your warehouse that breaks downstream queries.
You need schema versioning on every persisted event, and you need a migration or discard strategy for events written against old schemas.
My approach: every event stored to disk includes a schema_version field and an app_version field. On flush, events are run through a lightweight migration map before transmission. If no migration exists for a given schema transition, the event is discarded — but that discard is itself logged as a queue_event_discarded diagnostic event so I can see schema drift impact in the warehouse.
It’s more engineering up front. It saves a pipeline reliability crisis six months later when you do a tracking plan refactor and suddenly 15% of your weekend events are getting silently dropped.
For most React Native apps, SQLite via expo-sqlite or react-native-quick-sqlite is the right call. Here’s why it beats the alternatives:
AsyncStorage is key-value and not designed for queuing. You end up serializing arrays to JSON, deserializing on read, re-serializing on partial flush. It’s slow on large payloads and offers no transactional guarantees — a partial write during app termination can corrupt the stored array.
MMKV is fast and excellent for preferences and small state, but same problem: it’s key-value, not row-oriented. Partial dequeue operations are awkward.
SQLite gives you a proper table for your event queue. Each event is a row. Flushing is a SELECT with a LIMIT, followed by a DELETE by ID after confirmed transmission. That’s an atomic, reliable dequeue pattern. You can add indexes, you can query for diagnostic purposes, and you can do partial flushes without touching unprocessed events.
Schema for the queue table:
CREATE TABLE event_queue (
id INTEGER PRIMARY KEY AUTOINCREMENT,
event_name TEXT NOT NULL,
properties TEXT NOT NULL, -- JSON blob
schema_ver INTEGER NOT NULL,
app_version TEXT NOT NULL,
created_at INTEGER NOT NULL, -- Unix timestamp ms
attempt_count INTEGER DEFAULT 0
);attempt_count is important. After 5 failed transmission attempts, stop retrying and route the event to a dead-letter log rather than retrying forever. Events older than 7 days should also be pruned — stale data causes more problems than data gaps.
Add a simple SELECT COUNT(*) query on app foreground that logs the current queue depth as a diagnostic event. If you're seeing queue depths above 200 events regularly, you have a flush reliability problem worth investigating.
Here’s the thing most teams never do: instrument the queue as rigorously as you instrument the app.
If you can’t answer these questions from your warehouse, your offline analytics reliability is a black box:
For each of these, you need a corresponding diagnostic event. I use a queue_ prefix namespace:
queue_event_stored — event written to disk, with event_name and schema_verqueue_flush_started — batch flush initiated, with batch_size and trigger (foreground / netinfo / background)queue_flush_completed — batch confirmed by server, with events_sent and duration_msqueue_flush_failed — batch rejected or timed out, with error_code and attempt_countqueue_event_discarded — event removed without transmission, with reason (schema_mismatch / max_age / max_attempts)These events are lightweight and go through the same pipeline. In the warehouse, they give you a complete reliability picture. I’ve used this to identify that a specific Android OEM’s aggressive background process management was causing 22% event loss for one client’s user segment — a problem that was completely invisible in their existing dashboards.
When I audit an offline analytics implementation, here’s what I check in the first 20 minutes:
Storage layer
schema_ver, app_version, created_at, attempt_countFlush triggers
NetInfo connected (with debounce)AppState background transitionSchema management
Queue instrumentation
queue_flush_completed and queue_flush_failed events exist in warehouseIf you’re checking more than two or three of these boxes as “not sure” — that’s the gap. Your offline analytics looks fine in your dashboards because the failures are silent. The data isn’t missing, it’s just never arriving.
If you're not certain your React Native app is actually delivering offline events reliably, I offer a free 30-minute data audit. No prep needed. We look at your current setup, I tell you exactly what's broken. Book at petegerhat.com.
The worst version of this problem is a product team making retention decisions based on engagement data that’s 20% incomplete — not because users aren’t engaging, but because the queue is dropping events every time someone uses the app in a subway tunnel. The decision gets made, the feature gets cut, and the data was wrong the whole time.
Free 30-min data audit · No prep needed · Actionable gaps
5-Step Mobile Analytics Guide
Get the free checklist. Find out if the data behind your product decisions is complete — or if your app is quietly missing key user actions.
The guide is on its way — check your spam folder if it doesn't arrive within a minute.
Sent to:
The most common gap I find: key user actions tracked in the app but never arriving clean. Step 2 in the guide shows exactly where.
Book a free 30-min call and I'll go through your specific setup with you.
Schedule a free call →5-Step Mobile Analytics Guide
Leave a comment