Skip to content

Devices Progress Syncing and Offline PWA

comicsnow edited this page Oct 19, 2026 · 2 revisions

How Device Tracking Works

  • Every client browser generates a persistent, unique device identifier (deviceId) stored in localStorage.
  • When connecting, the server registers the device name (e.g., "iPad Pro - Safari", "Pixel 8 - Chrome") under Settings → Devices.
  • Unclaimed devices are automatically bound to the authenticated user.

Cross-Device Reading Progress

  • As you read, the reader sends progress heartbeats (page, totalPages, completed) to /api/v1/comics/:id/progress.
  • Progress is stored in the database per-user.
  • When you open the same comic on another device, Comics Now! prompts you to resume from where you left off.

The Downloads Queue

  • Comics, series, or entire reading lists can be queued for offline reading via the Download button.
  • The Downloads manager downloads pages in the background and stores them in browser IndexedDB.
  • The download queue is persistent and resumes automatically if interrupted.

Installing as an Offline PWA

Comics Now! is a full Progressive Web App:

  • On iOS / iPadOS: Open the app in Safari, tap the Share button, and select Add to Home Screen.
  • On Android: In Chrome, tap the menu and select Install App or Add to Home screen.
  • On Desktop (Chrome/Edge): Click the Install icon in the URL address bar.
  • Once installed, downloaded comics can be read completely offline with zero internet access.

Active Connectivity Probing & Doze Self-Healing

On mobile devices (especially Android PWAs/WebAPKs), the operating system's battery optimization (Doze Mode) suspends network sockets when the screen locks. In standard PWAs, this causes browsers to get stuck reporting navigator.onLine === false even after reconnecting to Wi-Fi.

Comics Now! incorporates an intelligent self-healing connectivity loop:

  • High-Speed Health Probe (/api/v1/health): An unauthenticated, zero-overhead endpoint designed for sub-millisecond network verification.
  • Wake-Up & Focus Re-Validation: Whenever you unlock your phone or switch back to the PWA (visibilitychange and focus events), Comics Now! immediately probes the health endpoint.
  • Auto-Recovery: If the probe succeeds, the app clears any offline indicators, dispatches a live online event, and refreshes library and reading list data without requiring you to restart or kill the app.

Clone this wiki locally