feat: add Redis-backed SMTP rate limiting, email caching, and provide…#51
feat: add Redis-backed SMTP rate limiting, email caching, and provide…#51revanth127 wants to merge 1 commit into
Conversation
|
@revanth127 is attempting to deploy a commit to the Vaibhav Sharma's projects Team on Vercel. A member of the Team first needs to authorize it. |
sharmavaibhav31
left a comment
There was a problem hiding this comment.
Thanks for the PR — the Redis-backed direction is good overall, especially the move away from process-local rate limiting.
However, while reviewing verifier.py, I found several structural and correctness issues that need cleanup before merge:
_resolve_mx()currently appears malformed/mixed with verification flow logicemailis referenced inside_resolve_mx()without being defined in scope- rate-limit rollback using
DECRafter limit exceed is race-prone under concurrency - Redis/cache concerns and SMTP verification flow are too tightly coupled right now
- some fallback/error-handling paths need hardening
- input normalization/sanitization for cache + rate-limit keys should be stricter
- async execution/timeouts around SMTP verification need another pass
- there are a few maintainability concerns where large sections feel over-abstracted compared to the current codebase style
Please do a focused cleanup/refactor pass on verifier.py before further review.
Priority should be:
- correctness
- concurrency safety
- Redis failure handling
- clean separation of responsibilities
- consistency with existing project architecture/style
Also please test:
- Redis unavailable scenarios
- concurrent verification attempts
- cache hit/miss behavior
- rate-limit expiration/reset behavior
- malformed email input handling
Once those are cleaned up, I’ll continue with a deeper review.
Thanks for the detailed review. I’ll go through the issues you pointed out, research the best approach for the concurrency and Redis handling parts, and do my best to clean up/refactor verifier.py accordingly before the next review. |
5c16767 to
b665b09
Compare
|
Quick update — after spending more time on the verifier refactor and digging deeper into the issues from the review, I realized the async concurrency, Redis coordination, and SMTP reliability parts are currently beyond my experience level to complete confidently to the standard the project needs. Rather than keep the PR hanging or continue with unreliable changes, I think it’s better for me to step back from this issue for now. I really appreciate the detailed review and guidance though — I learned a lot while attempting it. Sorry for the inconvenience, and thanks again for the feedback. |
|
Thanks for the honest update, Revanth. Stepping back was definitely the right call unless you wanted to be personally responsible for Redis exploding and rate limits completely losing their minds across our workers. On paper, your blueprint was solid:
However, executing it safely means rewriting the whole thing to survive:
Keeping the PR open for now as a draft/reference, but we aren't merging this into main until it gets a heavy architectural cleanup. Thanks for doing the heavy lifting on the research though! |
closes #12