fix(main): R9 — guard the yt-dlp update throttle against a backward clock
shouldAutoCheckYtdlp compared (now - lastCheck) >= interval; a backward system- clock correction leaves lastCheck in the future so the difference is negative and the daily check never comes due again. Treat a future lastCheck as skewed and run the check. The renderer scheduled-item promoter is inherently fire-once (promotion flips the item out of 'saved'), so it can't double-fire on a backward jump — a forward jump firing early is documented and accepted as minor. Unit-tested. typecheck + 263 tests + eslint + prettier green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -272,6 +272,10 @@ export const useDownloads = create<DownloadState>((set, get) => {
|
||||
},
|
||||
|
||||
promoteDueScheduled: () => {
|
||||
// Wall-clock comparison: each scheduled item fires once (the promotion flips it
|
||||
// out of 'saved'), so a backward clock jump only delays it and can't double-fire;
|
||||
// a forward jump can fire it early. Accepted as minor per R9 — a monotonic
|
||||
// scheduler would be overkill for a park-until-time feature.
|
||||
const now = Date.now()
|
||||
set((s) => ({
|
||||
items: s.items.map((i) =>
|
||||
|
||||
Reference in New Issue
Block a user