- Node group CRUD operations with traffic-based filtering
- Three grouping modes: average distribution, subscription-based, and traffic-based
- Automatic and manual group recalculation with history tracking
- Group assignment preview before applying changes
- User subscription group locking to prevent automatic reassignment
- Subscribe-to-group mapping configuration
- Group calculation history and detailed reports
- System configuration for group management (enabled/mode/auto_create)
Database:
- Add node_group table for group definitions
- Add group_history and group_history_detail tables for tracking
- Add node_group_ids (JSON) to nodes and subscribe tables
- Add node_group_id and group_locked fields to user_subscribe table
- Add migration files for schema changes
When administrators update subscription plan configurations (traffic limits,
nodes, speed limits, etc.), existing subscribers were not seeing the updated
settings immediately. This was caused by stale cache entries that were not
being invalidated.
The issue occurred because:
- User subscription queries cache the entire result including preloaded plan details
- Plan update/delete operations only cleared the plan's own cache keys
- User subscription cache keys (cache:user:subscribe:user:{userId}) remained stale
This fix ensures that when a subscription plan is updated or deleted, all
associated user subscription caches are properly invalidated by:
- Querying all active users subscribed to the plan
- Building cache keys for each affected user
- Clearing both plan and user subscription caches atomically
Users will now immediately see updated plan configurations without waiting
for cache expiration.
Remove IF NOT EXISTS clause from CREATE INDEX statement to ensure
compatibility with older MySQL versions. Migration framework ensures
each migration runs only once, making the clause unnecessary.
Change ALTER TABLE ADD INDEX IF NOT EXISTS to CREATE INDEX IF NOT EXISTS
to comply with MySQL syntax requirements. The IF NOT EXISTS clause is
only supported with CREATE INDEX statement, not with ALTER TABLE ADD INDEX.