No description
The Purchase Order form never reached the server. Creating a PO with two or more "Manual Entry" rows fired N parallel POSTs to /api/collections/stock_items/records via Promise.all. The PocketBase JS SDK auto-cancels any in-flight request whose method + path match a newer one, so the first POST was aborted with: ClientResponseError 0: The request was autocancelled. Promise.all then rejected before the PO create ever ran, so the PO was never created - only an orphan stock item per attempt. Confirmed against the production PB logs: two stock_items POSTs today, zero purchase_orders POSTs, and two orphan stock_items rows with no PO. Fixes: - src/lib/pocketbase.ts: pb.autoCancellation(false) on the browser client. Every server-side client in this repo already did this (scripts/*.mjs, server/po-api.mjs) - the browser client was the one place it was missing. - PurchaseOrderForm: resolve rows sequentially instead of Promise.all, and build the snapshot in the same pass so manual rows carry the real stock item id instead of "". - PurchaseOrderForm: disable the submit button while submitting, so a double click cannot create two POs. - PurchaseOrderForm: compare SKUs trimmed, so a stray trailing space does not create a duplicate stock item. - po-photo-ingest.mjs, jei_skill.ts, setup-users.js: same autoCancellation(false) guard. |
||
|---|---|---|
| .cursor | ||
| .playwright-mcp | ||
| backup | ||
| docs | ||
| n8n | ||
| pocketbase | ||
| public | ||
| scripts | ||
| server | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| .mcp.json | ||
| AI_RULES.md | ||
| app-overview.png | ||
| components.json | ||
| dashboard-updated.png | ||
| eslint.config.js | ||
| index.html | ||
| LOGGING_IMPLEMENTATION.md | ||
| login-mobile-final.png | ||
| login-mobile.png | ||
| login-page-final.png | ||
| login-page.png | ||
| nixpacks.json | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| quote-dialog.png | ||
| quote-fixed.png | ||
| quote-form.png | ||
| quote-page.png | ||
| quote-page2.png | ||
| quote-screenshot.png | ||
| README.md | ||
| setup-users.js | ||
| tailwind.config.js | ||
| tailwind.config.ts | ||
| test-logging.js | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vercel.json | ||
| vite.config.ts | ||