(diag): log project lookup result before getProjectDB fallback

This commit is contained in:
Jake Barnby
2026-04-18 05:42:49 +12:00
parent d8486612de
commit 8716497d1f
+11
View File
@@ -847,6 +847,17 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
if (!empty($projectId) && $projectId !== 'console') {
$project = $authorization->skip(fn () => $database->getDocument('projects', $projectId));
if ($project->isEmpty()) {
Console::warning(sprintf(
'[realtime-project-diag] projectId=%s consoleDb=%s consoleNs=%s consoleTenant=%s consoleShared=%s — project lookup returned empty, will fall back to console',
$projectId,
$database->getDatabase(),
$database->getNamespace(),
(string) ($database->getTenant() ?? 'null'),
$database->getSharedTables() ? 'yes' : 'no'
));
}
$database = getProjectDB($project);
$database->setAuthorization($authorization);
} else {