refactor: Use sessionStorage instead of localStorage for decoy booking data#24449
refactor: Use sessionStorage instead of localStorage for decoy booking data#24449hariombalhara wants to merge 1 commit intomainfrom
Conversation
…g data - Replace localStorage with sessionStorage for automatic expiration on tab close - Remove timestamp tracking and TTL logic (no longer needed) - Improve privacy by auto-clearing data when browser tab/window closes - Update documentation to reflect sessionStorage behavior This change addresses privacy concerns by ensuring decoy booking data (including attendee email) is automatically removed when the user closes the tab, rather than persisting for 5 minutes or requiring manual cleanup. 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 |
|
Closing to recreate against PR #24326's branch instead of main |
What does this PR do?
This PR creates a new storage utility for decoy booking data, using
sessionStorageinstead oflocalStoragefor improved privacy and automatic cleanup.Context: This is a follow-up improvement to PR #24326 (spam detection feature). This PR isolates the storage mechanism change for easier review.
Key changes:
decoyBookingStore.tswith three functions:storeDecoyBooking(),getDecoyBooking(),removeDecoyBooking()sessionStoragewhich automatically expires when the browser tab closesWhy sessionStorage?
How should this be tested?
This is a standalone utility module that will be integrated in PR #24326. Testing approach:
Unit tests: Verify in browser console:
Integration testing: Will be covered by PR feat: Add async spam check and decoy booking response #24326's spam detection tests
Important Review Points
🔒 Privacy Consideration
🔍 Type Safety
storeDecoyBooking()acceptsRecord<string, unknown> & { uid: string }uidfield🧪 Test Coverage
📦 Standalone Module
Mandatory Tasks
Checklist
Requested by: @hariombalhara (hariom@cal.com)
Link to Devin run: https://app.devin.ai/sessions/3d405ed14bd64872a7b72d2406408b8c