I’m developing an app in Python that syncs with Google Drive. When looking for changes to the files I’m using the changes() API call. Unfortunately for some reason I’m getting the same largestChangeId back every time, so I’m getting the same changes back each time. My code is
changeResults = driveRC.client.changes().list(includeDeleted = True, startChangeId = driveRC.changeID).execute()
# Do some stuff
driveRC.changeID= changeResults['largestChangeId']
At the end, changeID is updated from the results of the call, so next time it’s called it should be using the new changeID. But every time I make a changes call, I’m getting the same changeId back from Google that I sent in the call.
The first time it’s called it’s using a change ID I got before with an empty call. Anyone know why this is, or what I’m doing wrong?
Thanks in advance for any help!
The largestChangeId only changes when there is user activity/new changes to report. If you’re getting the same largestChangeId back in repeated calls it just means there are no changes available.
The way you’re calling it, you’ll still get the most recent change since startChangeId is inclusive. You might want to add a +1 to the startChangeId to avoid getting that last change twice.