Skip to content

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Sep 5, 2025

It reverts most changes that were made in #562, but it doesn't revert the response mocking utilities that it introduced. This might interfere with the implementation in #611.

If we do decide to add this in later on, we can bring it back on another branch and also experiment further with the interface.


Summary by cubic

Reverted the rateLimiting response API to unblock the release. All client methods now return only data and error, with no rate limit metadata.

  • Refactors

    • Removed rate-limiting.ts and header parsing; dropped Response, RateLimit, and retryAfter types.
    • Updated all interfaces to a simple union: { data; error: null } | { data: null; error }.
    • Simplified Resend.fetchRequest error handling; no rate limit extraction.
    • Updated tests to stop asserting rateLimiting, replaced mockErrorResponse with fetchMock.mockOnce, kept mockSuccessResponse, and removed rate limit headers from mocks.
  • Migration

    • Remove any usage of result.rateLimiting.
    • Stop relying on retryAfter on rate_limit_exceeded errors.
    • If tests used rate limit helpers or headers, update them to plain fetchMock.mockOnce with status and content-type.

@gabrielmfern gabrielmfern self-assigned this Sep 5, 2025
@gabrielmfern gabrielmfern requested a review from a team as a code owner September 5, 2025 15:28
Copy link
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 42 files

@gabrielmfern gabrielmfern merged commit 5b639fe into canary Sep 5, 2025
11 checks passed
@gabrielmfern gabrielmfern deleted the revert-rate-limiting-api branch September 5, 2025 17:11
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.

3 participants