[P2] CronScheduler setTimeout overflow fires monthly/yearly jobs immediately in a tight loop
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- desktop
Research direction
Start in apps/desktop/src/main/cron.ts around lines 95-115 and inspect how CronScheduler calculates delays and reschedules jobs. Verify the timeout delay is bounded for monthly and yearly schedules, and that a capped timeout does not execute the job until Date.now() reaches nextTs; confirm the tight loop is eliminated.
Written by the indexing model from the issue text.
Description
Priority: P2
File: apps/desktop/src/main/cron.ts lines ~95-115
JS setTimeout fires immediately when delay > 2^31-1 ms (~24.8 days). Monthly (~30d) and yearly (~365d) cron jobs exceed this limit, causing them to fire immediately and re-schedule in a tight loop.
Fix: Cap delay at Math.min(delay, 2**31-1); when the cap fires, re-check Date.now() >= nextTs before executing the job.
- Dominant language
- TypeScript
- Stars
- 120
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unbug/tday
-
performance
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
perf(history-store): saveStore uses JSON.stringify with 2-space indent, bloating file size by 30–50% Openperformance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
performance
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
perf(usage-store): Math.max(...tsValues) spread overflows V8 argument stack on large record sets Openperformance
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
performance
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100