mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-31 03:03:24 +01:00
Signals — the file-backed queue of deferred DB writes drained by the cache-handler daemon — were produced two different ways: five call sites went through RedisManager::setSignal() while getStreamingUserInfo inlined the same file_put_contents(). Worse, the writer lived on RedisManager yet wrote a *file*, not Redis — a misleading home that made the two paths look like different transports (they were byte-identical). Introduce XcVm\Infrastructure\Signal\SignalQueue as the single owner of the on-disk contract (cache_<md5(key)> holding [key, data]): - push() - the one producer API; all 7 call sites use it now (UserRepository x4, auth.php x2, BruteforceGuard x1) - pending() - the drain API; CacheHandlerCommand reads through it instead of its own glob + json_decode - pathFor() / PREFIX - path helpers RedisManager::setSignal() stays as a thin @deprecated alias delegating to SignalQueue::push() for any out-of-tree callers. Behaviour unchanged (same files, same format, same consumer switch). Adds SignalQueueTest (format / idempotency / drain / malformed). Validated live: player_api/testxc still authenticates (auth=1) with SignalQueue autoloaded. Verified: php -l, phpunit (435 tests, 973 assertions), make gates.