• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
every now and again SDK becomes unusable...
Hi Stam,

I'll respond to your comments in-line.

Dear Mark and team,
I haven't yet started using AutoSetupAuthKey - however i did (as per the recommendation at LCM startup) download updated SDKs and now cannot connect to cloud data.

as previously, i get the messages:

(2021-06-03 20:40:49.519): Local authentication unsure: no local data to verify
(2021-06-03 20:40:52.105): Cloud authentication - received nonse value
(2021-06-03 20:40:53.962): Cloud authentication - received apiKey
(2021-06-03 20:40:53.962): Cloud authentication passed

but then I also get two new messages:

This is a successful authentication. Things look good here.

(2021-06-03 20:40:53.962): The authentication key changed. Successfully requested a new API authentication key
(2021-06-03 20:40:53.963): Error reading cloud records.

The last error occurs on trying to read cloud data after initialisation and auth. It's probably worth noting that gCDBAuthKey is empty at the end of this...

the InitialiseCanelaDB script is in the mainstack's script and is called from the on preOpenStack on the 1st card of the mainstack - the app is not currently built as a stand-alone.
Does this relate to autoSetupAuthKey?

The code use to work just fine previously...

Your experience here has nothing to do with the recent library update. It is just an unfortunate coincidence. Your app lost its authentication and needed to reauthenticate.

Should your app lose authentication, CanelaDB will, on your behalf, authenticate for you. What it does not do is attempt to do another read. Reading your comments inspired us to address this. We reworked the experience and will now have the API read your data after successfully authenticating again. 

I'll push a library update through LCM that will do this for you. 


Quote:EDIT 1: I'm not sure i understand where exactly i'm supposed to call autoSetupAuthKey as, as opposed the comments in the example, i haven't ever used cdb_SDK(). But calling this as per the example in documentation  (moving the initialisation script to a script only stack etc) didn't fix my issues.

Under most situations, you do no need to use cdb_autoSetupAuthKey(). LiveCode can update the script of mainstacks as long as they are not turned into a standalone. 

Thus, anything you run in the LiveCode IDE will work just fine no matter where you put it. 

Moving your init code to a script-only stack is still a good idea. But, you will need to use cdb_autoSetupAuthKey() after calling your cdb_auth() handler. Those two go well together. There is no need to call it at any other time. I'll go over the docs to clear this up.

Quote:EDIT 2: I was able to resolve this by reverting to an older version of the SDK and script. It's probably something i'm not doing right, but using the newer SDK/script does't work for me (i can always auth() but can never read data - i just get an unhelpful message saying 'Error reading cloud records' which goes away when i use older version of the SDK/script.

It is hard to say what you are experiencing here. If you want to package up your project so that it fails, we can have a look. 


Messages In This Thread
RE: every now and again SDK becomes unusable... - by mark_talluto - 06-09-2021, 04:26 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)