fix(incidents): a close releases the members that never left - #484
Merged
Conversation
The read fix made stranded rows inert; this stops making them. Closing an incident only ever retired the incidents row: the issue whose recovery triggered the close is stamped by the leave arm, but sub-failure contributors are held attached for context and nothing released them, so their membership rows survived the incident claiming a membership that had ended. release_remaining_members stamps whoever is left at each of the three closes — the leave arm, the linger sweep, and the operator resolve — with the timestamp that close was recorded at, so the membership ends exactly when the incident did. The sweep backdates to closing_at for the same reason the close does: the linger is damping machinery, not part of the incident's span. The operator path resolves each member individually and mostly drives them out through the leave arm, but a member already carrying resolved_at is skipped to preserve its audit trail and never leaves, so it needs the release too. A data migration retires the rows already stranded, setting left_at to the close they outlived. Membership of a still-open incident is live and is left alone. Incident detail reads every link and keeps the most recent per issue rather than filtering on left_at, so closed incidents still list who was involved. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
🤖 Stacked on #483, which made stranded membership rows inert. This stops making them, and retires the ones already there.
Closing an incident only ever retired the
incidentsrow. The issue whose recovery triggered the close is stamped by the leave arm, but sub-failure contributors are held attached for context and nothing released them — theirincident_issuesrows survived the incident, claiming a membership that had ended.release_remaining_membersstamps whoever is left at each of the three closes — the leave arm, the linger sweep, and the operator resolve — with the timestamp that close was recorded at, so the membership ends exactly when the incident did. The sweep backdates toclosing_atfor the same reason the close does: the linger is damping machinery, not part of the incident's span. The operator path resolves each member individually and mostly drives them out through the leave arm, but a member already carryingresolved_atis skipped to preserve its audit trail and never leaves, so it needs the release too.A data migration retires the rows already stranded, setting
left_atto the close they outlived. Membership of a still-open incident is live and is left alone. Itsdown.sqlis deliberately a no-op — nothing distinguishes a backfilled row from one the close paths stamped afterwards, so a revert would clear legitimate leaves and re-strand the memberships.Incident detail reads every link and keeps the most recent per issue rather than filtering on
left_at, so closed incidents still list who was involved.Coverage
Three tests, one per side: the close releases a contributor that never left; a row stranded the way the old paths left it still lets a later failure open an incident; the backfill retires stranded rows and spares live ones.