使用drive.file范围提供的更改的预期行为是什么? [英] What is the expected behaviour of the changes feed with drive.file scope?

查看:126
本文介绍了使用drive.file范围提供的更改的预期行为是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的期望是,如果我使用drive.file范围查询Changes Feed,我将只接收对我的应用程序拥有的文件的更改。



然而,在测试中,我看到Feed中的文件与我的应用无关。至少其中一些是与我共享的文件。



任何人都知道这应该如何工作?

解决方案

编辑0



类似或重复的StackOverflow问题b






返回的文件不会针对您的应用。无论您的应用是否创建了这些文件,或者您的应用中的用户是否曾经打开过这些文件,在网络上公开的文件也会被回报。

有一个参数( includeSubscribed )可以过滤掉共享的文档,但这也有点有限(请参阅 检测更改 / b>
$ b


对于需要跟踪文件更改的Google Drive应用程序,重复执行
轮询可能既低效和资源密集型。
Changes Feed提供了一种更有效的方式来检测对所有
文件的更改,包括与用户共享的文件。
供稿
的工作原理是提供当前每个文件的状态,当且仅当
文件自给定变更戳以来已经改变。


这是一个相关的参数来自更改:列表


includeSubscribed 布尔值



是否包含共享文件和用户打开的公共
文件。当设置为false时,该列表将包含
拥有文件以及用户明确添加到$ Drive $中的文件夹的任何共享或公共文件。 (默认值:true)



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?

解决方案

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)

这篇关于使用drive.file范围提供的更改的预期行为是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆