kelvinRosa / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

"The specified value is not a valid quoted string." being thrown from calendar client on PATCH. #464

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. GET a calendar item from the API using the .Net client
2. Attempt to PATCH the item

What is the expected output? What do you see instead?
I expect the patch to go through, but before the request is even sent an 
exception thrown. Exception detail follows below, and a capture of our GET is 
attached.

What version of the product are you using? 1.8.1.820
What is your operating system? Windows 7
What is your IDE? Visual Studio 2013
What is the .NET framework version? 4.5

Please provide any additional information below.

The Exception Information,
Message: The specified value is not a valid quoted string.
Stack Trace:
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccess(Task task)
   at Microsoft.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Google.Apis.Requests.ClientServiceRequest`1.<ExecuteAsync>d__0.MoveNext() in c:\code\google.com\google-api-dotnet-client\default\Tools\Google.Apis.Release\bin\Debug\output\default\Src\GoogleApis\Apis\Requests\ClientServiceRequest.cs:line 126

Original issue reported on code.google.com by scmcc...@gmail.com on 13 May 2014 at 6:21

Attachments:

GoogleCodeExporter commented 9 years ago
We've found that this can be worked around by setting ETagAction to Ignore on 
the request.

Original comment by scmcc...@gmail.com on 13 May 2014 at 6:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
It's a property on the request object you get back from calling Patch,
before you call one of the execute methods.

Original comment by scmcc...@gmail.com on 14 May 2014 at 11:56

GoogleCodeExporter commented 9 years ago
Take a look in:
http://stackoverflow.com/questions/23649831/updating-calendar-event-giving-error
-the-specified-value-is-not-a-valid-quoted

a possible fix for 1.8.2 will be to try-catch adding etag.

Original comment by pele...@google.com on 14 May 2014 at 3:35

GoogleCodeExporter commented 9 years ago
Another option (maybe combined with what suggested above) is to add \" before 
and \" after. So for etag = 0, we will have the following:
"etag": "\"0\""

That will be added only in case we don't already have it

Original comment by pele...@google.com on 14 May 2014 at 3:38

GoogleCodeExporter commented 9 years ago
Relevant code is available at 
:https://code.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis
/Apis/Requests/ClientServiceRequest.cs#240

Original comment by pele...@google.com on 14 May 2014 at 3:48

GoogleCodeExporter commented 9 years ago
https://codereview.appspot.com/96320045/

Original comment by pele...@google.com on 14 May 2014 at 4:53

GoogleCodeExporter commented 9 years ago

Original comment by pele...@google.com on 15 May 2014 at 10:09