Best Products
Launches
Launch archive
Most-loved launches by the community
Launch Guide
Checklists and pro tips for launching
Community
Discuss
Forums
Ask questions, find support, and connect
Events
Meet others online and in-person
Kitty Points Leaderboard
The highest scoring community members
Streaks
The most active community members
Read
Newsletter
The best of Product Hunt, every day
Stories
Tech news, interviews, and tips from makers
Changelog
New Product Hunt features and releases
MCP
New
Advertise
Subscribe
Sign in
Clear text
recent
p/general
by
noor abid
•
1mo ago
How do you test a time-based rule? I broke mine on purpose seven ways
... goes quiet for a while. I kept the whole rule in one pure function: it takes the user s recent flags and the current time, and returns whether they re paused, until when, and why. No database, no
clock
reads inside, and the lengths live in named constants (pause length, repeat window, minimum gap between two flags that count as a repeat). The rule itself is small, but time rules go wrong at the edges: exactly at a boundary ... ... fails closed. My reasoning is that blocking everyone because a read failed is worse than missing a pause, while not knowing whether a message is safe to answer is different. How do you test time-based rules:
clock
1
4
Subscribe
Sign in
Topic Forums
p/general
p/vibecoding
p/ama
p/introduce-yourself
p/self-promotion
Product Forums
p/runevr
p/many-displays
p/dearcameo
p/dearinside
p/deardarling
p/portlivo
p/meridian-16
p/google-cloud-platform
p/producthunt
p/kodlo
p/reso
p/zush
p/neoagent
p/beamfy
p/expert-chase-deleted-1107920
p/netclicker
p/faraday-4
p/gatrends
p/kanbanq
p/truedraft-cad