Grouped low-severity findings in apps/data-service. Each needs a focused failing test.
- 429 ignores
retry_after — channels/telegram.ts:30,132-134. Fixed 1s/4s/16s (~21s total) backoff exhausts retries inside a typical 30–60s group rate-limit. Test: 429 with parameters.retry_after:30; assert no retry before 30s.
- KV-cached topic ids never invalidated —
domain/system-topic.ts, domain/lead-topic.ts. A manually deleted topic → permanent 400s until the KV key is cleared. Test: send to cached id fails with thread-not-found → topic recreated.
/trigger computes "today" in UTC — hono/handlers/sources.ts:149-156. Between 00:00–02:00 Warsaw, yesterday's pickup passes the >= today filter. Test with now=2026-07-01T22:30Z.
- Scheduling after the alarm slot skips an imminent pickup —
domain/waste-collection-handler.ts:149. Creating at 21:00 with alertBeforeHours:6 drops tomorrow's ~27h-away pickup. Test: now=2026-04-29T19:00Z, date 2026-04-30 → non-null alarm.
- In-memory rate limiter —
hono/middleware/rate-limit.ts:8,27. Unbounded Map, per-isolate, not pruned. Test: store stays bounded after window passes.
prune-leads month overflow — domain/prune-leads.ts:10-14. setUTCMonth(-3) on May 31 → Mar 3, deleting leads ~3 days early at 7 month-ends/yr. Test: computeLeadCutoff("2026-05-31T12:00Z") → 2026-02-28T12:00Z.
householdId cast from raw body — hono/handlers/sources.ts:33 (body.householdId as number). Missing/garbage → 500 not 400. Test: POST without householdId → 400.
createSourceWithTopic non-atomic — domain/source-lifecycle.ts:24-29. Failed topic creation leaves an orphan row; UI retry duplicates. Test: createForumTopic rejects → no orphan / typed result.
Grouped low-severity findings in
apps/data-service. Each needs a focused failing test.retry_after—channels/telegram.ts:30,132-134. Fixed 1s/4s/16s (~21s total) backoff exhausts retries inside a typical 30–60s group rate-limit. Test: 429 withparameters.retry_after:30; assert no retry before 30s.domain/system-topic.ts,domain/lead-topic.ts. A manually deleted topic → permanent 400s until the KV key is cleared. Test: send to cached id fails with thread-not-found → topic recreated./triggercomputes "today" in UTC —hono/handlers/sources.ts:149-156. Between 00:00–02:00 Warsaw, yesterday's pickup passes the>= todayfilter. Test withnow=2026-07-01T22:30Z.domain/waste-collection-handler.ts:149. Creating at 21:00 withalertBeforeHours:6drops tomorrow's ~27h-away pickup. Test:now=2026-04-29T19:00Z, date2026-04-30→ non-null alarm.hono/middleware/rate-limit.ts:8,27. Unbounded Map, per-isolate, not pruned. Test: store stays bounded after window passes.prune-leadsmonth overflow —domain/prune-leads.ts:10-14.setUTCMonth(-3)on May 31 → Mar 3, deleting leads ~3 days early at 7 month-ends/yr. Test:computeLeadCutoff("2026-05-31T12:00Z")→2026-02-28T12:00Z.householdIdcast from raw body —hono/handlers/sources.ts:33(body.householdId as number). Missing/garbage → 500 not 400. Test: POST without householdId → 400.createSourceWithTopicnon-atomic —domain/source-lifecycle.ts:24-29. Failed topic creation leaves an orphan row; UI retry duplicates. Test:createForumTopicrejects → no orphan / typed result.