Background: Offline Sync in Temenos Quantum
How Offline Sync Works
Quantum supports offline-first architecture using Sync Objects and Object Services. These allow apps to cache and modify data locally and synchronize with the backend when connectivity is restored. Data sync happens via service adapters, versioned models, and pre/post sync hooks.
Architectural Considerations
In enterprise deployments, sync behavior must account for:
- Large payloads and poor network conditions
- Multi-device concurrency
- Backend API throttling
- Field-level data encryption and conflict resolution
Root Causes of Offline Sync Failures
- Incorrect Metadata Versioning: When local metadata is outdated, sync requests may be rejected by the backend.
- Custom Object Services Missing Conflict Policies: Lack of conflict resolution logic results in overwritten or lost data.
- Silent Adapter Failures: Adapters may return HTTP 200 but embed error messages in the response body.
- Faulty Network Detection: Apps may think they are online due to cached connectivity status, initiating invalid sync calls.
Diagnostic Strategy
Enable Full Logging
Set log levels to DEBUG for both client and middleware using the Temenos Console or AppConfig:
// Enable debug logging in app init kony.print("Sync Start") kony.sdk.mvvm.LogLevel = kony.sdk.mvvm.LogLevel.DEBUG;
Monitor Adapter Response Content
Use networkInspector
or postman
to examine sync adapter responses. Watch for payloads like:
{ "status": "partial_success", "error": "Metadata version mismatch", "details": {...} }
Inspect Client Storage
Use developer tools to inspect local DBs (IndexedDB
for hybrid, SQLLite
for native) and confirm sync queue content.
Step-by-Step Troubleshooting
1. Force Metadata Refresh
In cases of schema changes or adapter upgrades, force metadata download:
kony.sdk.mvvm.KonyApplicationContext.getAppInstance().getSyncManager().reset(); kony.sdk.mvvm.KonyApplicationContext.getAppInstance().init();
2. Add Conflict Resolution Logic
Customize Object Services with syncConfig.json settings like:
{ "conflictPolicy": "server_wins", "retryLimit": 3 }
3. Wrap Adapter Responses with Error Parsers
Handle adapter errors manually instead of relying on HTTP status:
if(response.status === 200 && response.data.error) { showError(response.data.error); }
4. Refresh Network State Explicitly
Call explicit network checks before triggering sync:
if(kony.net.isNetworkAvailable(constants.NETWORK_TYPE_ANY)) { startSync(); } else { showOfflineBanner(); }
Best Practices for Reliable Sync
- Schedule periodic background sync with retry logic.
- Encrypt local storage if offline data includes PII.
- Separate sync from user actions to avoid blocking UI.
- Use incremental sync models for large datasets.
- Test in poor network conditions using simulators like Charles Proxy or Network Link Conditioner.
Conclusion
Offline sync failures in Temenos Quantum can silently impact user trust, data integrity, and compliance readiness. Proactively designing sync flows, monitoring metadata consistency, and enhancing error handling are essential for production-grade mobile apps. With proper diagnostics and architectural foresight, development teams can transform a fragile sync model into a robust, audit-ready system.
FAQs
1. How can I detect if sync is failing silently?
Enable full adapter logging and inspect response bodies for embedded error objects even when HTTP status is 200.
2. Is server_wins always the best conflict policy?
Not necessarily. Use server_wins for system-of-record integrity, but prefer custom logic when user-generated content is critical.
3. Can sync failures affect other Object Services?
Yes. Shared adapters or token expirations can cascade failures across services. Isolate services where possible.
4. What tools help simulate poor network for testing sync?
Use Charles Proxy or Apple's Network Link Conditioner to simulate drops, latency, or throttling during sync sessions.
5. How often should metadata be refreshed?
Whenever backend schema or adapter contracts change. Automate this during app updates or session renewals.