Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Note: this is a new PR that addresses a compile-time deprecation warning that caused #1626 to be reverted.
This change adds webhook support to enable real-time syncing of remote updates. It takes advantage of the webhooks functionality provided by Microsoft. This fixes #1620.
How does it work
POST /subscriptions
endpoint.Code changes
onedrive.d
contains the bulk of logic to manage the local web server and to register/renew subscriptions with Microsoft. It is also responsible for processing incoming notification requests. When such requests are received, it sends signals to the main sync loop.main.d
contains the logic to process incoming signals and execute delta sync to fetch updates.cgi.d
from adamdruppe/arsdconfig.d
and also documented.Testing
Unfortunately I could only test this manually with a very straightforward setup: personal OneDrive account with no shared folders. More testing is welcome!
What is next
Currently the public-facing url has to be statically configured. This should work well for most users either with static public IP or with dynamic DNS services. We could consider adding UPnP support to allow dynamic configuration via automatic port forwarding.