Repository navigation
Stream media downloads and add --url and --from-event - #10
Conversation
|
Warning Review limit reached
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 75 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (5)
Comment |
|
@codex review |
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: ed284f632e
ℹ️ 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".
- media download streams through a temp file (SDK downloadStream/writeStreamToFile), follows storage redirects without the API key, enforces --max-bytes while streaming - --url prints the short-lived signed link with a stderr warning - --from-event decrypts WhatsApp CDN media from a stored webhook (no credential) - map PolymorfaMediaIntegrityError to a non-retryable validation error - pin @polymorfa/sdk to polymorfa/sdks@5a7245d (unmerged codex/media-download)
3d850f3 to
d836d96
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
polymorfa media downloadstreams attachments to disk and adds--urland--from-event.media download <id> --output <path>retrieves metadata, then streams the response into a private temporary sibling file. The default 100 MiB limit applies to declared sizes and arriving bytes;--max-byteschanges it. An existing destination is preserved unless--forceis supplied, and handled failures attempt to remove the temporary file.--urlprints the short-lived signed storage link and warns on stderr. If the API streams the file instead, the command exits 2 and directs the user to--output.--from-event <file>reads a stored message webhook or its payload, downloads from the WhatsApp CDN, and verifies and decrypts the attachment without a Polymorfa credential.--timeoutaborts the actual fetch. Invalid or missing event files and integrity failures exit 2; errors do not print the media descriptor.The SDK dependency is the published npm version
@polymorfa/sdk@0.1.0-dev.20260922102711, pinned in bothpackage.jsonandpackage-lock.json. The CLI uses the installedMessagingClient.media.downloadStream,downloadUrl, and@polymorfa/sdk/nodehelpers. The previous unmerged SDK Git pin is no longer the dependency.Six-part assessment
0.1.0-dev.20260922102711; the installed artifact supplies all three download helpers and propagates the abort signal to the CDN fetch. This PR does not change the dependency manifest or require another SDK change.README.mddocuments the modes. The existing dependency guide records the npm pin. Prepared internal launch copy adds all download modes and restrictions to monorepodocs/guides/communicate/api/download-linked-media.mdx. Publish that copy alongside the CLI release; add a changelog entry only for confirmed customer availability.Verification
Verified CLI head:
d836d96cad97a766b1352ce4690884b9faf61845.Exact-head CI completed successfully. The checked-in workflow runs
npm ciandnpm run verifyon Node 22; verify includes formatting, lint, typecheck, tests, build, package dry-run, and production dependency audit.Independent exact-head archive: offline dependency installation, build, and all 18 tests in
test/commands/media.test.tspassed on Node 24.15.0. Coverage includes size limits, redirected requests without credentials, signed URLs, overwrite protection, integrity failure cleanup, missing-file exit 2, and a fetch that only rejects when its timeout signal aborts.The installed npm SDK's download path was traced through the Node file helper to its actual fetch signal.
Prepared media documentation examples match the compiled command help at this head.
Not exercised: a live API storage redirect, a real WhatsApp CDN object, or an installed released CLI. Publishing the prepared customer documentation alongside the CLI release and completing live release acceptance remain outstanding.