Skip to content

Show received files during owly test-card - #143

Open
sneurlax wants to merge 1 commit into
t4t5:mainfrom
sneurlax:fix/test-card-receive-feedback
Open

sneurlax wants to merge 1 commit into
t4t5:mainfrom
sneurlax:fix/test-card-receive-feedback

Conversation

@sneurlax

Copy link
Copy Markdown

owly test-card starts owly receive --accept, but previously sent both of the receiver's output streams to /dev/null. A tester therefore received no confirmation that an incoming transfer had landed in the temporary directory before being asked whether it arrived.

This pipes and monitors the receiver's stdout and stderr so test-card can:

  • print received paths as transfers finish;
  • include the file size when the path names a regular file;
  • show already received files immediately before the result prompt;
  • surface relevant receiver failures while filtering routine noise;
  • redraw an active interactive prompt cleanly when an asynchronous message arrives.

Sender-controlled paths and messages remain escaped before display.

Tests cover path and file-size formatting, control-character escaping, stderr filtering, and capture of output from a live child process.

Test:

`cargo test -p owly-cli test_card`

`owly test-card` spawned `owly receive --accept` with stdout and stderr sent to `/dev/null`, so testers got no confirmation when an incoming transfer landed in `/tmp/owly-test-<time>` before seeing the "Did it arrive?" prompt.

Pipe the child receiver's stdout and stderr through `ReceiverMonitor`, surface received paths (with file size, escaped with `{:?}` per SEC-4) and receiver failure lines while redrawing any active prompt cleanly, and list any already-received files right before asking whether the photo arrived.
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.

1 participant