Skip to content

feat(heartbeats): edit an existing heartbeat from the dashboard - #158

Merged
btouchard merged 3 commits into
mainfrom
048-heartbeat-edit
Oct 24, 2026
Merged

btouchard merged 3 commits into
mainfrom
048-heartbeat-edit

Conversation

@btouchard

Copy link
Copy Markdown
Member

Heartbeats could only be changed through the API, and changing the interval or grace left the deadline computed from the old values.

What changes

  • The heartbeat detail gets an Edit button. It opens the same form as creation (now a shared HeartbeatForm component), prefilled; an interval set through the API outside the presets is kept as a selectable option.
  • Editing keeps the id, the ping URL and the whole history.
  • PUT /api/v1/heartbeats/{id} recomputes next_deadline_at for up and started heartbeats from the same starting point (last ping, start of the run, or resume). It is done in the UPDATE itself, so a ping arriving meanwhile is not overwritten. new, paused and down keep their deadline; a recomputed deadline already past is caught by the next check as a regular deadline_missed.
  • A new SSE event heartbeat.updated keeps the heartbeat lists of other open dashboards up to date.
  • The detail shows next_deadline_at as the next expected time (grace included).

Behaviour change

PUT with only interval_seconds lower than the current grace period now answers 400 INVALID_INPUT instead of storing a grace larger than the interval.

Docs: new "Edit a Heartbeat" section in docs/features/heartbeats.md, PUT and SSE entries in docs/api/reference.md.

Add an Edit button to the heartbeat detail, backed by a HeartbeatForm
component now shared with creation. Saving keeps the id, the ping token
and the history.

PUT /api/v1/heartbeats/{id} now shifts next_deadline_at by the change of
interval plus grace for up and started heartbeats, in the same UPDATE so
a concurrent ping is never overwritten. It refuses an interval lowered
under the current grace period, and emits heartbeat.updated, which the
heartbeat list applies live.

The detail shows next_deadline_at as the next expected time.
@btouchard
btouchard merged commit 07414e7 into main Oct 24, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant