• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CDBCache sync from local to cloud
#1
Dear LiveCloud users,

I am a bit confused about how the CDBCache should be working. I may have the wrong understanding from the documentation and what I get with the code. Maybe someone can point me in the right direction.

My application starts after the login with checking to start with syncing updated records if authentication status with the cloud succeeds and then go into the first card, or just straight go to the first card if authentication status with the local database succeeds.


Code:
get cdb_auth(tEmail,tPassWord,"User")
put cdb_authStatus() into tAuthStatusA
if tAuthStatusA["cloud"] then
  cdb_loadTable
  ...
else
  if tAuthStatusA["local"] then
     cdb_loadTable
     ...
  end if
end if
...

The user can update records and these are applied to the local database first, and then synced to the cloud using cdb_batchSync(tInputA).
All have been working just fine when there is an internet connection, passing the cloud authentication at the start. I can use different devices and their local database is always synced via the cloud database. But when I put my laptop in airplane mode (no internet) it passes the local authentication and the call to cdb_batchSync isn't being processed. (This is testing in the development environment, working from within the LiveCode IDE.) I assumed from the documentation that the missed transactions, to sync the cloud database with the local changes (as the source), will be cached. When the application would start the next time, my laptop not being in airplane mode (so WITH an internet connection), the cached data update would then be applied to the cloud database. This never happens though.

Is there a different way I should work with this, keeping database content synced via the cloud across different devices (when sometimes a device is being used without an internet connection)? Any help to understand this better I would appreciate very much.
  Reply


Messages In This Thread
CDBCache sync from local to cloud - by Hendricus - 01-27-2023, 06:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)