Skip to content

Fix notification delivery defects found in review - #176

Merged
danielmaier42 merged 9 commits into
mainfrom
hotfix/notification-review-fixes
Nov 11, 2026
Merged

danielmaier42 merged 9 commits into
mainfrom
hotfix/notification-review-fixes

Conversation

@danielmaier42

Copy link
Copy Markdown
Owner

Follow-up to #172: fixes defects that an independent review and two self-reviews found in the new notification delivery.

What changes for you

  • No double pushes from a retry racing a fresh send. A retry pass now works on the outbox as it is at that moment. A notification that a fresh send delivered meanwhile is not sent a second time.
  • Webhook secrets stay out of the logs. A failed request names only the service's host. The full URL is never written to dispatchqd.err.log or deliveries.json, including when the request cannot even be built. For a Slack or Discord webhook the URL is the secret.
  • A failure streak's reminder replaces the stale push. If the earlier push of the same streak is still waiting for a channel, the reminder replaces it on the channels the reminder goes to. The phone gets the latest count rather than an old alert followed by the reminder. Each send has its own outbox entry, so nothing collides.
  • Unreadable settings no longer drop phone pushes. While config.toml cannot be read, a notification goes to the desktop and is queued for the remote channels that were on before. Those channels are known from the last good read, or from what already waits in the outbox. This holds right after a restart too.
  • Wi-Fi coming up late after a wake costs no backoff. For two minutes after a wake, a try that fails on the network does not lengthen the pause and comes back after 30 seconds. A rate limit or server error keeps its pause, so a throttling service is not hammered.
  • A retry that never failed forces nothing. A delivery queued while the settings were unreadable no longer makes the next retry pass skip other channels' pauses.
  • The NOTIFICATION LOST line says how many tries counted again.

README "When DispatchQ notifies" describes the above.

Evidence

  • Every fix has a regression test. Each test fails with its fix removed and passes with it in place: stale outbox read, URL in errors (request failure and unbuildable request), reminder superseding under a new key, reminder keeping other channels' pushes, unreadable settings during a run and after a restart, remote channels learned at start, wake grace, rate limit inside the grace, retry that never failed.
  • go build, gofmt, go vet, golangci-lint run (0 issues) and go test ./... -race pass. scripts/pkgtest was killed once under load in the full run and passed when re-run on its own; this branch does not touch it.

🤖 Generated with Claude Code

Daniel Maier and others added 9 commits November 11, 2026 17:47
A push raised in a short wake without network was tried once and lost.
Every notification now waits per channel in a delivery outbox on disk and
is retried with backoff (at once after a wake or when the network is
back) for a day, with a log line per accepted send and its receipt.

Agent tasks on Claude Code and Codex wait while their API host does not
resolve instead of failing in a DarkWake. Failures go out with high
priority and the run id, once per failing streak with one recovery push;
long rate-limit pauses and long waits of due tasks are announced once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claim outbox entries before writing them so a concurrent retry sweep
cannot send them twice, drop entries past their window without a try,
retry channels side by side and stop the tries on shutdown, detect a
wake on the wall clock, check the API host the instance actually uses,
keep a pause chain open across runs that started before it, count only
unexplained waiting time, and keep one inbox row for a failure streak
across reminders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A retry sweep now works on the outbox as it is after its claim, so a
send that settled meanwhile is not delivered twice and a counted try is
not overwritten. Every send gets its own outbox key and only tries and
releases what it claimed. A failed request names the host, never the
URL, which for a Slack or Discord webhook is the secret. While the
settings cannot be read the known remote channels are queued instead of
dropped, and tries in the first two minutes after a wake that fail on
the network do not count towards the backoff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the forced two-minute wake window with a grace: a network
failure right after a wake does not count and comes back after 30
seconds, while a rate limit or server error keeps its backoff. A
reminder supersedes the waiting deliveries of the same streak under a
new key. The remote channels are learned at start, a sweep reads the
outbox only for due entries, and a retried delivery is logged as such
whether its tries counted or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eview-fixes

# Conflicts:
#	README.md
#	internal/engine/delivery.go
#	internal/engine/delivery_test.go
#	internal/engine/engine.go
#	internal/notify/delivery_test.go
#	internal/notify/http.go
A reminder supersedes waiting pushes only on the channels it goes to.
While the settings cannot be read, the channels waiting in the outbox
count as known too, so a restart does not lose remote pushes. A request
that cannot even be built no longer quotes its URL. A delivery that
never failed no longer forces the next sweep past other pauses, and
the lost line says how many tries counted again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danielmaier42
danielmaier42 merged commit 7e1b2eb into main Nov 11, 2026
4 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