From 643c7758138d1893773d3f009130e3d72cb62444 Mon Sep 17 00:00:00 2001 From: jjbrunton Date: Tue, 11 Aug 2026 21:53:40 +0100 Subject: [PATCH] Handle unscheduled browsing simulation ticks --- src/services/account-browsing-simulation.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/account-browsing-simulation.ts b/src/services/account-browsing-simulation.ts index 162eef4..cf4d69b 100644 --- a/src/services/account-browsing-simulation.ts +++ b/src/services/account-browsing-simulation.ts @@ -74,7 +74,9 @@ export class AccountBrowsingSimulationService { this.options.repository.setNextDueAt(this.options.accountId, nextDueAt, now); return { kind: 'scheduled', nextDueAt }; } - if (!force && now < settings.nextDueAt) return { kind: 'idle', reason: 'Browsing simulation is not due' }; + if (!force && settings.nextDueAt !== null && now < settings.nextDueAt) { + return { kind: 'idle', reason: 'Browsing simulation is not due' }; + } if (!force && isQuietTime(new Date(now), settings)) { const nextDueAt = moveOutsideQuietHours(now, settings); this.options.repository.setNextDueAt(this.options.accountId, nextDueAt, now);