Web job list says Sunday twice when the weekday field is 0,7

Open Beginner friendly
#2,145 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, rust
Domain
frontend

Research direction

Read describeCron in relay/web/app.js, especially the numeric weekday mapping and the DAYS list above it. Check how 0,7 and 1,1 are rendered, then update the weekday names so duplicates are removed while keeping first-seen order. Done means each weekday appears once; the scheduler behavior in crates/formless-core/src/jobs.rs already treats 0 and 7 as Sunday.

Written by the indexing model from the issue text.

Description

What is wrong

The web job list turns a numeric weekday list into day names by mapping each value through DAYS[n % 7] and joining them, with no dedupe. Cron weekday 7 is Sunday, the same day as 0, so a schedule that runs once is described as running twice.

0 0 * * 0,7 is shown as every Sunday, Sunday at 0:00.
0 9 * * 1,1 is shown as every Monday, Monday at 9:00.

The scheduler does not fire twice. Cron::parse copies weekday bit 7 onto bit 0 and then drops index 7, so both expressions run once (Sunday, or Monday).

Where

  • relay/web/app.js, describeCron: the arm dom === "*" && /^[0-7](,[0-7])*$/.test(dow) maps dow.split(",").map((d) => DAYS[Number(d) % 7]). DAYS is ["Sunday", ..., "Saturday"] just above that function.
  • crates/formless-core/src/jobs.rs, Cron::parse: if dow_set[7] { dow_set[0] = true; } then dow_set.truncate(7). The file header documents 0 or 7 = Sunday.

Why it matters

People write Sunday as 0, 7, or 0,7. The job list is the place they check how often a saved job runs. Listing Sunday twice reads as two firings on the same morning. A repeated number such as 1,1 has the same wording bug.

This is not #2127 (names such as MON-FRI stay raw because they fail this numeric pattern), not #2128 (every-N-hours left raw), not closed #2116 (hourly :00 wording), and not closed #2122 (@yearly / @midnight left raw).

Suggested fix

Resolve 7 to 0 (or take n % 7) and drop duplicate weekdays before joining the names, keeping first-seen order.

Dominant language
Rust
Stars
0
Forks
0
Avg merge
12h 10m
Merged PRs (30d)
780

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from athiwatc/formless

All issues in athiwatc/formless

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.