question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calendar API NextSyncToken always empty

See original GitHub issue

I am using a combination of NextSyncToken and NextPageToken.

PageToken seems to work perfectly, but NextSyncToken is empty all the time? See code below:

     Events events;
        String pageToken = null;
        do
        {
            request.PageToken = pageToken;
            events = request.Execute();


            Console.WriteLine(events.Items.Count);
            if (events.Items != null && events.Items.Count > 0)
            {
                foreach (var eventItem in events.Items)
                {
                    string when = eventItem.Start.DateTime.ToString();
                    if (String.IsNullOrEmpty(when))
                    {
                        when = eventItem.Start.Date;
                    }

                }
            }
            else
            {
                Console.WriteLine("No upcoming events found.");
            }
            pageToken = events.NextPageToken;

        } while (events.NextPageToken != null);



        Console.WriteLine("synch token " + events.NextSyncToken);
        Console.WriteLine("page token " + events.NextPageToken);

The expected behavior is that the synctoken is on the last page however it is null.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5

github_iconTop GitHub Comments

5reactions
ganySAcommented, Oct 10, 2015

Hi

I have managed to find out why. It seems synch token is broken when using the following option:

        EventsResource.ListRequest request = service.Events.List("primary");
        request.TimeMin = DateTime.Now;
        request.ShowDeleted = true;
        request.SingleEvents = true;
        request.MaxResults = 100;

–> BREAKS --> request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;

2reactions
eric-burelcommented, Nov 2, 2017

Why is this closed ? Using the orderBy param also breaks js client, but I can’t find any documentation about this. If the nextSyncToken is not provided on purpose, this behaviour should at least be clearly documented in the relevant docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nextSyncToken is always empty in the list responce
The items are always empty for all the events: https://www.screencast.com/t/hzHck7a8d . I need to get all the event's occurrences.
Read more >
Synchronize resources efficiently | Google Calendar
This guide describes how to implement "incremental synchronization" of calendar data. Using this method, you can keep data for all calendar collections in ......
Read more >
Events-List started returning 410 when using updatedMin ...
Code was working great, until two days ago, where in some calendars I started receiving 410 response when using updatedMin.
Read more >
Google Calendar API in Python | List All Calendars - YouTube
In this Google Calendar API in Python tutorial, I will be covering how to use Calendar().List() method to list all the calendars in...
Read more >
calendar
Package calendar provides access to the Calendar API. ... By default, fields with // empty or default values are omitted from API requests....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found