Open xybu opened 7 years ago
Will use webhook event to trigger delta update.
Update: view.delta
(https://dev.onedrive.com/items/view_delta.htm) provides good way to obtain a snapshot of metadata of remote repo items, but the problem is that those information is not reliable -- for example, the size field -- so we have to keep a local database anyway. For now webhook update may just trigger a deep merge. We can further optimize the subroutines of deep merge to make it faster.
Outstanding issues with webhooks in SDK:
Error with SubscriptionRequest.update()
(https://github.com/OneDrive/onedrive-sdk-python/issues/95): workaround by patching the SDK.
No available method in SDK to create subscriptions (https://github.com/OneDrive/onedrive-sdk-python/issues/94): workaround by creating the API call using existing SDK classes.
hi! any chance you could share the code for the workarounds please?
There are a few ways to achieve this:
By checking
view.recent
API. I'm under an impression that it only lists document files. Need to double check. Also there's a bug in SDK at https://github.com/OneDrive/onedrive-sdk-python/issues/92.By using webhooks (https://dev.onedrive.com/webhooks/webhooks.htm). The official SDK does not implement it. What if the client is not reachable from OneDrive server (e.g., client behind NAT)?
By checking the delta pages
view.delta
on all directories (https://dev.onedrive.com/items/view_delta.htm). Basically a faster polling.