Commit 46408c5
committed
fix: resolve 3 critical production bugs and add activity tracking
Critical Fixes:
- fix: implement actual cleanup logic to prevent memory leaks
* Add ActivityTracker module for last-activity tracking
* Implement cleanup_expired_sessions with real cleanup logic
* Add touch/1 API for manual TTL extension
* Auto-track activity on call/cast operations
- fix: enforce rate limiting to prevent DoS attacks
* Add RateLimiter module with sliding window algorithm
* Integrate rate limiting into session creation flow
* Add telemetry events for rate limit monitoring
* Add rate_limit_exceeded error type
- fix: standardize macro argument names for consistency
* Change :process_link macro to use :arg instead of :args
* Fix get_session_id/0 nil handling in both macros
* Add comprehensive macro consistency tests
New Features:
- Add Phoenix.SessionProcess.ActivityTracker module
- Add Phoenix.SessionProcess.RateLimiter module
- Add Phoenix.SessionProcess.touch/1 for manual TTL extension
- Add rate limit telemetry events
- Add activity-based TTL tracking
Tests:
- Add 18 new tests (ActivityTracker, RateLimiter, macro consistency)
- Update test support to use GenServer state
- All tests passing: 93 tests total
Documentation:
- Add FIXES_SUMMARY.md with complete fix documentation
- Update README.md with new features
- Update CLAUDE.md architecture documentation
- Simplify state management to GenServer + optional Redux
Files Changed: 20 files
- 5 new modules and test files
- 2 deleted (unreleased Agent module)
- 13 updated (core fixes + documentation)1 parent 5892ccd commit 46408c5
File tree
20 files changed
+1399
-414
lines changed- lib/phoenix
- session_process
- test
- phoenix/session_process
- support
20 files changed
+1399
-414
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
| 70 | + | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 114 | + | |
| 115 | + | |
121 | 116 | | |
122 | 117 | | |
123 | 118 | | |
| |||
167 | 162 | | |
168 | 163 | | |
169 | 164 | | |
170 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
171 | 170 | | |
172 | | - | |
173 | | - | |
174 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
0 commit comments