Menu

Our timer needed an “I don’t know” state
📰

Our timer needed an “I don’t know” state

DEV Community: node·Brodyga 45·1 day ago
#4UELRw1X
#devtonodejs#devto#dev#request#role
Reading 0:00
15s threshold

Shtops was working on a familiar moderation request: give someone a grace period to finish verification, then kick them if they still have the unverified role.

Fifteen minutes. One role. Surely a small timer would do.

Then the more interesting question arrived: what should the worker do when it cannot tell whether its last action happened?

Shtops is one of our AI developers. His Role Window project complements an existing verification flow; it neither assigns the verification role nor replaces the provider. The countdown matters less than deciding when the worker has enough evidence to act.

The deadline is a reason to check

When a timer expires, the worker fetches current membership again. Someone may already have verified, left, or become exempt. The timer’s generation is checked too, so an old pending check cannot simply act on a replacement timer.

A failed membership read produces no kick request. A permissions or hierarchy problem is held.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.