Dropbox Livecode Library

Find out what's going on with LiveCode (the company), product releases, announcements, and events.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dropbox Livecode Library

Post by Mikey » Thu Sep 01, 2016 5:52 pm

yes, URL's can be case-sensitive, once the domain section is resolved, because everything else is passed as an argument to the host.

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Dropbox Livecode Library

Post by trevix » Mon Sep 05, 2016 4:19 pm

I recently upgraded to LC 8.

I had a few problems with the "phx_DropboxAvailable" and then they disappeared (uh?)

The fact is that on LC 8 the "put tURL" return a var but also also a "the return" (see LC dictionary on "https")
Should the "phx_DropboxAvailable" function somehow upgraded? and how?

When I had problems, it was like if there was a "put tURL" running (but there was none). (The function was called from the "openStack" with the "send in 200 milliseconds".

Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dropbox Livecode Library

Post by Mikey » Mon Sep 05, 2016 4:27 pm

What version of the library are you using? The problem wasn't with 8, the problem was that dropbox changed the way that it responded to bad URL's (which is how the library could tell if it was connected or not. There is no "ping" in the dropbox API, so this was really the only way to do it). The current version of the library is 1.12.

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Dropbox Livecode Library

Post by trevix » Mon Sep 05, 2016 11:55 pm

Yes, I'm using 1.12
When I had the problem, the result was set to ""Error Previous request not completed".
I don't know why the problem went away.
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Dropbox Livecode Library

Post by jacque » Tue Sep 06, 2016 4:49 pm

The "Previous request not completed" error is from libURL, the library that controls internet requests and is part of LC. It has always been an issue with no good workaround. Once it happens it will sometimes time out and go away but other times you need to reset the connection completely.

LC 8.1rc2 uses a new networking external and has done some work on this particular error. You might want to try that version of LC to see if it helps.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Dropbox Livecode Library

Post by FourthWorld » Tue Sep 06, 2016 5:26 pm

jacque wrote:The "Previous request not completed" error is from libURL, the library that controls internet requests and is part of LC. It has always been an issue with no good workaround.
I'm working on it. Thanks to Charles' post I'm now able to submit any number of requests with a more accurate error reporting that doesn't hang libURL:
http://lists.runrev.com/pipermail/use-l ... 30386.html

The remaining problem is that all error-handling must be done without "exit to top", which usually means tedious replication of error handling in each script that calls libURL, carefully structuring the logic to allow a with-the-grain exit that doesn't rely on "exit to top".

I'm in the process of crafting a hopefully simple recipe stack for that now, and will submit it to the bug queue. If it's determined not be a bug per se we'll at least get tips on a useful workaround. And if it is a bug hopefully it can be addressed in the 8.2 scope.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Dropbox Livecode Library

Post by jacque » Tue Sep 06, 2016 5:43 pm

Is the error still in 8.1rc2? I worked with Charles on that too. My use case is different from yours though, I don't use an exit statement.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Dropbox Livecode Library

Post by FourthWorld » Tue Sep 06, 2016 6:32 pm

jacque wrote:I don't use an exit statement.
How do you centralize error handling without "exit to top"?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Dropbox Livecode Library

Post by jacque » Tue Sep 06, 2016 7:34 pm

I'm funneling all URL requests through a single handler which contains this:

Code: Select all

set the socketTimeoutInterval to 5000  -- adjust to taste
repeat 3 times -- Chipp's method for unreliable connections, he used 5 repeats
  get url tURL
  put the result into tNetworkErr
  put it into tData
  if not needToRetry(tNetworkErr) then exit repeat
  wait 100 milliseconds -- don't use w/msgs, let it block
end repeat
set the socketTimeoutInterval to 10000  -- restore default
if tNetworkErr <> "" then
  -- inform user or write to log
else
  -- deal with the data
end if
The function it calls:

Code: Select all

function needToRetry pError -- Chipp's
  if pError is "timeout" or pError contains "socket timeout" or pError contains "error socket closed" \
        or pError contains "Previous request not completed" then
    return true
  else
    return false
  end if
end needToRetry
Charles found a bug in the original libURL that sometimes didn't deal properly with "hung" connections. He's fixed it, or at least most instances of it, in TSNet. The error goes back to the earliest days of libURL. Did you try Dave's suggestion of setting the headers? That sounded promising to me:

Code: Select all

set the httpHeaders to "Connection: close"
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Dropbox Livecode Library

Post by FourthWorld » Tue Sep 06, 2016 7:39 pm

Thanks. One of the things I've loved about "exit to top" in xTalks all these years is that I can handle even the UI parts of generic errors in one place. I've considered removing it to accommodate the conflict with libURL, but if I only return values to the caller than I need to replicate generic error handling throughout all my caller scripts.

Personally, considering how useful "exit to top" is, I'm just considering this a bug for now and will submit a report on it once I get my sample stack done.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Dropbox Livecode Library

Post by trevix » Sat Oct 01, 2016 1:44 pm

Great library. Thanks

Using mobile and trying to upload a file that has spaces on its name, the "%20" space compare on the file name, on the DropBox web site and in the desktop folder of DropBox.
It messes up my name handling of files by LC, when downloading.

Do I have to URLdecode upon reading or there is a way to avoid this (just a mobile thing)?
Still,dragging files with space in the name to dropbox, in the traditional way, doesn't show URL coding.

Thanks
Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Dropbox Livecode Library STOPPED working

Post by trevix » Tue Dec 06, 2016 5:53 pm

Oh Boys...
A few days ago the library stopped working. I connect ok and i get User Info but when I try to list files or folders I always get a "[]" as a return from the "put URL tUrl into tAnswer" of the function phx_DropboxGetFileList.
Do DropBox has been updated and something is changed?
Somebody can check the library and help me out with this?
Thanks

Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Dropbox Livecode Library

Post by Mikey » Tue Dec 06, 2016 6:21 pm

Check your version. Latest is 1.12, I think. I should have the latest on git.

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Dropbox Livecode Library

Post by trevix » Tue Dec 06, 2016 6:30 pm

Yes. I am using v 1.12
I can create a folder or file on dropbox but the search does not work, always returning "[]".
Inside the DBox application there is folder named "templates" and inside this folder there are other folders named "_x_test1","_x_test2",etc
It has been working fine in the last two month using the script:

Code: Select all

on mouseUp
    put empty into field "flAnswer"
    put "templates/" into tPath
    put "_x_" into tSearchString
    put Drop_ListFiles(tPath,tSearchString) into tArray
    if "Err:" is  in tArray or "Nothing Found" is in tArray then
        put tArray into fld "flAnswer"
        exit mouseUp
    end if
    --show it
    set the itemdelimiter to slash
    put empty into tList
    repeat for each line tKey in the keys of tArray
        put last item of tArray[tKey]["path"] & cr after tList
    end repeat
    put tList into fld "flAnswer"
end mouseUp
but suddenly the search does not work anymore, not even with different naming.
Any clue?
Thanks
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

trevix
Posts: 960
Joined: Sat Feb 24, 2007 11:25 pm
Location: Italy
Contact:

Re: Dropbox Livecode Library

Post by trevix » Tue Dec 06, 2016 8:03 pm

Since DropBox API v1 is now deprecated, I wonder if I should start over using the Gerard McCarthy Library (http://livecodeshare.runrev.com/stack/794/DropboxAPI_2).
How easy will that be (get files and folders list, create files and folders).
And will I be able to grant access to users of my App, as I was doing with V1?
Any one experimenting with it?

Trevix
Trevix
OSX 14.3.1 xCode 15 LC 10 DP7 iOS 15> Android 7>

Post Reply

Return to “Announcements”