unmapped backers: stop the phantom finding (the members query had no createdAt)
ci/woodpecker/push/woodpecker Pipeline was canceled
ci/woodpecker/push/woodpecker Pipeline was canceled
The first production run reported a null-account node as an uncredited payer. The cause was in my port, not the data: the members query selected id-less, date-less nodes, so every null-account node fell into the date "" bucket, matched no same-day order, and was reported as unattributable — while the host-side script (correctly) said clean. Two fixes: select id + createdAt in fetch_all_member_nodes, and never emit a null-account finding when the node carries no date — there is nothing to attribute it against, and guessing is what produced the phantom. 27 checks in the suite.
This commit is contained in:
1 parent
13b6131652
commit
bf1e5f013b
2 files changed
+18
-1
No files matched your search
@@ -121,6 +121,11 @@ async def main():
|
||||
node("BACKER", "Membership", account=False, created="2026-11-01T00:00:00Z"),
|
||||
# null-account node on a day with an UNMAPPED payer -> finding
|
||||
node("BACKER", "Membership", account=False, created="2026-11-02T00:00:00Z"),
|
||||
# null-account node with NO date -> NOT a finding: there is nothing to
|
||||
# attribute it against, and reporting it is how a phantom appears (the
|
||||
# members query did not select createdAt, so every such node looked like an
|
||||
# uncredited payer on the day "").
|
||||
{"role": "BACKER", "tier": {"name": "Membership"}, "createdAt": None, "account": None},
|
||||
]
|
||||
ORDERS[:] = [
|
||||
order("alice", day="2026-11-01"),
|
||||
@@ -134,6 +139,8 @@ async def main():
|
||||
classes = sorted(res.get("classes") or [])
|
||||
check(f"four findings in three classes (got {res.get('findings')} {classes})",
|
||||
res.get("findings") == 4 and classes == ["hidden", "null-account", "org", "visible"])
|
||||
check("a node with no createdAt is NOT reported (nothing to attribute it against)",
|
||||
sum(1 for f in res["detail"] if f["class"] == "null-account") == 1)
|
||||
slugs = sorted(f["slug"] or "(null-account)" for f in res["detail"])
|
||||
check(f"exactly the unmapped member-ish nodes are findings (got {slugs})",
|
||||
slugs == ["(null-account)", "gammaorg", "han", "vic"])
|
||||
|
||||
Reference in new issue
Block a user