Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-email): Proper error feedback for when there is rate limiting #1735

Open
wants to merge 12 commits into
base: canary
Choose a base branch
from

Conversation

gabrielmfern
Copy link
Collaborator

This PR makes it so that the button gets disabled and starts counting down for
15 seconds until it re-enables to attempt sending again. 15 seconds is not
exactly the time it takes, but it should vary dependning on how quickly the
user was able to send the emails that caused the rate limit.

Since the rate limiting here is being enforced by Vercel on our
https://react.email website, Vercel is the one that gives the full HTTP
response to the request when it is rate limited. The problem that this caused
is that the CORS headers were missing in said response, causing the fetch on
the browser to throw a NetworkError and making the response body unaccessible.

The way I went about fixing this temporarily, while we wait for Vercel's
support, was to make the actual fetch to https://react.email inside a server
could actually give the proper treatment to the 429 error code.
action so that the missing CORS headers would not cause a NetworkError and we

@gabrielmfern gabrielmfern added App: Preview Package: react-email This is the CLI we generally use as just `email` on the temrinal. labels Oct 15, 2024
@gabrielmfern gabrielmfern self-assigned this Oct 15, 2024
Copy link

changeset-bot bot commented Oct 15, 2024

🦋 Changeset detected

Latest commit: 778a6bb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-email Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-email ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 3:47pm
react-email-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 3:47pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: Preview Package: react-email This is the CLI we generally use as just `email` on the temrinal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant