5 Commits
Author SHA1 Message Date
dsql c65326882a chore: bump to 1.1.0 (logging-discipline audit)
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-08-10 23:00:50 -04:00
dsql e2f78bd80f fix: logging discipline in the webhook send loop
- promote the three swallow-to-failed-result catch-alls (unexpected send error, proxy
  get() fault, proxy burn() fault) from WARNING to ERROR: each swallows an unexpected
  failure into a WebhookResult(ok=False) - the op failed, the result is lost, and this
  lib is the last code that sees the exception, so it is an ERROR not a routine WARNING.
- add the attempt count to the two per-attempt 429 WARNING lines (rule 3: per-attempt
  retry lines carry N/M), using the per-call counter already in scope.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-08-09 02:09:53 -04:00
dsql 8a8d99bbb3 build: use git+https for inter-lib deps (docker ssh limitation)
docker builds can't use git+ssh (no ssh key / agent in the build), so the inter-lib
dependency references move to git+https (repos are public, anonymous clone). pins are
unchanged in target; bump to 1.0.2 so the https dependency spec ships under a new tag.
README install lines intentionally keep the ssh form for local/dev use.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-20 22:25:06 -04:00
dsql 52fea6e380 fix: pin inter-lib dependencies to their v1.0.0 tags
the v1.0.0 release still pinned pre-1.0.0 sibling tags, so a fresh install dragged in
stale transitive deps. update the pin(s) to the current v1.0.x release and bump this lib
to 1.0.1 so the corrected dependency chain ships under a new tag (v1.0.0 left intact).

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-17 17:46:10 -04:00
dsql fb382f9767 release: 1.0.0
first stable release. pre-1.0.0 verification complete: all surviving MED regressions and
gaps resolved and independently re-fired, tree audited clean across the suite.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-09 18:53:15 -04:00
3 changed files with 21 additions and 13 deletions
+3 -3
View File
@@ -13,16 +13,16 @@ send to the core — inheriting rotation, proxy, retry, and result for free.
## Install ## Install
``` ```
aiowebhooks @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v0.1.8 aiowebhooks @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v1.0.2
# discord embeds / identity helpers need the extra: # discord embeds / identity helpers need the extra:
aiowebhooks[discord] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v0.1.8 aiowebhooks[discord] @ git+ssh://git@git.rethinkstudios.io/rethink-public/aiowebhooks.git@v1.0.2
``` ```
The base pulls `aiohttp` and `commons` (for the retry/backoff engine). Only The base pulls `aiohttp` and `commons` (for the retry/backoff engine). Only
`aiowebhooks[discord]` adds `discord.py` (>=2.3, mainline, not discord.py-self), and `aiowebhooks[discord]` adds `discord.py` (>=2.3, mainline, not discord.py-self), and
only for `DiscordWebhook`. only for `DiscordWebhook`.
Drop the `@v0.1.8` suffix from the line above to install the latest unpinned. Drop the `@v1.0.2` suffix from the line above to install the latest unpinned.
## Core sender ## Core sender
+2 -2
View File
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
[project] [project]
name = "aiowebhooks" name = "aiowebhooks"
version = "0.1.8" version = "1.1.0"
description = "async webhook sender (aiohttp) with round-robin urls, retry, and proxy rotation; optional discord.py embeds" description = "async webhook sender (aiohttp) with round-robin urls, retry, and proxy rotation; optional discord.py embeds"
requires-python = ">=3.10" requires-python = ">=3.10"
dependencies = [ dependencies = [
"aiohttp>=3.9", "aiohttp>=3.9",
"commons @ git+ssh://git@git.rethinkstudios.io/rethink-public/commons.git@v0.2.1", "commons @ git+https://git.rethinkstudios.io/rethink-public/commons.git@v1.0.0",
] ]
[project.optional-dependencies] [project.optional-dependencies]
+16 -8
View File
@@ -141,8 +141,10 @@ class Webhook:
except _Retryable as exhausted: except _Retryable as exhausted:
return exhausted.result return exhausted.result
except Exception as error: except Exception as error:
# never-raises net: anything else (closed session, bad proxy url, ...) -> failed result # never-raises net: anything else (closed session, bad proxy url, ...) -> failed result.
log.warning("webhook send failed unexpectedly on %s: %s", url, error, exc_info=True) # ERROR: an UNEXPECTED failure is swallowed here into a failed result (op failed, result
# lost, a human may need to act) - the lib is the last code that sees this exception.
log.error("webhook send failed unexpectedly on %s: %s", url, error, exc_info=True)
return WebhookResult( return WebhookResult(
ok=False, status=None, url=url, attempts=counter[0] or 1, ok=False, status=None, url=url, attempts=counter[0] or 1,
error=f"{type(error).__name__}: {error}", error=f"{type(error).__name__}: {error}",
@@ -165,7 +167,8 @@ class Webhook:
if pending_wait[0] is not None: if pending_wait[0] is not None:
wait = pending_wait[0] wait = pending_wait[0]
pending_wait[0] = None pending_wait[0] = None
log.warning("webhook 429 on %s; honoring retry_after %.3fs", url, wait) log.warning("webhook 429 on %s; honoring retry_after %.3fs (attempt %d/%d)",
url, wait, counter[0] + 1, self.max_retries + 1)
await asyncio.sleep(wait) await asyncio.sleep(wait)
counter[0] += 1 counter[0] += 1
attempts = counter[0] attempts = counter[0]
@@ -174,9 +177,11 @@ class Webhook:
try: try:
proxy_dict = self._proxies.get() proxy_dict = self._proxies.get()
except Exception: except Exception:
# duck-typed provider: any get() error means no proxy available # duck-typed provider: any get() error means no proxy available.
log.warning("webhook: proxy get() failed; no proxy available", # ERROR: swallowed into a failed result (op failed, result lost) - the
exc_info=True) # provider fault vanishes here unless it is logged loudly.
log.error("webhook: proxy get() failed; no proxy available",
exc_info=True)
return WebhookResult( return WebhookResult(
ok=False, status=None, url=url, attempts=attempts, ok=False, status=None, url=url, attempts=attempts,
error="proxies unavailable", proxy=last_proxy, error="proxies unavailable", proxy=last_proxy,
@@ -209,7 +214,8 @@ class Webhook:
if wait is not None: if wait is not None:
pending_wait[0] = wait pending_wait[0] = wait
else: else:
log.warning("webhook 429 on %s; no retry_after, backing off", url) log.warning("webhook 429 on %s; no retry_after, backing off (attempt %d/%d)",
url, attempts, self.max_retries + 1)
raise _Retryable(result) raise _Retryable(result)
if status >= 500: if status >= 500:
raise _Retryable(result) raise _Retryable(result)
@@ -241,7 +247,9 @@ class Webhook:
self._proxies.burn(proxy) self._proxies.burn(proxy)
return True return True
except Exception: except Exception:
log.warning("webhook: proxy burn failed; ending rotation", exc_info=True) # ERROR: an unexpected provider fault (burn() raising) is swallowed here and ends
# rotation, failing the send - it must be loud, not a quiet WARNING.
log.error("webhook: proxy burn failed; ending rotation", exc_info=True)
return False return False
@staticmethod @staticmethod