Google Calendar sync stops working after an hour

SupportGoogle Calendar sync stops working after an hour
Ryan James asked 6 years ago
Google calendar syncing appears to stop working after an hour of authorising the token. This happens consistently with the following steps:
  1. Install the plugin and authorise Easy Appointments to make adjustments to Google Calendar.
  2. Make some bookings via the booking form... these bookings appear in the calendar.
  3. Wait 2 hours.
  4. Make another booking...
The recent created booking does not appear in Google Calendar! I've been able to reproduce this bug multiple times.

The log file simply shows the following lines: [2018-07-03 14:16:02.882972] [info] Sync started
[2018-07-03 14:16:02.883162] [debug] Calendars for sync
primary: array(
'location' => '*',
'service' => '*',
'worker' => '*',
)
[2018-07-03 14:16:02.883310] [info] Syncing events for Calendar: primary
[2018-07-03 14:16:02.883387] [info] Sync event within next   It doesn't recognise that a new booking has been made and is needed to be synced. How should I fix this?
3 Answers
siobhan_tomlin Staff answered 6 years ago
Upon further investigation.... When the bookings fail to sync with Google Calendar, if i go into Wordpress and click the "Add Calendar" button in the "Advanced Calendars sync" section, i see a pop up with the message: "Check authorisation token". So, clearly the auth token has somehow become invalid. If i delete the token and re-authorise it, everything works properly again. Why is this failing? This really should work properly - it's the only reason I bought the plugin in the first place!
siobhan_tomlin Staff replied 6 years ago

I checked again, the message is actually “Please check your token”, not “Check authorisation token”. This happens every hour or so, what gives!? My client is going insane!

Nikola Loncar Staff answered 6 years ago
Hi, sorry for waiting for the response. You have short term token instead of long one so it's not usable after 2 hours. Solution is to delete the token and authorize again app. Key thing is to see Google Prompt Dialog that will ask you are you allow App access to your calendar. If you don't see that dialog please repeat whole thing by deleting token and doing authorization again. Best regards, Nikola
siobhan_tomlin Staff replied 6 years ago

Thanks for the reply. How do I get a long term token? I can’t find any mention of a short term token in the Google docs.

I have always deleted the token and authorised the app, but it still always fails after a couple of hours. What am I doing wrong?

Nikola Loncar Staff answered 6 years ago
Hi, delete token and detach tha App from your Google account that was connected to. Then try again. Also keep in mind that changing the password in Google account will invalidate all associated tokens. Best regards, Nikola