Repository navigation
Conversation
A run is claimed by inserting its delivery row as claimed and released if sending fails, but if the process died between the claim and the end of the run (timeout, restart, out of memory) nothing released it, and the rule was skipped for the rest of the day with nothing recording why. A row still claimed after 10 minutes, longer than a run takes, is now taken over by the next call in one conditional write, so only one call gets it; a sent or nobodyMissing row still blocks the day. Closes Team6083#146 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wayx112
added a commit
to wayx112/OverHours
that referenced
this pull request
Nov 15, 2026
If the process died between claiming a run and finishing it (timeout, restart, out of memory), the row stayed claimed and the rule was skipped for the rest of the day. A run still claimed after 10 minutes, longer than a run takes, is now taken over by the next call in one conditional write. It counts as a failure and continues after the parts already sent, so a run that keeps dying is given up like one that keeps failing, and a crash doesn't repeat messages. A sent or nobodyMissing run still blocks the day. This was Team6083#149, folded in here since both change claimRun. Closes Team6083#146 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Folded into #151: both changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A team reminder run is claimed by inserting its
ReminderDeliveryrow asclaimed, and a failed send releases it. But if the process dies between the claim and the end of the run (serverless timeout, restart, out of memory), nothing releases it: the row staysclaimed, the unique index makes every later call skip the rule, and no reminder goes out that day with nothing recording why (#146).STALE_CLAIM_MS), longer than one run takes. The claim time is the row'ssentAt, now set from the run'snow.updateManyonresult: "claimed"andsentAt < now − 10 min, so of two calls only one gets the run.sentornobodyMissingrow still blocks the day, however old.Closes #146.
Evidence
New tests: a run claimed a minute ago is skipped, one claimed 11 minutes ago is taken over and sent, and a sent run is never taken over.
tsc --noEmitand ESLint on the changed files pass.Merge danger
Door: two-way. One function; no schema change.
Blast radius: team reminders only.
claimRun. Whichever merges second needs both: its failed-run takeover and this stale-claim takeover.🤖 Generated with Claude Code