-
Notifications
You must be signed in to change notification settings - Fork 10.7k
feat: Add async spam check with parallel execution and fake booking redirect #24326
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
base: feat/spam-block-di
Are you sure you want to change the base?
feat: Add async spam check with parallel execution and fake booking redirect #24326
Conversation
…edirect - Create SpamCheckService to manage async spam checking - Start spam check early in handleNewBooking, await before booking creation - Generate fake booking response for blocked emails with all required fields - Add redirect logic in useBookings to handle spam decoy bookings - Create new /booking-successful route to display fake booking data - Spam check runs in parallel with availability loading (zero delay) - Spammers see convincing fake success page via query params Also fix pre-existing lint warnings in useBookings.ts: - Remove unused catch parameter - Convert optional chaining expressions to if statements - Remove eslint-disable comments for non-existent rule Stacked on PR #24040 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 skippedDraft detected. 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 |
The latest updates on your projects. Learn more about Vercel for GitHub. |
- Import and load prismaModule in watchlist container for PrismaClient binding - Fix loggerServiceModule to use synchronous factory (matches prismaModule pattern) - Resolves 'logger.getSubLogger is not a function' error in tests - spam-booking.test.ts now passes successfully Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
…tual implementation Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
…g-successful page Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
57db386
to
eb9900b
Compare
6F85
a>
What does this PR do?
This PR implements async spam checking in the booking flow that runs in parallel with availability loading to avoid delaying legitimate bookings. When an email is detected as spam, it returns a fake booking response and redirects the user to a convincing booking success page.
Key Features:
Implementation:
SpamCheckService
wrapper for async spam checkinghandleNewBooking
, awaits result before booking creation/booking-successful
route for deceptive success pagesThis is a stacked PR on top of #24040 (feat: Add spam blocker DI structure).
Visual Demo
The spam detection is intentionally invisible to users. For blocked emails:
/booking-successful
with query params showing fake booking detailsMandatory Tasks
How should this be tested?
Environment Setup:
Testing Steps:
/[username]/[event-type]
)spam@test.com
/booking-successful
with fake booking detailsCritical Review Areas:
handleNewBooking.ts
lines 1412-1455:email: null
)handleNewBooking.ts
:isSpamDecoy
field handling:useBookings.ts
line 284)Link to Devin run: https://app.devin.ai/sessions/8aaeeecf6dfc45ef90973a7e5249a2aa
Requested by: @hariombalhara
Checklist