Skip to content

Conversation

@crwood
Copy link
Member

@crwood crwood commented Jan 25, 2019

This PR reinstates a rudimentary, text-based progress-indicator for magic-folder upload/download operations, displaying to the user the total percentage of bytes transferred for a given folder's current syncing operation. Previously, this functionality was disabled due to a series of strange behaviors observed with the magic-folder status API, among them:

  1. Previously-seen items/operations disappearing from the magic-folder status API output (due, as it turns out, to magic-folder imposing a cap of only 20 completed transfers)
  2. Individual transfers showing a percent_done well in excess of "100%" (see Tahoe-LAFS Trac ticket 2954)
  3. The magic-folder upload/download queue briefly adding all known files for a brief period of time (due, apparently, to magic-folder's periodic/10-minute "full scan" queueing up all known files but then removing them shortly after)

All of these behaviors drastically skewed the calculation of overall progress on the Gridsync-side, resulting in a progress indicator that appeared inaccurate at best or completely nonsensical at worst. Accordingly, this PR resolves these three issues by 1) keeping an internal record of known operations rather than trusting the magic-folder queue blindly (thereby allowing items that recently fell off the queue to be retained for the purposes of progress-calculation), 2) artificially capping the percent_done for individual transfers at 100% when calculating overall bytes transferred (thereby preventing the display of overall progress in excess of 100%), and 3) ignoring transfer_progress_updated events that would push the overall transfer progress down to "0%" for a very brief period of time (thereby eliminating the display of short-lived and drastic drops during full scans).

While these workarounds are hackish and not ideal, allowing the user to at least get a overall sense of how far along a given syncing operation is (displayed, in this case, as an overall percentage of bytes transferred) is arguably better than having nothing at all...

Note that, although Gridsync does calculate the approximate time remaining for a given syncing operation, this information is not yet displayed anywhere in the UI (since, with magic-folder, 100 1kb files takes an order of magnitude longer to upload than 1 100kb file, making said time-calculations inaccurate when the sizes of pending files differ drastically -- which is usually the case).

crwood added 11 commits January 20, 2019 20:38
Because the magic-folder status queue will only display the last 20
operations, keep a record of all previously known/observed operations.
This will allow progress calculations to take into account operations
that may have otherwise been dropped from the queue.
A (temporary?) workaround for Tahoe-LAFS ticket #2954 whereby
'percent_done' will sometimes exceed 100%
@crwood crwood merged commit 0f55139 into master Jan 25, 2019
@crwood crwood deleted the 132.sync-progress-indicators branch January 25, 2019 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants