fix(gateway): route messages to virtual devices in handleSend()

handleSend() only checked socket-based devices (deviceToSocket map),
causing DEVICE_NOT_FOUND errors when Hub sends responses to virtual
devices like Telegram. Now checks virtualDevices map as fallback.

Also adds routeFromVirtualDevice() to allow virtual devices to
initiate messages (e.g., verify RPC, chat messages) through the
Gateway routing infrastructure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yushen 2026-02-10 16:04:10 +08:00
parent bfa96d87af
commit 604d74d984
15 changed files with 862 additions and 58 deletions

View file

@ -0,0 +1,15 @@
/**
* Database module for Gateway.
*
* Global module that provides DatabaseService to all other modules.
*/
import { Global, Module } from "@nestjs/common";
import { DatabaseService } from "./database.service.js";
@Global()
@Module({
providers: [DatabaseService],
exports: [DatabaseService],
})
export class DatabaseModule {}