Skip to content

fix(audit): stop re-billing Lighthouse on workflow and parse retries - #170

Open
Ayush7614 wants to merge 1 commit into
every-app:mainfrom
Ayush7614:fix/lighthouse-metered-step-retries
Open

fix(audit): stop re-billing Lighthouse on workflow and parse retries#170
Ayush7614 wants to merge 1 commit into
every-app:mainfrom
Ayush7614:fix/lighthouse-metered-step-retries

Conversation

@Ayush7614

@Ayush7614 Ayush7614 commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • Site-audit Lighthouse batches used default Cloudflare Workflow retries (limit 5). A mid-batch failure after DataForSEO already charged (e.g. R2/D1 write) re-ran the whole batch and billed again.
  • Post-assertOk Lighthouse parse failures threw plain Error, so Autumn metering skipped the spend and in-process retries called DataForSEO again.
  • Aligns metered Lighthouse steps with rank-check’s single-attempt pattern, meters charged parse failures, and soft-fails instead of retrying billed errors.

How to review

  1. siteAuditWorkflowPhases.tsLIGHTHOUSE_BATCH_STEP_CONFIG with retries.limit: 0
  2. dataforseo/lighthouse.ts — billing built before parse; parse failures become DataforseoChargedTaskError
  3. audit/lighthouse.ts — break the 3-attempt loop on charged errors
  4. Unit test covers the parse-after-bill path

Test plan

  • pnpm exec vitest run src/server/lib/dataforseo/lighthouse.test.ts src/server/lib/audit/lighthouse.test.ts
  • Spot-check a hosted site audit Lighthouse batch failure does not re-fetch already-charged URLs

Metered lighthouse batches used default Workflow retries and treated
post-charge parse failures as plain errors, so a mid-step failure or
malformed payload could call DataForSEO again and skip Autumn metering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant