mieweb / wikiGDrive

Wiki for Google Shared Drive
16 stars 5 forks source link

Sync needs to wait for a change or give up after a configurable amount of time. #259

Closed horner closed 2 years ago

horner commented 2 years ago

The Preview window should show a progress (maybe attempts made without a change).

Story:

User is making rapid changes in a document. Pressing Sync every 10s of seconds. Currently, when pressing Sync if there are no changes from google (FOR WHO KNOWS WHY) the same preview is shown.

Proposed Fix:

Subscribe

First subscribe for change notifications https://developers.google.com/drive/api/v3/reference/changes/watch

Retry

If that does not work, implement a retry process:

If an explicit sync returns with no changes, keep retrying every 15 seconds but log retry attempt number.
If retry attempt number exceeds (change_retry_loops) then bail. change_retry_loops default is 15?

Questions: 1) Is there an inexpensive way to check for changes before downloading the ODT?