feat: Pass abort signal to fetch in email validation provider#24289
Conversation
- Update IEmailValidationProviderService interface to accept optional signal parameter - Pass signal through to fetch call in ZeroBounceEmailValidationProviderService - Wire signal from AbortController in EmailValidationService to provider This prevents network requests from continuing after timeout, avoiding resource leaks. Addresses review comment from Udit-takkar on PR #24196 Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Rename parameter from 'signal' to 'abortSignal' to clearly convey it's for aborting fetch requests - Update interface, implementation, and call site - Update tests to match new object parameter syntax Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
45f007d
into
10-01-feat_zero-bounce-email-validation
What does this PR do?
This PR addresses the GitHub comment from @Udit-takkar on PR #24196 by implementing an abort mechanism for email validation requests. The changes ensure that network requests to the ZeroBounce API can be properly cancelled when the timeout is reached, preventing resource leaks.
Key Changes:
IEmailValidationProviderServiceinterface to accept an object parameter{request, abortSignal}instead of separate argumentsZeroBounceEmailValidationProviderServiceto pass theAbortSignalto the fetch callEmailValidationServiceto provide the abort signal when calling the providersignaltoabortSignalfor clarityLink to Devin run: https://app.devin.ai/sessions/c45ece61f03b45a39e358c8be7acf0d4
Requested by: @hariombalhara
Visual Demo (For contributors especially)
N/A - This is an internal API change with no visual components.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Environment Setup:
ZEROBOUNCE_API_KEYenvironment variable for integration testingKey Test Scenarios:
Testing Commands:
Checklist
IEmailValidationProviderServicein the codebasevalidateEmailmethod that might have been missedabortSignalparameter works when not providedTechnical Details:
{request, abortSignal}is more extensible than separate argumentssignaltoabortSignalfor clarity about its purpose with fetch requests