Repository navigation
feat(chores): chores every 2, 3 or 4 weeks on set weekdays (#401) - #409
Merged
Merged
Conversation
"Every other Sunday" for cleaners who come fortnightly. Cron can't say
it, so the rhythm sits beside the crontab: week_interval (2-4, NULL for
every week) and week_anchor (the Sunday of a week that counts), migration
45. A day counts when the crontab fires and its week is a whole number of
intervals from the anchor's week; only for days of the week, on a day-of
or until-completed schedule ("stays until done" keeps its Sundays however
late it's ticked).
- One rule on each side: scheduleFiresOnDate (server/utils/cronDay.js,
server/utils/weekRhythm.js) for sticky cards, the daily bonus and
misses, and the claim route's open-bonus check; scheduleFiresOn
(client/src/utils/choreDays.js) for the widget, the 7-day row, the
board calendar and the next-occurrence column. Off weeks are simply not
due.
- The wizard's "On certain days of the week" asks Every week / 2 / 3 / 4
weeks and, for more than one, which week it starts. A group's Change
days shows and changes it, and keeps it when only the days change; Copy
carries it. The board names it "Every other week: Sunday (next Dec 6)",
and groups opposite weeks apart.
- The server keeps the rhythm when a PATCH changes only the days, and
drops it when one moves the schedule off days of the week, so editors
that don't know about it can't leave a stray rhythm. A rhythm where it
means nothing is a 400.
Separate columns rather than reusing `interval` (as the plan on #401
suggested): `interval` already means two things, and old edit paths reset
it, which would have turned a fortnightly chore weekly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamecker
pushed a commit
to adamecker/HomeGlow
that referenced
this pull request
Nov 29, 2026
…h#409), nightly job keeps unscheduled chores (jherforth#408), bonus chore offered to some people only (jherforth#403/jherforth#404) Upstream's migrations 44 (choreClaimUsers) and 45 (weekRhythm) collide with the prod line's own 44 (anyDayChores) and 45 (prizePaused), so they land here renumbered as 50 and 51, per the established prod-line practice. anyDayChores test updated for the new final schema version (51).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #401.
Why
Some chores follow a fortnightly rhythm set by something outside the house, such as "put out the check for the cleaners" every other Sunday. Nothing did that before:
Cron can't say it either. The plan on #401 has the details, and the short version is that cron has no week number.
What changes for people
How it works
chore_schedules.week_interval(2–4, NULL for every week) andweek_anchor(the Sunday of a week that counts).*), onday-oforuntil-completed.scheduleFiresOnDate(utils/cronDay.js, withutils/weekRhythm.js) replacescronFiresOnDatein all three places that ask "is it due": the stays-until-done cards,getTodaysRegularChoresForUser(the bonus and misses), and the claim route's open-bonus check.scheduleFiresOn(utils/choreDays.js) does the same for the widget, the 7-day row, the board calendar and the next occurrence.POST/PATCH /api/chore-schedulestakeweek_intervalandweek_anchor.everyandanchor. Its group key holds the phase, so two schedules on the same weeks share a group even with different anchors.scheduleFieldsForTimingwrites the rhythm for a week timing and clears it for every other kind.A change from the plan posted on #401: the rhythm has its own columns instead of reusing
interval.intervalalready means two things (the gap after "again after done", and an any-day period), and several edit paths reset it to null. That would have quietly turned a fortnightly chore weekly.Not included: the "every few days" fix that the plan mentioned as optional. It's still a separate follow-up.
Checks
npm test(TZ=UTC), 841/841. Newtests/weekRhythm.test.js(8):utils/weekRhythm.test.js(14). Eight existing timing expectations now include the cleared rhythm fields.check:i18n(English and Spanish) and the build pass.0 0 * * 0,2,2026-12-06,until-completed.🤖 Generated with Claude Code