fix(ci): simplify first-session day count cast

This commit is contained in:
2026-03-28 13:25:38 -07:00
parent e4c8c60b3e
commit b1638afe21

View File

@@ -93,12 +93,11 @@ function isFirstSessionForLocalDay(
currentSessionId: number,
startedAtMs: number,
): boolean {
return (
Number(
(
db
.prepare(
`
return Number(
(
db
.prepare(
`
SELECT COUNT(*) AS count
FROM imm_sessions
WHERE date(started_at_ms / 1000, 'unixepoch', 'localtime') = date(? / 1000, 'unixepoch', 'localtime')
@@ -107,11 +106,10 @@ function isFirstSessionForLocalDay(
OR (started_at_ms = ? AND session_id < ?)
)
`,
)
.get(startedAtMs, startedAtMs, startedAtMs, currentSessionId) as ExistenceRow | null
)?.count ?? 0,
) === 0;
);
)
.get(startedAtMs, startedAtMs, startedAtMs, currentSessionId) as ExistenceRow | null,
)?.count ?? 0
) === 0;
}
function resetLifetimeSummaries(db: DatabaseSync, nowMs: string): void {