Skip to content

Fix audit findings: portability, validation, docs, and tests#1

Merged
milkway merged 4 commits into
mainfrom
fix/audit-bugs-and-improvements
Jun 14, 2026
Merged

Fix audit findings: portability, validation, docs, and tests#1
milkway merged 4 commits into
mainfrom
fix/audit-bugs-and-improvements

Conversation

@milkway

@milkway milkway commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Audit of the package surfaced several bugs and improvement opportunities. This PR fixes the actionable ones and adds a test suite. R CMD check --as-cran is clean (0 errors / 0 warnings / 0 package notes — the only remaining notes are local macOS/HTML-Tidy environment artifacts that do not appear on CRAN).

Bug fixes

  • %||% portability — the operator was used by .evo_post() and send_contact() but is only part of base R since 4.4.0, while the package declares R (>= 4.2.0). It is now defined internally, so the package loads on R 4.2–4.3.
  • Recipient number normalizationsend_*() now strip formatting (spaces, dashes, parentheses, leading +) before the request, while passing JIDs (...@g.us) through unchanged. The documented "+55..." form was previously sent verbatim and rejected by the API.
  • .normalize_media() no longer mistakes a typo'd path for base64 — it requires standard padded base64 and emits a path-aware error (with the resolved path) when a file is missing.
  • LICENSE — corrected the copyright holder (it referenced an unrelated package).

Cleanup

  • Removed a dead apikey-redaction branch in the verbose logger (the API key only travels as a header).
  • Unified the API URL across README/DESCRIPTION (evoapicloud.com) and aligned copyright years.
  • Added .Rhistory, .DS_Store, .claude, and build artifacts to .Rbuildignore/.gitignore.

Tests

  • Added a testthat suite covering the offline helpers (jid(), .normalize_media(), .normalize_number(), .compact(), .evo_path(), .assert_scalar_string(), %||%) and the argument-validation guard clauses of the exported functions.

Release hygiene

  • Bumped to 0.1.1 and refreshed Date (0.1.0 is already on CRAN); bumped the hardcoded User-Agent to match.

🤖 Generated with Claude Code

milkway and others added 4 commits June 14, 2026 12:52
Bugs:
- Define %||% internally; it is base R only since 4.4.0 but the package
  declares R (>= 4.2.0), so it failed to load on R 4.2-4.3.
- Normalize recipient `number` in send_*() (strip spaces/dashes/parens/
  leading +), passing JIDs (...@g.us) through unchanged. The documented
  "+55..." form was previously sent verbatim and rejected by the API.
- .normalize_media() no longer treats a mistyped file path as base64;
  it requires padded base64 and gives a path-aware error otherwise.
- Correct LICENSE copyright holder (was an unrelated package).

Cleanup:
- Remove dead apikey-redaction branch in the verbose logger (the API key
  is only ever sent as a header).
- Unify API URL across README/DESCRIPTION (evoapicloud.com); align years.
- Ignore .Rhistory/.DS_Store/.claude and build artifacts in
  .Rbuildignore/.gitignore.

Tests:
- Add a testthat suite for the offline helpers and the argument-
  validation guard clauses.

Release hygiene:
- Bump to 0.1.1 and refresh Date (0.1.0 is already on CRAN).

R CMD check --as-cran: 0 errors, 0 warnings, 0 package notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Runs R CMD check across macOS, Windows and Linux (devel/release/oldrel-1)
on push, PR and manual dispatch. Adds the status badge to the README and
ignores .github in the package build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI is green on Linux (devel/release/oldrel-1), macOS and Windows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@milkway milkway merged commit d2548aa into main Jun 14, 2026
5 checks passed
@milkway milkway deleted the fix/audit-bugs-and-improvements branch June 14, 2026 16:34
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