feat: Task-based download waiting and safe artifact saving - #87
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 938f83619b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96fb4dda20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Event waiters retained unrelated protocol events for their subscribed channel. A waiter using `timeout: :infinity` could accumulate those messages indefinitely. Discard unrelated events and check the original deadline before receiving again, so queued traffic cannot postpone an expired timeout. Add regression coverage for mailbox draining, independent subscribers, and timeout enforcement, plus module documentation and a changelog entry. Addresses the [review comment on #87](#87 (comment)). ## Validation - Both new regression tests failed before the fix and pass afterward. - `mix check`: formatting, Credo, compilation, Dialyzer, and all 211 tests passed. - All 211 tests passed over WebSocket using a local Playwright server; Docker was unavailable for the container-based runner. - `mix docs --warnings-as-errors` passed.
Adds download listeners that can be armed before an action and awaited afterward, with download metadata and file saving over local and WebSocket connections.
Supersedes #39.
Changes
Page.expect_download/2andPage.await_download/1, with optional predicates on download metadata.Download.from_event/2,save_as/3, anddelete/2. Saving preserves the source artifact so other readers can use it.Compatibility
:infinitydisables timeouts;0means no waiting. Zero-timeout protocol commands fail without being sent, while frame URL/load-state waits check recorded state once. Migration guidance is inCHANGELOG.md.:infinityhandling in frame waits and keyboard actions. Keyboard delays cannot extend a zero timeout.Validation
mix check: 209 tests passed, including formatting, Credo, compilation, and Dialyzer checks. The full suite also passed with the original failing CI seed (87788) and concurrency (8).mix docs --warnings-as-errorspassed.