Skip to content

Capture authenticated page DOM on browser-post failure - #68

Merged
ralyodio merged 1 commit into
masterfrom
capture-failure-dom
Jul 4, 2026
Merged

ralyodio merged 1 commit into
masterfrom
capture-failure-dom

Conversation

@ralyodio

@ralyodio ralyodio commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Per the plan: the remaining browser-post failures (Facebook/Reddit/Instagram/Threads) are logged in but hit stale composer selectors — unfixable without the real authenticated DOM. This captures it.

What

On any selector failure, the worker captures the page it was looking at — URL + trimmed HTML — into sp_post.debug_url / sp_post.debug_html. That authenticated DOM can then be inspected (via Supabase) and the selectors fixed against ground truth instead of guessed.

How (zero change to posting logic)

page is hoisted out of each flow's try, and a single catch wraps every platform flow, throwing a BrowserPostError carrying pageUrl + pageHtml (capped at 600 KB). browserPost.fail() persists them. Success paths are byte-for-byte unchanged — only the failure path gains capture. Applied to all 7 browser platforms via two global edits.

Migration adds nullable debug_url / debug_html (overwritten each attempt). Already applied to the project (additive, safe pre-deploy).

Next

After deploy, retry the 4 failing platforms once → the worker stores each real compose DOM → I read them via Supabase and fix Facebook/Reddit/Instagram/Threads selectors precisely.

Verification

  • tsc --noEmit clean; tests/sp/* 35/35
  • Capture wraps all 7 flows; success paths unchanged

🤖 Generated with Claude Code

The remaining browser-post failures (Facebook/Reddit/Instagram/Threads) are
logged-in but hit stale composer selectors, which can't be fixed without the
real authenticated DOM. On any selector failure the worker now captures the
page URL + trimmed HTML into sp_post.debug_url/debug_html so the actual DOM can
be inspected and selectors fixed against ground truth.

Implemented with zero change to the per-platform posting logic: page is hoisted
out of the try and a catch wraps every flow, throwing a BrowserPostError that
carries the URL + HTML; browserPost persists them in fail(). Success paths are
untouched.

Migration adds nullable debug_url / debug_html (overwritten each attempt).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 5a29bf6 into master Jul 4, 2026
8 checks passed
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