mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
feat(watch): add pause and visibility change progress saving with rate limiting
- Save watch progress immediately when video is paused using player instance directly - Save progress when tab becomes hidden (user switches tabs or minimizes) - Add rate limiting (30/min) to watch progress API endpoint to prevent abuse - Use player instance directly instead of React state for current time/duration to avoid stale values
This commit is contained in:
@@ -26,6 +26,9 @@ export const RATE_LIMIT_CONFIGS: Record<string, RateLimitConfig> = {
|
||||
'create-version': { windowMs: 60 * 1000, maxRequests: 10 }, // 10 per minute
|
||||
'create-workspace': { windowMs: 60 * 60 * 1000, maxRequests: 10 }, // 10 per hour
|
||||
|
||||
// Watch progress — allow frequent updates but prevent abuse
|
||||
'watch-progress': { windowMs: 60 * 1000, maxRequests: 30 }, // 30 per minute (pausing + periodic + visibility changes)
|
||||
|
||||
// Member management
|
||||
'invite-member': { windowMs: 60 * 60 * 1000, maxRequests: 30 }, // 30 per hour
|
||||
'manage-member': { windowMs: 60 * 1000, maxRequests: 20 }, // 20 per minute
|
||||
|
||||
Reference in New Issue
Block a user