Overview
MotorDesk is built with offline-first architecture, meaning you can continue working even without internet connectivity. All critical operations are saved locally and automatically sync when your connection is restored.MotorDesk is described in its configuration as an “offline-first” fleet management and electronic billing system, ensuring uninterrupted operations in the field.
How Offline Mode Works
Automatic Detection
The system automatically detects your connectivity status:- Online: All operations sync immediately to the server
- Offline: Operations are saved locally with
PENDINGsync status - Reconnected: Pending items automatically sync in the background
Sync Architecture
MotorDesk uses Redux state management with sagas for sync operations:- Invoice is saved locally with
sync_status: 'PENDING' - You can continue working immediately
- System monitors for reconnection
- When online,
syncPendingSales()function triggers - Pending items sync to server
- Status updates to
SYNCED
What Works Offline
Invoice Creation
Fully Functional:
- Create new invoices and sales receipts
- Add products from cached inventory
- Select customers from local database
- Calculate totals and taxes
- Save documents with PENDING status
Customer Management
Available:
- View existing customer directory
- Edit customer information
- Search through customer records
- Create invoices for existing customers
- ❌ API validation (RUC/DNI lookup) requires internet
- ✅ Manual customer registration still works
Fleet Management
Fully Functional:
- View vehicle fleet
- Add new vehicles
- Edit vehicle information
- Update odometer readings
- View maintenance alerts
- Search and filter vehicles
What Requires Internet
- API Document Validation: RUC/DNI lookup from SUNAT/RENIEC
- SUNAT Submission: Electronic invoice submission to tax authority
- Real-time Sync: Immediate server synchronization
- Cloud Backups: Automatic backup to cloud storage
- Multi-device Sync: Syncing data across multiple devices/locations
Offline Sync Process
Work Offline
Continue your normal operations:
- Create invoices
- Register vehicles
- Update customer information
- Process sales
Monitor Sync Status
The system shows pending sync items:
- Look for sync status indicators in the UI
- Pending items are marked clearly
- You can see what’s waiting to sync
Reconnect to Internet
When your connection is restored:
- System detects the
RECONNECTEDevent syncPendingSales()saga triggers automatically- All PENDING items queue for sync
- Progress indicators show sync status
Before Going Offline
Pre-Offline Checklist
Sync Recent Changes
Ensure all recent work is synced:
- Check sync status indicator shows no pending items
- Wait for any in-progress syncs to complete
- Verify recent invoices show SYNCED status
Verify Local Data
Confirm you have the data you need:
- Customer directory is current
- Product catalog is up to date
- Vehicle information is recent
- Pricing is correct
Logging Out Offline
When you log out with pending sync items: Your pending transactions:- ✅ Are saved securely on the device
- ✅ Will sync next time you log in (when online)
- ✅ Won’t be lost during logout
- ✅ Remain associated with your account
Best Practices for Offline Work
Data Management
-
Keep Local Cache Fresh
- Sync regularly when online
- Update product catalog before going offline
- Refresh customer data periodically
-
Monitor Storage
- Check device storage regularly
- Clear old cached data if needed
- Ensure adequate space for operations
-
Sync Frequently
- Don’t accumulate too many pending items
- Sync daily if possible
- Process pending queue regularly
Workflow Tips
-
Use Frequent Products
- Pre-configure common service items
- Speeds up offline invoice creation
- Reduces search requirements
-
Register Customers in Advance
- Add customers when online (for API validation)
- Build customer directory before field work
- Verify all information is complete
-
Update Vehicle Data Online
- Complete vehicle registrations when connected
- Ensures all data is properly synced
- Reduces offline data entry
-
Preview Before Processing
- Use VISTA PREVIA for complex invoices
- Verify all information is correct
- Catch errors before creating PENDING items
Field Service Scenarios
Mobile Service Technician:Troubleshooting Offline Mode
Pending Items Not Syncing
Check Connection
Verify internet connectivity:
- Test other websites/apps
- Check WiFi or mobile data
- Confirm no firewall blocking
Review Sync Status
Look for error indicators:
- Failed sync messages
- Connection timeout warnings
- Server unavailable notices
Data Conflicts
If the same record is edited offline and online:- System uses timestamp-based conflict resolution
- More recent changes typically win
- Critical data may require manual review
- Conflict notifications appear in UI
Storage Issues
If device storage is full:- Pending syncs may fail to save
- New invoices can’t be created
- Error message indicates storage problem
- Free up device storage
- Sync and clear old cached data
- Consider archiving old records
Understanding Sync Status
Status Indicators
| Status | Meaning | Action Required |
|---|---|---|
| SYNCED | Data is on server | None |
| PENDING | Waiting to sync | Connect to internet |
| SYNCING | Currently uploading | Wait for completion |
| FAILED | Sync error occurred | Review and retry |
Timestamping
The system tracks:syncedAt: When item last synced to server- Created timestamp: Original creation time
- Modified timestamp: Last edit time
Security in Offline Mode
Your data remains secure offline:- ✅ Local database is encrypted
- ✅ Authentication tokens cached securely
- ✅ No data accessible without login
- ✅ Device-level security applies
- ✅ Data syncs over encrypted connection
Next Steps
- Learn to Create Invoices in offline mode
- Manage your Vehicle Fleet offline
- Set up Customer Registration for offline work
