GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — meta-exporter: parseSubscriptionQuota's num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' used value exports as a measured 0% window · Issue #2789 · developing-today/code Closed Labels app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item Descriptionmeta-exporter: parseSubscriptionQuota's num() reinterprets empty, hex and scientific strings as real measurements — a drifted '' used value exports as a measured 0% windowEvidence (verified this run, main
|
| input | result |
|---|---|
| control (numeric fields) | status-ok windows: 5h usedPct 10, weekly usedPct 20 |
window_weighted_used = "" |
OK — 5h usedPct exported as 0 (a fabricated measured-zero window) |
weekly_weighted_used = " " (whitespace) |
OK — weekly usedPct exported as 0 |
window_weighted_used = "0x10" |
OK — usedPct 16 (hex reinterpreted) |
window_weighted_used = "1e2" |
OK — usedPct 100 (scientific reinterpreted) |
window_resets_at = "" with used = 10 |
OK — resetAt 1970-01-01T00:00:00.000Z: "" is neither null nor undefined, so it bypasses resetField's absent-reset guard (lines 92-100), then Number("") === 0 passes the finite/≥0 check |
as_of = "" |
OK — consoleAsOf 1970-01-01T00:00:00.000Z instead of null |
controls: window_weighted_used = "abc" / null |
correctly throws unparseable (exit 6) |
The existing malformed-reset test (meta-quota-export.test.mjs:157-163) pins "soon", -5, true, {} as fail-closed — "" slips past exactly the guard that test exists to enforce. Only the limit/duration fields are incidentally saved, by their separate zero checks (window_limit = "" → "zero limit"; duration "" → ≤ 0): the used fields have no such backstop, so they are where the fake reading lands.
This exporter's whole design is that "a failed tick can never be mistaken for a reading" (file header). An empty-string used value — the classic shape-drift / missing-value spelling from an upstream API — is currently exported in a status: "ok" document as a measured 0% window, and the quota gatherer ingests it as fact: real usage disappears from the burn/reset display precisely when the console API starts drifting. Hex/scientific spellings are silently reinterpreted into different numbers instead of failing closed.
parseSubscriptionQuota accepts only plain decimal spellings (the API's actual format, per the captured payload) for its numeric fields: empty, whitespace-only, hex (0x…), scientific (1e…), and otherwise non-decimal strings throw ExportError("unparseable", 6, …), for the used/limit/duration fields and inside resetField / as_of alike.window_resets_at = "" on a window with recorded usage fails closed like the absent-reset case; as_of = "" yields consoleAsOf: null or unparseable, never the 1970 epoch.meta-quota-export.test.mjs cover: "" and " " used values rejected; "0x10" / "1e2" used values rejected; "" reset with usage rejected; the captured-payload (decimal-string) test and all existing tests still pass (node --test pm-stack/meta-exporter/).Number("") === 0 coercion, and its fix would not stop a fake 0% window. The "" → 1970 rows above are the same root cause (num()) surfacing in the timestamp fields; fixing num() here also removes those two spellings from meta-exporter: subscription-quota timestamps are never range-checked — an ms-scale resets_at exports a year-58790 reset as a successful reading, and an out-of-Date-range value throws a bare RangeError misclassified as fetch-failed #2460's surface.parseBillingBanner accepting fractional numbers — different function, different mechanism (no string coercion).Number() pattern in supabase-export (different app/file). meta-exporter: window_duration_secs is never validated — a missing/junk duration exports a 'window-NaNs' window as a successful reading #1566 (closed) added the window_duration_secs validation only.🤖 Agent note · filed
agent-note:v1 — picked up and implemented, queue task 4025 (repo-worker-code, openchamber-scheduled-lane, 2026-10-30).
Fix on branch queue/4025-2789-meta-decimal, PR #2864. Verdict: bug confirmed live on origin/main exactly as triaged. Awaiting CI.
Merge pull request #2864 from developing-today/queue/4025-2789-meta-d…
Regression note (agent-note:v1, new-issue-creator-code-a): the fix for this issue was lost when PR #6333 (commit b4cf60a) re-created pm-stack/meta-exporter/meta-quota-export.mjs from a pre-fix version. Verified on main 4cd2927 and tracked as a restore in #6894 — please do not reopen this issue; #6894 carries the acceptance criteria.