Skip to content

fix(discord): post the button-press acknowledgment into the incident's thread - #420

Merged
fclairamb merged 3 commits into
mainfrom
fix/discord-ack-thread-notice
Sep 22, 2026
Merged

fclairamb merged 3 commits into
mainfrom
fix/discord-ack-thread-notice

Conversation

@fclairamb

Copy link
Copy Markdown
Owner

Summary

Pressing Acknowledge on a Discord alert rewrote the alert card in the channel ("✅ #100 … acknowledged by @you") and posted a follow-up — but into the alerts channel, never into the incident's thread, while every later follow-up ("Incident resolved", …) lands in that thread. The comment is a lie in postAcknowledgmentNotice (it says "into the incident's thread" and posts to interaction.ChannelID), and the ack-notice fan-out deliberately skips the origin guild on the promise that the thread notice already happened (see the doc comment on AcknowledgeIncidentFromDiscord). Net result: nothing about the ack ever reached the thread.

  • postAcknowledgmentNotice now resolves the incident's thread from the forward incidents/<uid>/discord/thread state entry the notification sender wrote at post time, un-archives it first (same dance postThreadReply does for late follow-ups), and posts there.
  • Falls back to the channel when no thread is on record (thread creation denied, DM destination) — same as before.
  • The state-entry key constants move to the discord integration package so the sender and the interaction path share one definition.

Test plan

  • New e2e-style unit test: with a seeded thread state entry, the ack notice posts into T-INC-1 (the thread), not C-ALERTS
  • New test pinning the no-thread fallback to the channel
  • go test ./internal/integrations/discord/... ./internal/notifications/... ./internal/handlers/incidents/... green; golangci-lint (v2.13.2) clean on both touched packages

…s thread

postAcknowledgmentNotice claimed to announce the acknowledgment "in the
incident's thread" but addressed interaction.ChannelID — the channel the
alert button lives in — and the ack-notice fan-out skips the origin guild on
the promise that the thread notice already happened. So the acknowledgment
appeared in the channel (the rewritten card) but never in the thread, while
resolved/unacknowledged follow-ups correctly landed there.

The notice now resolves the incident's thread from the forward
incident→thread state entry the notification sender wrote at post time —
un-archiving it first, the same dance postThreadReply does for late
follow-ups — and falls back to the channel when no thread is on record.
The state-entry keys move to the discord package so both halves share them.
@fclairamb
fclairamb enabled auto-merge (squash) September 21, 2026 22:04
A check that is down (its target unreachable) makes the check surfaces poll
for live updates — /checks and /results every few seconds — so networkidle
can never settle on the badges page and the first test timed out 3/3 in CI.
Every wait it removed is followed by an auto-waiting assertion or click, so
element visibility is what these tests actually needed.
@fclairamb
fclairamb merged commit 4722147 into main Sep 22, 2026
19 checks passed
@fclairamb
fclairamb deleted the fix/discord-ack-thread-notice branch September 22, 2026 00:45
fclairamb added a commit that referenced this pull request Sep 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.31.1](v0.31.0...v0.31.1)
(2026-09-22)


### Bug Fixes

* **cli:** publish sp as bare, version-free binaries and add a Windows
build ([#417](#417))
([a6ed0e1](a6ed0e1))
* **deps:** update module github.com/aws/aws-sdk-go-v2/service/s3 to
v1.113.2 ([#416](#416))
([7e24d89](7e24d89))
* **discord:** post the button-press acknowledgment into the incident's
thread ([#420](#420))
([4722147](4722147))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
fclairamb added a commit that referenced this pull request Sep 22, 2026
…idle (#422)

## Problem

`docs-links.spec.ts`'s badges case is the last spec still waiting for
`networkidle` after the client-side navigation into the badge builder.
That wait never completes in that path: the page is rendered and the
network is fully quiet (verified at CDP level), but Playwright's
network-idle lifecycle event never fires — deterministic on macOS
headless Chromium, intermittent on loaded CI runners. CI run 35663414815
hung exactly there, twice, in the two badges-arrival specs.

`badges.spec.ts`'s equivalent already had its `networkidle` dropped
(landed with #420); this file was missed.

## Fix

Wait for the docs link itself, which is what the test asserts anyway.

## Verification

- Local repro (failing 100% before): `bunx playwright test
e2e/docs-links.spec.ts` → all green alongside `e2e/badges.spec.ts` (31
passed).
- `bunx eslint e2e/docs-links.spec.ts`: clean.
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