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

In addition to what Mark said regarding not resetting the gCDBAuthKey global, there is a second issue in play:

The canelaDB libraries are being libraried multiple times. This happens because in your mainstack stack script, the preOpenStack handler calls "initializeCanelaDB", which starts using the canelaDB libraries. If this occurs while gCDBAuthKey is incorrect, you will see the error that you saw.

The reason your preOpenStack handler is getting called multiple times is because you have substacks, and whenever those substacks are opened, a preopenstack handler is sent. The preOpenStack handlers aren't being explicitly handled by the substack, so they pass to the mainstack. I recommend one of the following:

1. Move your preopenstack handler out of your stack script, and into the first card of your stack
or
2. Update your preopenstack handler to check the owner of the target:
Code:
on preOpenStack
   if the owner of the target is me then
   initializeCanelaDB
  end if
end preOpenStack
or
3. Add an empty preopenstack handler to all of your substacks

I think 1. or 2. will work best for you, though I would also still recommend that you don't assign any values to gCDBAuthkey
  Reply


Messages In This Thread
RE: every now and again SDK becomes unusable... - by mark.h - 05-10-2021, 09:26 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)