GCalendarSync v0.2 Fix

This is going to sound a little presumptuous, but it looks like something Google is doing changed last night and broke their code library for their API.

Download installer cab (updated 12/25/06)

What happened?
In the gauthrequest.cs file, provided by Google, lines 408-9 look like this

// check the content type, it must be text
if (!response.ContentType.Equals(HttpFormPost.ContentType))

and this was working until last night. In this case HttpFormPost.ContentType = “text/plain”. Problem appears that now, the response.ContentType of the authrequest is being returned as “text/plain; charset=utf-8″. So that .Equals conditional no longer does the right thing, thus the authentication breaks.

To fix, I change line 409 to

...ContentType.StartsWith(HttpFormPost...

Now all is well again. Re-install and give it a go. I guess this is going to be standard for interfacing with a “beta” Google API. And we’ll just have to get used to it…


5 Responses to “GCalendarSync v0.2 Fix”

  • Jon Angliss Says:

    I decided to give this app a quick whirl on my Motorola Q9h (WM6), and realized there were a number of todo items I ran into almost immediately. For example, reoccurances is the first one. At least I think I saw it on your todo list somewhere.

    A small bug I hit, but cannot entirely explain. My phone is set with the time zone GMT -6, but when the app started, I thought I saw it said GMT-5. Then when it went to sync, it seemed to decide that all my events had been recorded with the timestamp in GMT-5, so added 5 hours. So my events that were at 10pm CST (Gym), were now at 3am the next day (whilst I’m usually awake, I don’t fancy hitting the gym at 3am).

    I also noticed it didn’t import any reoccuring events, such as my reminders to pay my credit card on the 16th of every month. I’m assuming that has to do with the reoccruances thing on the todo list.

    A handy feature would be a menu item to force the sync to re-run. I know you can do it by going through, telling it to select the calendar, and saving, but adding an additional option to force sync now would be excellent.

  • Michelle Says:

    Fantastic, it works great! Thanks!

  • theGooley Says:

    [quote comment="29"]
    After the next sync, your app synced them a day earlier than they should be, for example, in Google Calendar I had an all-day event on 1/11/2007, your app put it on 1/10/2007. Same goes with all 12 all-day events I put in.[/quote]

    I just fixed this bug and replaced the installer, please download it and try again. It should correct itself when you do a sync (it will fix the dates on those 12 events it imported onto the wrong day).

    This release also makes it so the “FAILED” error message shows the real error to make it easier for people to report problems.

  • Michelle Says:

    (reposted from the other blog).

    A bug I found tonight:

    The initial sync was fine, then I added a bunch of all-day events in Google Calendar. After the next sync, your app synced them a day earlier than they should be, for example, in Google Calendar I had an all-day event on 1/11/2007, your app put it on 1/10/2007. Same goes with all 12 all-day events I put in.

  • Michael Says:

    Please change also this one on your Code (around line 136):

    FIND:
    string.Format(“http://www.google.com/calendar/feeds/{0}%40gmail.com/”, txtUsername.Text);

    REPLACE:
    string.Format(“http://www.google.com/calendar/feeds/{0}/”, txtUsername.Text.Replace(“@”, “%40″));

    //Uses email to login like on the GCal login page…

    so it will work for yyy@mydomain.com as good as for xxx@gmail.com
    or check if the username (new email) has an @ on it… if no add gmail.com…

    Contact me if you d’like a conversation….

Leave a Reply