Repository navigation
Summarize dynamic DNS provider outages instead of showing raw responses - #408
Merged
Merged
Conversation
When Cloudflare's API answered with a 502, every configured record made its own request in the same run, each one failed the same way, and the console showed all of the raw JSON bodies joined together, overflowing the card on a phone. A provider that answers 429 or 5xx now gets no more requests for the rest of the run, and a Retry-After it sends sets the next attempt. Provider errors are a typed dnsprovider.APIError that carries the status and that header. The console summarizes each failure in one line, names a rate limit or a provider-side failure as temporary, groups records that failed the same way, and keeps the redacted provider response behind View provider details. The error box wraps on narrow screens.
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.
Requested by Nick · project thread
Before: when Cloudflare's API returned a 502, every configured record sent its own request in the same run, each one failed the same way, and the Dynamic DNS card showed every raw JSON body joined together. On a phone the text ran off the side of the card and pushed the facts grid out with it.
After: the first 429 or 5xx from a provider stops requests to that provider for the rest of the run. The card says something like
home.penree.net A: Cloudflare had a temporary problem (502 Bad Gateway). Sable will try again.The redacted provider response is still available under View provider details, and the box wraps on narrow screens.How
dnsprovider.APIErrorreplaces the formatted string error for non-2xx responses. It carries the status code and anyRetry-Aftervalue (seconds or HTTP date), andTemporary()returns true for 429 and 5xx.Error()produces the same text as before, with the body collapsed to one line so a joined error has one line per record.dynamicdns: the record loop moves intopublishRecords, which returns after the first temporary error from a provider. Other providers in the same run still publish. The next attempt waits for the longer of the existing backoff and the provider'sRetry-After, capped at 30 minutes.dynamicDNSErrorDisplaysummarizes each line of the error. A 429 reads as rate limiting and a 5xx as a temporary problem. A 4xx keeps the existing "rejected the request: messages (codes)" summary, and other statuses fall back to "returned 404 Not Found". Records that failed the same way share one summary line, which names three records and counts the rest. MCP'slast_erroruses the same summary..unifi-status > divgetsmin-width: 0, and the summary wraps anywhere and keeps line breaks.go tool mage verifyandgofmt -l .are clean. The new tests cover the APIError status and Retry-After handling, the provider short-circuit and retry timing, and the summary for Nick's actual error (four repeated 502 bodies), a 429, an HTML 404, a plain-text 403 with a token, and a mixed multi-provider error.Screenshots are from a phone viewport (393px, dark) with the error from the report.
The screenshots are added in one commit and removed in the next, so the squashed diff contains no images.
Generated by Claude Code