I run Moim, a small app for meetups: you share one link, people RSVP, and everyone gets an entry QR for the door. A commenter on my last post asked the right question: what happens at the door when the venue has no signal?

So I put my phone in airplane mode and tried to use my own app. Almost nothing worked. Here is what I found, and what fixed each piece.

1. The app only ever saved the first page

A service worker can save pages as you visit them. But a Next.js app moves between screens with RSC data requests, not page loads. Browse ten screens, and only the first one is saved as a page.

Fix: while online (every 12 hours, and after every deploy), the app hands the service worker a list of screens to save: the tabs, your upcoming events and their chats, your clubs and a few of each club's events, your profile. After every deploy it also saves all of /_next/static (about 290 files), so a saved screen can run even if you never opened it on this device.

2. Offline taps ended on an error page

Offline, an in-app link asks the server for RSC data and fails. I capture link clicks offline and turn them into real page loads, which the service worker answers from its saved copies. If a screen was never saved, the app stays where it is and says so, instead of showing a dead-end offline page.

3. Android forgets the service worker when the app is killed

This one surprised me. In an Android WebView, getRegistrations() returns nothing after the app process restarts. Cache Storage is still there, but nothing serves it. The native shell now serves a tiny bootstrap page and a bundled copy of the worker script while offline. The page re-registers the worker, then opens the saved home screen.

(iOS has its own gotcha: WKWebView only enables service workers with App-Bound Domains.)

4. Chats were empty

Chat messages come live from Firestore over a long-lived connection that never passes through the service worker. I turned off Firestore's own offline persistence on purpose, because chats would stay on the phone after sign-out. Instead, the app keeps the last 50 messages of your recent chats in localStorage, per user, and deletes them on sign-out.

5. Doing things offline: an outbox

RSVPs, likes, comments and settings changes go into an outbox instead of failing. For each item, only the latest intent is kept: like → unlike → like sends one "like". The server treats repeated requests as the same request, so sending one again is safe. Door check-ins are checked against the guest list already loaded on the phone and are synced when the connection is back.

What I'd tell past me

  • "Offline" is four questions: what to keep, when to save it, how to serve it, and what to do with writes.
  • Test cold starts in airplane mode on a real device. The emulator and simulator hid two of these bugs.
  • Some things should stay online-only on purpose. For example, a paid RSVP needs the server to decide.

If you organize meetups, I'd love feedback: https://mymoim.com/?from=devto
The Android app is in closed testing. Open this on your phone to join in two taps (no approval): https://mymoim.com/android?from=devto