Skip to content

fix: add async audience aliases#230

Open
mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:fix/audiences-async-alias
Open

fix: add async audience aliases#230
mayankbohradev wants to merge 1 commit into
resend:mainfrom
mayankbohradev:fix/audiences-async-alias

Conversation

@mayankbohradev

@mayankbohradev mayankbohradev commented Jul 7, 2026

Copy link
Copy Markdown

What

  • Adds async methods to the deprecated Audiences alias so it mirrors Segments async support.
  • Covers create/get/list/remove async alias behavior and deprecation warnings.

Why

  • Audiences delegates sync calls to Segments, but the async alias methods were missing. Users on the deprecated alias could not use the async SDK surface consistently.

Testing

  • tox -e py -- tests/audiences_async_test.py
  • tox -e py
  • tox -e mypy
  • black --check resend/audiences/_audiences.py tests/audiences_async_test.py
  • isort --check-only resend/audiences/_audiences.py tests/audiences_async_test.py

Note

  • Local tox -e lint is blocked on this machine because flake8<5 is incompatible with the available Python 3.12/3.14 entry-point API. CI runs lint on Python 3.8-3.11 per .github/workflows/ci.yaml.

Summary by cubic

Adds async support to the deprecated Audiences alias to match Segments. Users can now call create/get/list/remove asynchronously with deprecation warnings.

  • Bug Fixes
    • Added create_async, get_async, list_async, and remove_async on resend.Audiences, delegating to Segments async methods.
    • Each async call emits a DeprecationWarning to guide migration to Segments.
    • Added tests for success and NoContentError paths.

Written for commit 717886e. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Confidence score: 5/5

  • tests/audiences_async_test.py adds test_should_* method names that conflict with the repo’s test-naming convention; merging as-is mainly risks style inconsistency and a small hit to test-suite readability/maintainability rather than runtime behavior. This PR is safe to merge, but renaming the new tests to the project’s declarative/action-oriented pattern would fully align it before merging.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/audiences_async_test.py Outdated
@mayankbohradev mayankbohradev force-pushed the fix/audiences-async-alias branch from 87f65ed to 717886e Compare July 7, 2026 06:12
@mayankbohradev

Copy link
Copy Markdown
Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@mayankbohradev I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Jul 7, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Caution

This repository is currently using the Sentry GitHub App to receive Codecov PR comments. This integration will be deprecated on July 8, 2026. Please install the Codecov GitHub App to continue receiving coverage reports on your pull requests.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.65%. Comparing base (7f1acd0) to head (717886e).
⚠️ Report is 180 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #230       +/-   ##
===========================================
+ Coverage   82.66%   95.65%   +12.99%     
===========================================
  Files           4       58       +54     
  Lines          75     3109     +3034     
===========================================
+ Hits           62     2974     +2912     
- Misses         13      135      +122     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants