Skip to content
Vidabug
Sign inStart a project
CASE STUDY · CLIENT NAME REMOVED

A training lesson of a web app

9 defects found, 9 fixed and proven

While filming this app, Vidabug met 9 defects. The most serious: Generate course opened a 404 page instead of the generation engine. Each is below: what went wrong, why, and how to avoid it in your own software.

What went wrong, and how to avoid it

  1. Generate course opened a 404 page instead of the generation engine Why: gatewayBaseUrl() in packages/lms-commerce/src/lib/gateway-url.ts preferred LMS_ENGINE_BASE_URL (the internal, server-side engine address) over LMS_GATEWAY_PUBLIC_URL, while engineHomeEntryPath() picked the /engine path because a gateway was configured. With the documented dev environment (packages/lAvoid it: How it was fixed: packages/lms-commerce/src/lib/gateway-url.ts: use LMS_ENGINE_PUBLIC_URL, then LMS_GATEWAY_PUBLIC_URL, and only then LMS_ENGINE_BASE_URL as the browser origin; the resolution-order. Add a test for the failing action and the edge case behind it, so a regression is caught before users meet it.
  2. The engine page never became usable through the gateway, so Enter Classroom stayed disabled and the brief never loaded Why: dev-runner.mjs rewrote websocket upgrades for /_next/hmr to the ai-proxy, a Next app whose route handlers cannot accept an upgrade, so the engine's dev client lost its socket before the handshake and the page served through the gateway never hydrated.Avoid it: How it was fixed: packages/lms-gateway/src/dev-runner.mjs: send /_next websocket upgrades straight to the engine (ENGINE), with a comment explaining why. Add a test for the failing action and the edge case behind it, so a regression is caught before users meet it.
  3. Publish screens promised creators 80% of each sale, but the payout ledger pays 75% after VAT; prices were labelled in dollars whatever the currency Why: The three screens hardcoded 80% (the Course.revenueSharePct column default) and computed earnings as 0.8 x price, while computeCreatorShare/splitMarketplaceSale treat 80 as 'use the platform rate' from pricing.config.json (take_rate 0.25) and remove VAT first. The code base's own rule is that applicAvoid it: How it was fixed: packages/lms-core/src/billing/marketplace.ts: creatorShareTerms() resolves the creator's percent exactly like computeCreatorShare, plus the VAT rate and payout hold. packages/lms-c. Add a test for the failing action and the edge case behind it, so a regression is caught before users meet it.
  4. Opening a generated classroom bounced the creator to the pricing page Why: inject-overlay.ts gave the overlay the commerce origin as its API base. Behind a gateway the classroom is served from the gateway origin; commerce sends no CORS headers and does not serve trial-status at all (it lives on the ai-proxy and is routed by the gateway).Avoid it: How it was fixed: packages/lms-ai-proxy/src/lib/inject-overlay.ts: when LMS_GATEWAY_PUBLIC_URL is set, the overlay calls APIs through the gateway origin; links still go to commerce. Add a test for the failing action and the edge case behind it, so a regression is caught before users meet it.

Read the full report on the home page →