3 Commits
Author SHA1 Message Date
inference-admin 2cde368c1e resolve payer: authenticate the lookup — without the token OC hides the email
ci/woodpecker/push/woodpecker Pipeline was canceled
Second live-only bug in the same helper. Sent unauthenticated, OC answers the
public view of an account: name comes back, email does not. A hand query with the
Personal-Token header returned conor.canaday@gmail.com for the very slug the
helper reported as email=None — so the fix would have resolved nobody, silently,
while looking like it worked.

The test now pins the header (the stub records what it was called with), because
the failure mode here is an absence, and an absence is exactly what a stub
forgets to check.
2026-11-13 22:14:36 +00:00
inference-admin 9c10e627fc resolve payer: read the response's JSON (the stub hid this)
ci/woodpecker/push/woodpecker Pipeline was canceled
_oc_graphql_post returns the RESPONSE — it is a retrying wrapper around
client.post — so fetch_account_by_slug has to call .json() on it. My unit test
stubbed it as a dict, so the test passed and the first live call in the container
died with "Response object has no attribute get".

The test now stubs the real shape (a response wrapper with .json()). Folding it
in here rather than hiding it: a stub that does not match the real return shape
certifies nothing.
2026-11-13 22:13:22 +00:00
inference-admin 5a7380686c webhook: a first-time contributor's order must not vanish in silence
ci/woodpecker/push/woodpecker Pipeline was canceled
On 2026-11-13 21:59:43 Open Collective delivered order.processed for a live
$5/month membership (Conor W, conor.canaday@gmail.com, order
or_eU8gRkrPCvFsaYHrgiCfz). The portal answered 200 and did nothing.

The membership branch resolves the payer by SLUG against the collective's
members list:

    members = await fetch_members()
    member = next((m for m in members if m["slug"] == slug), None)

and a first-time contributor's account is not in that list yet — OC reports the
payer as guest-…/incognito-…. So `member` was None, the branch fell through, and
because the delivery had SUCCEEDED there was no error to record either: no
account, no welcome email, no credit, no log line. The sweep's unmapped-backers
check found it hours later, which is the wrong place to find it.

Now an unknown payer is resolved from the order's account slug
(`Individual.email`, which OC exposes for an ordinary guest checkout) and handed
to the same provisioning path a known member gets. When even that yields no
email — an incognito profile, hidden on purpose — the webhook logs at ERROR that
nobody was provisioned or credited, instead of shrugging.

The defect worth naming is the SHAPE: an `if` with no `else` on a money path,
where doing nothing leaves no trace. tests/test_resolve_payer.py pins the
resolution cases (guest with email, incognito, unknown account, read failure, no
token) and the fact that the branch can no longer fall through quietly.
2026-11-13 22:12:02 +00:00