Repository navigation
fix(download): parse byte-progress events with action.file shape - #375
Merged
Merged
Conversation
git annex --json-progress nests file/key/command under `action` for byte-progress events; the parser only checked top-level `parsed.file`. Result: inFlight never populated, every ok credited 0 bytes, bar pinned at 0% while files counter advanced (e.g. `0% 134/181 files`).
Update GitAnnexProgressLine in both progress.ts and git-annex.ts to type `action` as {command,file,key} object, and read the file path from `parsed.file ?? parsed.action?.file` for both event shapes.
Migrate progress tests to emit the real git-annex shape via progressEvent/completionEvent helpers; add a regression test covering byte-progress with file nested under action.
Verified live against nm000114: bar climbs 0% to 100%, 181/181 files, 812.2 MB matches precount.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR375Version: 🤖 Updated on each push. |
5 of 7 tasks
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
0% 134/181 fileswhile bytes never credited.git annex get --json --json-progressnestsfile/key/commandunderactionfor in-flight events; the parser only read top-levelparsed.file, soinFlightwas never populated, everyokcredited 0 bytes, and the bar stayed at 0% while file count advanced.{file: "a", "byte-progress": ...}) that git-annex never emits.Changes
src/lib/progress.ts: typeactionas{command?, file?, key?}object; read event file asparsed.file ?? parsed.action?.filefor both byte-progress and completion events.src/lib/git-annex.ts: align the duplicateGitAnnexProgressLineinterface so the two structurally match (TypeScript was rejecting cross-module assignment otherwise).test/progress.test.ts: migrate existing tests to emit the real git-annex shape viaprogressEvent()/completionEvent()helpers; add a regression test for the nested-action.filebyte-progress shape.Test plan
bun test test/progress.test.ts test/git-annex-precount.test.ts— 15/15 passbun run buildcleanbunx tsc --noEmitcleannm000114(812 MB, 181 files): bar climbs monotonically 0% → 98% → 99% → 100%, file count 0/181 → 181/181, bytes match precount (812.2 MB / 812.2 MB), final summary181 files downloaded | 812.2 MB | 18.1 MB/s.Closes #346.