Understanding offline/online transitions

Online Status Indicator

The online status indicator button tells you whether you are online or offline and the number of pending changes. The button will be one of three colors: green, amber, or gray.

The online status indicator is green when you are online. It is amber (orange) if there is an error or incomplete sync. The online status indicator is gray when you are offline in one of the following 3 scenarios: 1. There is no network connection. 2. You are in a forced offline mode enabled by your org. 3. There are local changes pending (because of an earlier transition to offline mode due to an online operation timeout).

If there are local changes pending, the sync algorithm will try to initiate auto-sync if it is enabled, or the user needs to manually sync in order to push those changes.

What happens during the sync process?

Sync will kick off for two reasons: 1. If there is a network connection (data or wifi) and the auto-sync interval is reached. 2. A manual sync is requested using the Sync Now option.

Next, there is a session validation and a sync of the metadata. Metadata includes layouts, list views, compact layouts, search layouts, etc. Then Pulsar processes and resolves server deletes. After that, Pulsar queries changes from Salesforce and integrates them into the local database. Finally, Pulsar pushes the local changes and resolves them with the Salesforce server and the sync process is complete.

What happens if the sync process is interrupted?

If the sync process is interrupted for any reason the online status button will turn amber (orange). The most common reasons for an interruption are from a user interrupting the process, backgrounding the app, a network or server timeout, or encountering an error from the server when pushing local changes.

If there has been an unsuccessful change, the app will try again to automatically sync if the auto-sync setting is on. Otherwise, the user will have to click Sync Now manually. If there are local changes pending because of an interrupted sync, the app will continue to store all changes to the local database only until the next successful sync. This is to preserve the order of record operations and to make sure the dependencies are resolved before pushing changes to Salesforce. These changes will then be pushed to the server upon next sync. Upon next successful sync, the online status indicator will turn green.

 

Related pages