commit cab3e31ec1e61f10f8598d0d3c05a08c343d37da
parent 9e36f024d3da55716a15cb39b23c5db02e0f6398
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 17 Oct 2026 12:45:12 -0400
common: rsync 3.5.1-3's progress frames parse again — the count may carry a `B` and the rate may be unscaled bytes (`30,000,000B 99% 1,248,634,666B/s`); a raw rate is scaled back to the older wording (1.16GB/s). Every frame of that rsync failed to parse: no decile line, no task bar, the redraws in the log (channel-storage.spec's `Copying…`); FACTS, CHANGELOG
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
4 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/common/jobs/progressParsers.test.ts b/common/jobs/progressParsers.test.ts
@@ -181,6 +181,47 @@ test("rsync progress: a whole \\r buffer splits into frames", () => {
);
});
+// rsync 3.5.1 as Arch packages it since 2026-10-16 (3.5.1-3): a `B` on the
+// count and a raw, digit-grouped rate — captured off a real copy (three files,
+// 30 MB). Every frame of it failed to parse before, so a media move logged no
+// decile line and fed no task bar.
+const RSYNC_351_CHUNK =
+ "\r 2,048B 99% 0B/s 0:00:00 (xfr#1, to-chk=1/4)" +
+ "\r 30,000,000B 99% 1,248,634,666B/s 0:00:00 (xfr#1, to-chk=0/5)" +
+ "\r 30,002,050B 100% 1,248,720,083B/s 0:00:00 (xfr#3, to-chk=0/5)\n";
+
+test("rsync progress: rsync 3.5.1's B suffix and raw rate parse", () => {
+ const frames = RSYNC_351_CHUNK.split(/[\r\n]+/)
+ .filter((l) => l.trim() !== "")
+ .map(parseRsyncProgress);
+ assert.equal(frames.length, 3);
+ assert.deepEqual(
+ frames.map((f) => f?.bytes),
+ [2_048, 30_000_000, 30_002_050],
+ );
+ assert.deepEqual(
+ frames.map((f) => f?.percent),
+ [99, 99, 100],
+ );
+ // The raw rate is scaled to the older rsync's wording (units of 1024).
+ assert.deepEqual(
+ frames.map((f) => f?.rate),
+ ["0.00kB/s", "1.16GB/s", "1.16GB/s"],
+ );
+ // --no-human-readable drops the grouping and keeps the B.
+ assert.deepEqual(
+ parseRsyncProgress(" 30002048B 99% 1362240000B/s 0:00:07"),
+ { bytes: 30_002_048, percent: 99, rate: "1.27GB/s", etaSeconds: 7 },
+ );
+ // A space before the unit is accepted too.
+ assert.equal(parseRsyncProgress(" 2,048 B 99% 0.00kB/s 0:00:00")?.bytes, 2_048);
+ // The sent/received summary is still not a frame.
+ assert.equal(
+ parseRsyncProgress("sent 30,005,123 bytes received 103 bytes 60,010,452.00 bytes/sec"),
+ null,
+ );
+});
+
test("rsync progress: an hours-long ETA is seconds, not a string", () => {
assert.equal(
parseRsyncProgress(" 1,000 10% 1.00MB/s 2:03:04")?.etaSeconds,
diff --git a/common/jobs/progressParsers.ts b/common/jobs/progressParsers.ts
@@ -492,8 +492,35 @@ export type RsyncProgress = {
etaSeconds: number;
};
+// THE BYTE COUNT MAY CARRY A `B`, AND THE RATE MAY BE RAW BYTES. rsync 3.5.1 as
+// Arch packages it since 2026-10-16 (3.5.1-3) writes the same frame as
+//
+// 30,000,000B 99% 1,248,634,666B/s 0:00:00 (xfr#1, to-chk=0/5)
+//
+// — a unit on the count and an unscaled, digit-grouped rate. The regex took
+// "digits, whitespace, percent" literally, so every frame of that rsync failed
+// to parse: no decile line, no task bar, and the thousands of redraws went into
+// the job log verbatim. Both shapes are accepted; a raw rate is scaled back to
+// the wording the older rsync used, so the detail line reads the same.
const RSYNC_PROGRESS_RE =
- /^\s*([\d,._ ]*\d)\s+(\d{1,3})%\s+(\S+)\s+(\d+):([0-5]?\d):([0-5]?\d)/;
+ /^\s*([\d,._ ]*\d) ?B?\s+(\d{1,3})%\s+(\S+)\s+(\d+):([0-5]?\d):([0-5]?\d)/;
+
+// "1,248,634,666B/s" (digits and grouping only, then B/s) → "1.16GB/s". Anything
+// else — "1.03GB/s", "0.00kB/s" — is already scaled and is returned verbatim.
+function normaliseRsyncRate(rate: string): string {
+ const m = rate.match(/^([\d,._]+)B\/s$/);
+ if (!m) return rate;
+ const n = Number.parseInt(m[1].replace(/\D/g, ""), 10);
+ if (!Number.isFinite(n)) return rate;
+ const units = ["kB", "MB", "GB", "TB"];
+ let v = n / 1024;
+ let i = 0;
+ while (v >= 1024 && i < units.length - 1) {
+ v /= 1024;
+ i++;
+ }
+ return `${v.toFixed(2)}${units[i]}/s`;
+}
export function parseRsyncProgress(line: string): RsyncProgress | null {
const m = line.match(RSYNC_PROGRESS_RE);
@@ -507,7 +534,7 @@ export function parseRsyncProgress(line: string): RsyncProgress | null {
Number.parseInt(m[4], 10) * 3600 +
Number.parseInt(m[5], 10) * 60 +
Number.parseInt(m[6], 10);
- return { bytes, percent, rate: m[3], etaSeconds };
+ return { bytes, percent, rate: normaliseRsyncRate(m[3]), etaSeconds };
}
// Is this line ONLY a progress redraw? Used by the relocate controller to keep
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -1,6 +1,7 @@
# Changelog
## [Unreleased]
+- **A media move says how far its copy got again with the newer rsync.** rsync 3.5.1 as packaged since mid-October writes its progress with a unit on the byte count and an unscaled rate, which the move did not read: the job showed no progress bar and no "Copying… · N % ·" lines, and the log filled with rsync's raw redraws. Both forms are read now, and the rate reads as before (for example 1.16GB/s). Needs a restart of the editor.
- **A full download from Odysee's stored media URL survives a dropped connection.** When the connection to the file's server drops mid-file (`fetch failed`, a reset, a timeout, a body cut short), the same download now checks what came down, pauses 45 seconds, opens the video's page again and goes on from the last clean byte — it no longer ends the job. Each one is in the job log as "Connection dropped at <bytes> — reopening the page and resuming (k of 6)". After six drops in a row with no progress the download stops and keeps what it has for the next run, as before. A refusal that follows bytes the server served is handled the same way; a refusal straight after the page was opened still stops at once. A continuation is not a new file: it does not wait the 20-minute rest between files, and the whole run is still one attempt on the video's record (one of the two full-audio attempts before a salvage). The attempt records how many continuations it took. Needs a restart of the editor.
- **Partial transcripts wait for the full audio first.** A video whose download completed with malformed audio (a corrupt full source) used to get a salvage transcript, with gaps, as soon as anyone pressed Transcribe. When the video's record stores an Odysee media URL, Transcribe and the corrupt full sources' Retry now download from that URL first, up to two times and 20 minutes apart. The salvage transcript is made only if neither download comes back clean. A clean download is transcribed in full. **Salvage** (`transcribe-one {"salvage": true}`) still makes the partial transcript at once. The channel's line shows **awaiting full audio** for the videos still waiting, and the salvaged transcripts read **salvaged — full audio attempts: n**. The video page's salvaged notice gives the same count, the video list marks a salvaged transcript amber, and the MCP's `get_transcripts` marks it partial as `get_transcript` already did.
- **find-copy no longer reports a Wayback copy that has no video.** The Wayback Machine's video index can list a video whose file it does not hold, and such a copy then failed to fetch (404). A copy now counts as found only when one of its video files answers a request for its first bytes. Otherwise the lookup says **page captured, no video**, archive.org is tried next, and the video is recorded as none found, not as a copy that failed. Looking up copies for an article's cited windows now records none found too, as the channel and site lookup already did.
diff --git a/plans/FACTS.md b/plans/FACTS.md
@@ -4951,6 +4951,14 @@ Six things, in the order they were built. Trust these over re-deriving them.
reads one frame — `30,000,000 85% 1.03GB/s 0:00:03 (xfr#1, to-chk=1/3)` —
into `{bytes, percent, rate, etaSeconds}`. Grouping separators are stripped
with `\D`, not assumed to be commas.
+- **rsync 3.5.1-3 (Arch, installed here 2026-10-16) writes a `B` on the count and
+ an UNSCALED rate**: `30,000,000B 99% 1,248,634,666B/s 0:00:00 (xfr#1, …)`
+ (`--no-human-readable`: `30002048B 99% 1362240000B/s`). The parser accepts
+ an optional ` ?B` after the count, and a rate of digits-and-grouping then
+ `B/s` is scaled back to the older wording (units of 1024: `1.16GB/s`,
+ `0.00kB/s`); a rate already scaled is verbatim. Before release 32 R11 every
+ frame of that rsync failed to parse — no decile line, no task bar, the
+ redraws in the log verbatim (channel-storage.spec's `Copying…` assertion).
- **The fraction divides by the MEASURED tree, not by rsync's percentage.** Under
incremental recursion (the default) rsync's percentage is of what it has
enumerated so far and walks BACKWARDS. The controller already measured the