fix(rebalance): confirm a failure page was sent, and stop doubling its punctuation - #78
Merged
Merged
Conversation
…s punctuation Both found by running the drill and reading what actually reached the channel, rather than by reading the code. The failure path posted silently. The healthy path prints 'heartbeat posted', but a check that could NOT run printed nothing about its alert -- so the run that matters most was the one giving the operator no sign the page had gone out. A webhook that quietly succeeded-but-reached-nobody would have looked identical. It now prints 'failure alert posted' on success, alongside the existing 'could not be posted' on failure. And the message carried doubled punctuation. viem's errors already end in '.', and the drill put this in the ops channel: [TEST] cNGN rebalance check FAILED TO RUN (sub 15): HTTP request failed.. Trailing punctuation is stripped from the reason now. Cosmetic, but it is the message someone reads at 3am. Two tests pin both: one captures console.error and asserts the confirmation line, the other asserts the composed text contains no '..'. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two defects found by running the drill and reading what reached the channel, not by reading the code.
The failure path posted silently
The healthy path prints
heartbeat posted. A check that could not run printed nothing about its alert — so the run that matters most was the one giving the operator no sign the page had gone out. A webhook that quietly succeeded but reached nobody would have looked identical from the terminal.It now prints
failure alert postedon success, alongside the existingfailure alert could not be posted.The message doubled its punctuation
viem's errors already end in
., and the drill put this in the ops channel verbatim:Trailing punctuation is stripped from the reason now. Cosmetic — but it's the message someone reads at 3am, and it was only visible because a human pasted back what actually arrived.
Tests
Two, pinning both: one captures
console.errorand asserts the confirmation line appears; the other asserts the composed text contains no... 30 tests total,./scripts/verify.sh nodegreen.Context
Closes out the drill from #76. Both
[TEST]-prefixed messages were confirmed received in the ops channel by eye — the webhook is write-only, so a 2xx proves acceptance, not delivery, and that distinction is what surfaced both of these.🤖 Generated with Claude Code