Skip to content

v0.4.1

@skiddgoddamn skiddgoddamn tagged this 05 Aug 14:42
Two failures seen while granting a franchise on a live account:

1. `npx tsx src/run.ts gc_pay_order` died with `ReferenceError: __name is
   not defined`. esbuild (which tsx runs on) rewrites named inner functions
   into `__name(...)` calls; the callback is then serialized into the page,
   where no such helper exists. Only `payDeal` has named helpers today, so
   the hazard was latent everywhere else. Every navigation now installs a
   no-op `__name` shim (`ensureEvalShim`), passed as a string so it is not
   itself transpiled — `tsx src/*.ts` and `dist/*.js` now behave the same.

2. That crash surfaced as a plain FAIL even though the order HAD been
   created — a single-step operation can throw after the mutation lands.
   `gc_create_order` now snapshots the user's deals before writing and
   reports the deal that actually appeared (which also drops the "newest
   deal must be ours" race), and a failing completion step returns the
   deal id plus the gc_pay_order call to finish it.

Also: a 0₽ order has nothing to pay, so GetCourse completes it itself.
`payDeal` now detects an already-finished deal and returns success instead
of reporting FAIL because «Добавить платеж» is gone.
Assets 2
Loading