pinoyyid
pinoyyid

Reputation: 22306

What is the expected behaviour of the changes feed with drive.file scope?

My expectation is that if I query the Changes Feed with a scope of drive.file, I will only receive changes to files owned by my application.

However, in testing that I have done, I am seeing files in the feed that have nothing to do with my app. At least some of them are files that have been shared with me.

Anybody know exactly how this is supposed to work?

Upvotes: 3

Views: 172

Answers (3)

edivânia
edivânia

Reputation: 1

Just updating the question, I tested it and this no longer happens in the Google Drive API's v3 version.

Upvotes: 0

JSuar
JSuar

Reputation: 21091

Edit 0

Similar or duplicate StackOverflow questions


The files returned will not be specific to your app. Files that are "public on the web" are also reported back, regardless of whether or not your app created them or they were ever opened by the user in your app.

There is a parameter (includeSubscribed) that will filter out shared docs but this is also a bit limited (see below).

From Detect Changes:

For Google Drive apps that need to keep track of changes to files, polling repeatedly can be both inefficient and resource-intensive. The Changes feed provides a more efficient way to detect changes to all files, including those that have been shared with a user. The feed works by providing the current state of each file, if and only if the file has changed since the given changestamp.

Here is a relevant parameter from Changes:list.

includeSubscribed boolean

Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive. (Default: true)

Upvotes: 1

Siva Tumma
Siva Tumma

Reputation: 1701

Scope(https://www.googleapis.com/auth/drive.file)
Meaning(Per-file access to files created or opened by the app)

The scope https://www.googleapis.com/auth/drive.file strikes this balance in a practical way. Presumably, users only open or create a file with an app that they trust, for reasons they understand.

But though, to your point, please refer to this q&a.

Upvotes: 0

Related Questions