• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 41238161825
78%

Build:
DEFAULT BRANCH: main
Ran 31 Oct 2026 08:20PM UTC
Jobs 2
Files 319
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Oct 2026 08:16PM UTC coverage: 77.369% (+0.02%) from 77.35%
41238161825

push

github

web-flow
fix(settings): state that rate-limit periods are milliseconds and reject a period that is not one (#1010)

Closes #1007.

## What

`RateLimit.period` is milliseconds everywhere in practice —
`resources/default-settings.yaml` ships `1000`, `60000`, `900000`,
`3600000` — but nothing said so, and the validator only required `period
> 0`. An operator writing `period: 60` for a minute got a 60 ms window,
and because `rate` is hits **per window**, that is a limit a thousand
times **looser** than intended: twelve hits per minute becomes twelve
hits per 60 ms. Nothing complained, and nothing in review caught it.

Three changes, as the issue asked:

| where | change |
|---|---|
| `src/@types/settings.ts` | `RateLimit.period` documents the unit, with
the direction of the mistake spelled out |
| `resources/default-settings.yaml` | every `rateLimits` /
`loginRateLimits` block is annotated, plus a note at `limits:` |
| `validateRateLimitPeriods` | rejects a non-number, a fraction, and
anything below 1 ms; the message names milliseconds |

## What it deliberately does not do

It cannot tell `60` from `60000` — both are whole numbers, and 60 is a
valid millisecond value. No validator can infer the unit from the
number, which is why the unit is documented at the point where it is
set, and why the message says "milliseconds" so a rejected value is
never read as seconds.

## Review

Greptile's P2 on the first wording was correct and is fixed: the comment
said a shorter period makes the limit *stricter*, and it makes it
looser.

## Verification

- `test/unit/utils/settings-config.spec.ts`: 112 passing (4 new cases:
fractional, string, NaN, and the message mentioning milliseconds)
- reverting the validator: those cases fail apart from NaN, which the
old `> 0` check already caught

4390 of 6207 branches covered (70.73%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 1 file covered. (100.0%)

9558 of 11821 relevant lines covered (80.86%)

774.26 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Integration - 41238161825.1 31 Oct 2026 08:20PM UTC 319
33.35
GitHub Action Run
2 Unit - 41238161825.2 31 Oct 2026 08:21PM UTC 319
74.76
GitHub Action Run
Source Files on build 41238161825
  • Tree
  • List 319
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #41238161825
  • a3b98d05 on github
  • Prev Build on main (#41236831540)
  • Next Build on main (#41239856642)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc