fix facebook feed too_short zero rows - #5
Merged
lawmight merged 1 commit intoSep 10, 2026
Merged
Conversation
…tubs Live smoke showed articles=2 too_short + 1 decoy while mainTextLength≈972. Short role=article nodes are often Stories/composer chrome; promote to parent FeedUnit when post evidence exists, add feedUnitContainers candidates, scroll incrementally with hydration-aware continuation, and include textLength in too_short rejection diagnostics. Co-authored-by: Tom Coustols <tom.coustols@tcdynamics.fr>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideFixes zero-row Facebook feed extraction by promoting short article chrome to parent FeedUnits, continuing incremental scrolling during likely lazy hydration, and providing diagnostics that distinguish chrome stubs from decoy or anti-scrape content; regression tests cover each behavior. Sequence diagram for promoting chrome stubs to FeedUnitssequenceDiagram
participant Extractor
participant FeedDOM
participant FeedUnit
participant Diagnostics
Extractor->>FeedDOM: querySelectorAll role=article
FeedDOM-->>Extractor: short article header
Extractor->>FeedUnit: resolveArticleContainer
FeedUnit-->>Extractor: parent with post body and post markers
Extractor->>Extractor: extractPost
Extractor->>Diagnostics: record too_short samples for unresolved stubs
Extractor-->>Extractor: return readable post rows
Flow diagram for Facebook feed extraction with hydration recoveryflowchart TD
A[Load Facebook feed] --> B[Incremental scrollBy]
B --> C[Extract feed candidates]
C --> D{Rows found?}
D -->|Yes| E[Return feed rows]
D -->|No| F{"needsMoreFeedHydration(payload)?"}
F -->|Yes| B
F -->|No after stalled passes| G[Classify rejection diagnostics]
G --> H[Raise readable error or anti-scrape error]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
lawmight
marked this pull request as ready for review
September 10, 2026 20:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Live smoke after PR #4:
articles=2, mainTextLength=972, rejected=3, too_short=2, decoy_content=1— Adolph decoy correctly caught, but two shortrole=articlechrome stubs blocked extraction while real posts may live in parent FeedUnits or below the fold.Type of Change
Changes
resolveArticleContainer: promote shortrole=articleheaders to parent FeedUnit when post menu/author/permalink evidence existsfeedUnitContainers: explicit FeedUnit candidates in extraction pipelinescrollBy(12 passes, 1.2s sleep); continue whenneedsMoreFeedHydration(too_short + mainTextLength≥400 + post markers)textLengthon rejection samples;too_short(len=N)in error hints; chrome-stub note when stubs coexist with decoysChecklist
npm test -- clis/facebook/— 117 passed (French, Adolph/decoy, messenger, short-article fixture)Post-merge verification
opencli facebook feed --limit 5on tom.coustols should return LVLUP (or similar) OR fail withtoo_short(len=…)chrome stub explanation + decoy — not a bareno rowswith unexplained shorts.Summary by Sourcery
Restore reliable Facebook feed extraction when short chrome placeholders and decoy posts coexist with real feed content.
Bug Fixes:
Enhancements:
Tests:
Summary by cubic
Fixes Facebook feed extraction returning zero rows when short
role=articlechrome stubs (Stories, composer) coexist with decoy posts. The extractor now promotes those stubs to their parent FeedUnit when post evidence exists, so real posts like LVLUP are extracted instead of being rejected as too short.Changes
feedUnitContainersas explicit extraction candidates.textLengthon rejection samples and includestoo_short(len=N)in error hints.Written for commit 661236c. Summary will update on new commits.