Skip to content

Track muted state on incidents#431

Draft
Jan-Schuppik wants to merge 2 commits into
mainfrom
track-muted-state-on-incidents
Draft

Track muted state on incidents#431
Jan-Schuppik wants to merge 2 commits into
mainfrom
track-muted-state-on-incidents

Conversation

@Jan-Schuppik
Copy link
Copy Markdown

Previously the mute state (mute_reason) was stored on the object table, meaning all incidents for an object shared a single mute flag. This PR moves mute_reason onto the incident table so each incident independently owns its mute state.

  • incident table gains a mute_reason column; IsMuted() now reads MuteReason.Valid directly on the incident instead of delegating to the object
  • object table loses mute_reason; Object.IsMuted(), RestoreMutedObjects(), and the transient isMuted bool are all removed
  • Schema migrations (0.3.0.sql) copy active mute state from object to any open incident before dropping the column, preserving mute state across upgrades
  • handleMute/handleUnmute persist mute_reason via incident.Sync() in the same DB transaction as the history entry
  • Tests add a makeIncidentFromEvent helper that drives the real ProcessEvent path, and a WithMutedIncidents sub-test in TestLoadOpenIncidents that asserts mute_reason survives a
    daemon reload

Resolves:

Move mute_reason from the object table to the incident table so each
incident independently owns its mute flag. This removes Object.IsMuted(),
RestoreMutedObjects(), and the transient isMuted bool — MuteReason.Valid
now serves as the canonical mute flag, persisted in the same DB transaction
as the history entry. Schema migrations transfer active mute state from
objects to their open incidents.
@Jan-Schuppik Jan-Schuppik self-assigned this May 29, 2026
@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label May 29, 2026
Add makeIncidentFromEvent helper that drives the real ProcessEvent path to
create incidents with optional mute state. Add a WithMutedIncidents sub-test
that asserts mute_reason is correctly persisted and restored.
@Jan-Schuppik Jan-Schuppik force-pushed the track-muted-state-on-incidents branch from 0cf7d77 to 269346c Compare May 29, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant