Skip to content

Feat/rate - #1000

Merged
nanaf6203-bit merged 9 commits into
MettaChain:mainfrom
nafsonig:feat/rate
Jul 27, 2026
Merged

Feat/rate#1000
nanaf6203-bit merged 9 commits into
MettaChain:mainfrom
nafsonig:feat/rate

Conversation

@nafsonig

Copy link
Copy Markdown
Contributor

Changes Made:

  1. Added CacheService import to auth.service.ts
  2. Injected CacheService into the AuthService constructor
  3. Updated canRegisterFromIp to be async and use Redis first with fallback to in-memory map
  4. Modified register method to store IP tracking data in Redis with proper TTL, while also maintaining the in-memory map for backward compatibility

closes #896

  1. Updated cleanupIpForEmail to be async and delete entries from both Redis and in-memory map
  2. Added cleanupIpForEmail call in verifyInitialEmail to remove IP tracking once email is successfully verified

closes #895

Key Features:

  • Redis with TTL: IP registration tracking now uses Redis with TTL matching the email verification expiration (default 24h)
  • Backward compatibility: Falls back to the original in-memory Map if Redis is unavailable
  • Proper cleanup: IP entries are removed from both Redis and in-memory store when email is verified
  • Cross-instance scalability: Redis allows tracking to work across multiple server instances
  • No memory leaks: Redis automatically expires entries, preventing memory leaks

closes #897

The implementation is complete and meets all the acceptance criteria. The IP tracking is now persistent across server restarts, scalable across multiple instances, and won't cause memory leaks thanks to Redis's TTL-based expiration.

closes #900

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@nafsonig Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@nanaf6203-bit
nanaf6203-bit merged commit dceee18 into MettaChain:main Jul 27, 2026
2 of 3 checks passed
nanaf6203-bit added a commit that referenced this pull request Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants