zcode 0.1.45: the daily claim reads the feed as the current client does (#678)

The marketing feed (touch) and the claim now go out under ZCode 3.17.2's
version header. jinpy666 found that under the pinned 3.16.3 the feed
answers empty, while under 3.17.2 the day's banner shows, and checked it
against the live API. The check-in no longer reads /billing/preview,
which the v3.17 client doesn't poll (docs/marketing-touch-client.md in
zai-org/ZCode@a9fe401).

Reviewed at f805d97 and run there on mote:
- bun test packages/zcode: 187 pass, 0 fail.
- bun scripts/check.mjs: clean.
- Broken by hand: with MARKETING_VERSION set back to 3.16.3, 4 tests go
  red (the touch and claim version pins, and the card's feed read).

Not tried here: a live feed or claim. No ZCode account was in a
sandbox, so the live run is jinpy666's (10 accounts: 7 captcha, 3
inactive).

Reported by jinpy666 (#676), who wrote the fix.
This commit is contained in:
Jinpy
2026-11-03 21:29:46 +08:00
committed by GitHub
parent 0b8cc01937
commit 017a7ee3b2
7 changed files with 177 additions and 182 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ beforeEach(() => {
case "/api/monitor/usage/quota/limit": return ok({ limits: [{ type: "CREDIT_LIMIT", unit: 6, number: 1, percentage: 90 }] })
case "/api/biz/team/subscribe/product/querySubscribeDetail": return ok({ hasSubscription: true, status: "EFFECTIVE", memberGrantStatus: "VALID", productName: "Team Max" })
case "/api/biz/customer-package-reset/list": return ok({})
case "/api/v1/zcode-plan/billing/preview": return ok({ plans: [{ plan_id: "trust", name: "Trust Build" }] })
case "/api/v1/marketing/touch": return ok({ deliveries: [{ banner: { background: { args: { zcode_plan: { name: "Trust Build" } } }, buttons: [{ action: { type: "claim_zcode_plan", args: { plan_id: "trust" } } }] } }] })
case "/api/anthropic/v1/messages":
case "/api/v1/zcode-plan/anthropic/v1/messages": return ok({ type: "message", content: [] })
default: return new Response("", { status: 404 })