Offline Mode and Sync
NAOS is built with an offline-first architecture: you can keep selling even without an internet connection. When connectivity is restored, everything syncs automatically.
How It Works
Local Database
The app maintains a local copy of data in SQLite:
- Products and categories.
- Customers.
- Orders.
- Invoice numbering sequences.
- Business settings.
Automatic Detection
- The app automatically detects whether there is a connection.
- A visual indicator shows the status:
- Green: Connected and synced.
- Orange: Syncing pending data.
- Red: No connection (offline mode active).
Selling Without Internet
When you lose connectivity:
- You can keep selling as usual.
- Orders are saved locally.
- Invoices are digitally signed (if the certificate is loaded).
- Invoices are set to “Pending” status for submission to the DGI.
- Invoice numbering is managed locally.
Synchronization
Upon Reconnecting
When connectivity returns, the app automatically:
- Uploads orders created offline to the server.
- Sends pending invoices to the DGI via Aludra.
- Syncs invoice sequences (only if the local number is greater than the server’s).
- Downloads updates to products, prices, and settings.
Sync Queue
Pending operations are processed in order:
- Each operation is retried if it fails.
- No data is lost between attempts.
- You can check the queue status in Settings.
Offline Invoice Numbering
Invoice number management is critical for the DGI:
| Scenario | Behavior |
|---|---|
| Online | The server assigns the next number (with lock) |
| Offline | The app increments a local sequence |
| Reconnection | Syncs only if the local number is greater than the server’s |
Conflict Resolution
If data was modified both on the server and locally:
- The app detects the conflict during synchronization.
- A Conflict Resolution screen is displayed.
- You can choose:
- Keep local version (what you did offline).
- Accept server version (what another device changed).
- Once resolved, synchronization continues.
Data Available Offline
| Data | Available Offline | Syncs |
|---|---|---|
| Products and prices | Yes | Yes |
| Customers | Yes | Yes |
| Create orders | Yes | Yes |
| Collect payments | Yes | Yes |
| Sign invoices | Yes (with certificate) | Yes |
| Submit to DGI | No (requires internet) | Automatic |
| Reports | Partial (local data) | Yes |
| Cash register closings | Yes | Yes |
| Update catalog | No (requires internet) | Automatic |
Best Practices
- Sync before closing: Make sure there are no pending operations before closing the app.
- One terminal per device: Avoid conflicts by using a unique terminal per tablet.
- Load the certificate: Without a certificate, offline invoices cannot be signed.
- Review pending invoices: After a long offline period, check the invoice status in DGI.
Having sync issues? See Electronic Invoicing