mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-23 12:03:09 +02:00
Port of Rosmi720/XC_VM@b44abddf. The rogue-connection sweep assumed ConnectionTracker::getConnections() always returned a MySQL map grouped by user id and iterated it with a flat double-loop. In Redis mode it returns a [keys, data] pair, so the inner loop hit string keys and threw a TypeError, aborting the cron. Parse the result defensively via a small recursive helper (collectUuidRows) that flattens any of the shapes — the Redis [keys, data] pair, the MySQL user-id map and a single connection row — to the rows carrying a uuid, then filter to the current stream. Both helpers are pure and unit-tested. Adapted to this tree: the ar.ini/en.ini label tweaks target keys not present here, so only the cron fix was ported; the added guards were split into covered helpers to keep loadCron within the complexity ceiling.