Skip to content

Fix inverted description/message on canopy-filed events; reject newlines in description#140

Open
passcod wants to merge 2 commits into
mainfrom
event-description-inversion
Open

Fix inverted description/message on canopy-filed events; reject newlines in description#140
passcod wants to merge 2 commits into
mainfrom
event-description-inversion

Conversation

@passcod
Copy link
Copy Markdown
Member

@passcod passcod commented May 15, 2026

Summary

The frontend's `IssueRow` uses an issue's `description` as the headline and falls back to the first line of `message` for the body; the Slack integration plumbs `issue.message` into the workflow's `message` variable, documented as 'issue body'. Two canopy-side filing sites had the two fields swapped:

  • `slacker_outbox::file_self_event` (`canopy/slack-delivery-failure`) was filing the row id / attempt / last-error blob as `description` and the one-line summary as `message`.
  • `public-server::file_health_events` (`status/health` roll-up + per-check opens) filed the multi-line health detail blob as `description` and the short headline as `message`.

Both fixed. Close events that previously had `description = None` are unchanged — they only carried short text in `message`, so the UI's `headline = description || first_line_of_message` fallback still picks the right text.

Doc + validation

  • `NewEvent` (the wire type) now documents `description` as the single-line title/subject and `message` as the body. Issue / Event types cross-reference back.
  • `NewEvent::save` returns `BadRequest` if `description` contains a newline. Multi-line content belongs in `message`; the public `/events` endpoint surfaces this as a 400 directly.

Tests

  • Public-server status assertions updated to look at `description` (headline) and `message` (body) in their new positions.
  • New `event_validation` tests cover the newline rejection and a happy-path single-line description.

passcod added 2 commits May 15, 2026 12:45
…body as description

The frontend's IssueRow uses `description` as the issue headline and
falls back to `message` for the body; the Slack integration also
plumbs `issue.message` into the workflow's `message` variable
(documented as 'issue body'). Two filing sites had this inverted:

- `slacker_outbox`'s `file_self_event` for `canopy/slack-delivery-failure`
  was filing the row id / attempt count / last error as `description`
  and the one-line summary as `message`.
- `public-server`'s `file_health_events` filed the multi-line health
  detail blob as `description` and the short headline as `message`
  (for both the roll-up and the per-check opens).

Swap them. Close events that previously had `description = None`
are unchanged — they only carried short text in `message`, so the
`headline = description || first_line_of_message` fallback in the UI
still picks the right text.
…lines

- Adds doc comments on `NewEvent` (and the persisted `Issue` /
  `Event` rows) clarifying that `description` is the short
  title/subject and `message` is the body. The UI's IssueRow already
  uses `description` as the headline; this just makes the wire-level
  contract explicit.
- `NewEvent::save` now returns `BadRequest` if `description`
  contains a newline. Multi-line content belongs in `message`. The
  check fires before any DB work, so the public `/events` endpoint
  surfaces it as a 400 directly.
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