Salesforce Decode
Salesforcedecode
Back to questions
LWCAdvancedmobileimperativeerror-handling

Build mobile-first quick action LWC with offline-aware save queue

Real World Scenario

Mobile quick action LWC logs field visit. Saves fail silently when technician offline losing visit data.

Expected Answer

• Detect offline via navigator.onLine and Salesforce mobile offline APIs • Queue save payload in IndexedDB or mobile briefcase sync path • Show queued status badge on record until sync confirms • On reconnect flush queue with idempotent Apex upsert • Conflict detection when server record changed during offline period • Test offline simulation in mobile app test harness • Disable actions requiring live callout when offline with explanation

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Detect offline via navigator.onLine and Salesforce mobile offline APIs. Queue save payload in IndexedDB or mobile briefcase sync path. Pick based on your integration pattern and team capability. Mobile field workflows assume connectivity loss—offline queue is feature not edge case. Optimize for scale and operational observability.

Architect Perspective

Mobile field workflows assume connectivity loss—offline queue is feature not edge case.