5499be853603b3bf2c682d2eeb4e01012c2c352e
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
28881086c5 |
zcode: the daily claim is tested on #503's real marketing/touch reply
kongbai01203 posted the real GET /api/v1/marketing/touch?seq=0 reply
(10-30 22:11 +08:00, comment 6526694290) for the account that claimed
ZCODE WEEKEND BUILD. It is in packages/zcode/testdata/touch-1030-wk.json
as their bytes. Their paste was cut inside
success_popup.description.content's HTML (2510 of 2628 characters), so
only the closing `"}}}}]}}` is added and their trailing "…" taken off.
0.1.39's parser handles it as it is; no change to index.mjs, no version
bump (the package's published files are unchanged):
- checkin: the one claim_zcode_plan button is claimed once with
{"plan_id":"zcode-v3-start-plan-1030-wk"}, named ZCODE WEEKEND BUILD;
the close button ("args": null) and the success popup's navigate and
copy_text buttons claim nothing, and nothing goes to touch/action.
- the same delivery with its claim button taken out is inactive, though
its background and success popup still carry the zcode_plan.
- after the claim, deliveries is empty (their second finding, count
theirs, bytes the real reply's top level): inactive, not failed.
- the card's claim line from the real feed: "1 · ZCODE WEEKEND BUILD".
What the real reply has that the 0.1.39 hand-made fixture didn't:
button text as {format, content}, a close button's args null, a bundle
background, resource_position and priority, and a success_popup inside
the banner repeating the zcode_plan.
Run on mote: HOME=$(mktemp -d) bun test (3880 pass, 0 fail) and bun
scripts/check.mjs (exit 0). Broken by hand: claiming a zcode_plan's
plan_id with no claim button turns "the real delivery without its claim
button" red (the hand-made closeOnly case stayed green); naming a plan
from a later zcode_plan when the first is the same turned the two
real-feed tests red. Not tried: a complete, uncut touch reply (the
reporter will post one at the next window), and a real claim through
the plugin.
|
||
|
|
2e580cfead |
zcode 0.1.39: gift plans are also claimed from the ZCode app's banner feed (#503)
kongbai01203 found on 10-30 that a ZCode claim banner's plan (ZCODE
WEEKEND BUILD, 500M GLM-5.3-Flash tokens) is in neither
/billing/preview nor /billing/current while the app shows the banner,
so 0.1.35's daily claim said "no ZCode gift plan to claim". The app
reads the banner from GET /api/v1/marketing/touch?seq=<n>: each
delivery's banner button with action type claim_zcode_plan carries the
plan_id, and the claim is the same POST /billing/claim. Their capture
has a real code 0 claim reply ("Plan claimed successfully.").
- toClaim reads both lists (the feed first, then the preview) and keeps
each plan_id once; claimDaily and the card's claim line use it.
- The feed goes out with what the capture shows the app sends: the
session, X-Device-Mid, X-ZCode-App-Version and X-Client-Language
(the system locale), seq counting up from 0 per process.
- A list that doesn't read is failed (asked again later), never
"nothing to claim"; a plan claimed beside it is still named.
- claimOne is unchanged; README says the two lists and that a plan just
claimed may show in neither billing list until its effective_at.
Run on mote (macOS, Bun 1.4.2, temp HOME), on
|
||
|
|
7673cd06de |
zcode 0.1.37: an account with no gift plan to claim is no check-in event, not a failed check-in
hykql (Discord, magpie v0.1.2143, zcode 0.1.36) saw every ZCode account's
daily check-in fail with "gift plans to claim: no plan list in the reply",
a Start Plan account and one with no GLM Coding Plan alike. ZCode's
GET /billing/preview answers an account with nothing to claim with no
data at all, not data.plans []:
{"code":0,"msg":"","logid":"202610300535585c4e3de75769b684da87"}
(the owner's account, read 10-30 with GETs only, with and without the
X-ZCode-App-Version / X-Platform headers; both the same). #503's capture
of 10-29 had "plans": [], so 0.1.35 took a missing list as unreadable.
previewPlans now reads the list for both the claim and the card's claim
line: no data, data null, or data without plans (or plans null) is a
list of none, so the check-in is "inactive" (magpie shows "No check-in
event now"). call has already judged the code, so only a code 0 reply
gets here. Data that isn't an object, or plans that aren't a list, still
don't read and stay failed, never claimed.
Run (wsl-run on magpie-desktop, HOME=$(mktemp -d); mote was at load
220-250): `bun test` in packages/zcode, 152 pass 0 fail; the whole
repo's `bun test`, 3720 pass 0 fail of 3727 across 298 files;
`bun scripts/check.mjs zcode` ok. The new checkin test (the real
no-data reply, data null, data without plans, plans null) is red on
0.1.36's index.mjs (1 fail). Broken by hand: plans that aren't a list
read as none turns "a preview that doesn't read is failed" red; put
back, green.
Not tried: a real claim (no account has a plan to claim now), and the
official ZCode client's own parse of this reply (no ZCode app on hand);
the fixture is the vendor's real bytes. Not changed: #505 (freeFirst)
touches other parts of index.mjs.
|
||
|
|
8ebbaa5880 |
zcode 0.1.35: claims each account's ZCode gift plans daily through magpie's check-in (#503)
ZCode hands out gift/resource plans that sit on an account until claimed,
and an account used only through magpie let them lapse. The plugin now has
auth.checkin, so magpie's daily check-in (`magpie accounts checkin`, and
Settings -> Daily check-in, where ZCode is off until the user turns it on)
claims them, the shape the MiniMax, Qoder and Loomy plugins use.
claimDaily reads GET /api/v1/zcode-plan/billing/preview (the list the card
already read) and POSTs {"plan_id"} to /billing/claim for each plan it
lists, with the account's ZCode jwt, X-Device-Mid, X-ZCode-App-Version and
X-Platform, as kongbai01203 captured them. The claim is judged by the body's
code: 0 claimed, 1003 "target already exists" (HTTP 200) done, 3007 or a
captcha message "captcha" (claim it in the ZCode app), anything else, an
HTTP error without a code or a body that isn't JSON failed. A failed read is
never taken as claimed, and no answer carries signIn, so a failed claim
leaves the account as it was. Nothing listed is inactive; a key-only
account is ineligible; an expired ZCode session is failed with no request.
A plan claimed now drops the account's cached route, so the next request
uses it. One failed among several makes the whole answer failed (with the
claimed ones named), so magpie asks again later and the claimed ones then
answer 1003.
Run (on mote, HOME=$(mktemp -d)): `bun test` in packages/zcode, 150 pass;
the whole repo's `bun test`, 3698 pass 0 fail of 3706 across 297 files;
`bun scripts/check.mjs zcode` ok. checkin.test.mjs covers preview empty,
one plan claimed with code 0 (request body and headers checked), 1003,
3007, seven unreadable claim answers, five unreadable previews, one
claimed + one failed then asked again, and key/expired accounts asking
nothing. Broken by hand: 1003 -> claimed and an unreadable reply ->
claimed turned three of these tests red; put back, green.
Not tried: a real claim that answers code 0. No account has a plan to
claim right now (every preview answers plans: []), so the code 0 body is
a fixture carrying only its code, and nothing else of it is read. On
10-06 a claim without the ZCode app's Aliyun captcha was answered 400
code 3007 (#30); if ZCode still asks that for a fresh plan, the check-in
says "captcha" and the plan is claimed in the app, as before. The real
1003 reply is in the tests as captured.
|