As described earlier, Sync has four stages:
- Prepare the data to sync --- usually really quick. When this stage finishes, the Sync progress bar is about 1/4 complete.
- Send changes from the device to the backend. When this stage finishes, the Sync progress bar is about 1/2 complete.
- Fetch the latest app definition and data from the backend. After this stage, the Sync progress bar is about 3/4 complete.
- Prepare the data to run on the device --- usually really quick.
Most errors in Sync are observed in the second stage
- If there are network errors, the step is retried a few times, and if the failure persists, the Sync is halted. The solution is to retry later when connectivity is better.
- If you have poor connectivity or if large images have to be sent as part of the Sync, this step can take a long time and can potentially timeout. The solution is to retry later when connectivity is better.
You can always retry a failed Sync request.
If you have made changes in the app and Sync, you may see an error of the form: "Unable to update row in table 'Your-Table-Name. Execution of request failed: https://spreadsheets.google.com/feeds/cells/....... Unable to complete sync."
This error occurs when the AppSheet backend is unable to send your changes on to the cloud storage provider (in this case, Google Sheets). Almost always, this is because the request times out. If this error occurs often, it is usually a clear sign that there are complex cross-sheet formulas in the Google Sheet. Making a simple update to the sheet takes a lot of time to complete because all the formulas are recomputed by Google Sheets. You will need to simplify your Google Sheet, in particular avoiding some of the cross-sheet formulas.
This Change Cannot be Applied
The message "This change cannot be applied because there is a newer version of your app" is displayed if a client attempts to sync after the app definition has been changed on the server. For example, you will see this message if columns have been added or removed from a table and the client is not using the latest version of the application. The local changes queued on the device cannot be applied by the server when this happens.
You can verify this by comparing the client and server application version numbers. You can obtain the client application version number by clicking the menu at the top left and selecting 'About'. You can obtain the server application version number by opening the application in the Editor and going to the Info > Properties tab.
There are two possible remedies when this occurs:
- Restore the old version: The app creator can restore the client version of the app. This will work only if the underlying data sources (spreadsheets) column structure has not changed. Once the old version is restored, the sync should proceed successfully.
- Manual recovery: If you cannot restore the old version or are facing some other unrecoverable error, you will have to abandon the changes on the device.
- First capture the client's changes by clicking "Show Changes" in the "hamburger" menu at the top left of the mobile app. This will allow you to send yourself a copy of the changes via email, so that you can manually process the changes and add them to the spreadsheet.
- This will also create a copy of the changes in a special Recovery folder in the root folder for the app (in the app owner's cloud file system).
- Back on the device, click "Reset Changes" in the menu. This will permanently discard the queued up changes and synchronize the app with the backend