fix(workspace): a new session shows in its workspace

This commit is contained in:
2026-10-02 16:18:00 +07:00
parent f35bf2043f
commit da1b17778c
6 changed files with 118 additions and 8 deletions
+7 -2
View File
@@ -161,8 +161,13 @@ router.get("/", (req, res) => {
params.push(tool);
}
if (lane !== undefined) {
where.push("s.lane_id = ?");
params.push(Number(lane));
// Also a session one of the lane's runs holds that nothing stamped yet:
// two dashboards may share the DB and hooks reach only one of them, which
// may be an older build that never stamps (bindRunSession).
where.push(
"(s.lane_id = ? OR (s.lane_id IS NULL AND s.id IN (SELECT session_id FROM dashboard_runs WHERE lane_id = ?)))"
);
params.push(Number(lane), Number(lane));
}
// `archived=0|1` = only live / only archived; absent = both, as before.
if (req.query.archived === "0") where.push("s.archived_at IS NULL");