GDrive and OneDrive have stopped working

Some of my user reported that they cant access gdrive and onedrive anymore, so I tried it and I too have the same issue. Other like DropBox are working fine.

CloudBase.pas line 3803
Call: jv := TJSONOBject.ParseJSONValue(UTF8ToString(FixupJSON(sa)));
Never returns

OneDrive popup an Auth screen which is empty, so there's no way to authenticate.

OneDrive works again.

The Radio Button on the API settings page for Mobile/Desktop application suddenly was set to NO, but was YES for at least a year...

But GDrive is still stuck in the json code.


I have not been able to reproduce this issue with TAdvGDrive.
Did you see any error messages?
Can you please enable Logging and set LogLevel to llDetail, then provide the automatically generated LOG file so I can further investigate this issue? (The LOG file is placed in the documents folder of your machine by default)

The problem is seen below. The brown/red marked line is the one from where it does never return. I checked the stringlist content, and it has all the items from the gdrive in there.

Possibly one of the items in the JSON contains a specific value that is causing an issue.

Have you tried connecting to different Google Drive accounts?
Are there any files or folders in your drive that contain special characters?

The FixupJSON function is the problem. Without it, it works. The data is about 1MB in size, and contains 23k lines. I am still trying to figure out what happen and will let you know.

Replacing the old FixupJSON function (takes 102 seciond to parse) with this one below (takes a couple of ms only), and all is fine.

function TCloudBase.FixupJSON(Value: ansistring): ansistring;
  x,i: integer;
for i:=1 to length(value) do
    if not ((value=#10) or (value=#13) or (value=#9)) then

Thank you for your suggestion.
We'll investigate if this change can be implemented in a future version of the TMS Cloud Pack.

The FixupJSON function has been improved.
The update will be available with the next release of the TMS Cloud Pack.