Skip to content

Bound default fetch completion after Load - #1499

Closed
lanyue-llk wants to merge 3 commits into
mainfrom
codex/bounded-default-page-completion
Closed

lanyue-llk wants to merge 3 commits into
mainfrom
codex/bounded-default-page-completion

Conversation

@lanyue-llk

Copy link
Copy Markdown
Contributor

Default moli fetch completion stopped at the Load event, so common post-load work such as a first animation frame, a zero-delay callback chain, a delayed fetch, or an inserted external script could be missing from the returned document.

This change makes the default done mode consume only already queued first-frame and zero-delay work, then observe DOM stability for at most three seconds inside the existing total timeout. Explicit load remains the exact Load lifecycle boundary, explicit domstable retains the caller's remaining total budget, intervals and delayed background timers are excluded, and the ready-task drain is capped at 16 tasks and 20 ms.

Validation:

  • cargo fmt --all -- --check
  • On the rebased commit (origin/main 4c589bd88): 6 focused lifecycle scenarios passed, covering the done/load boundary, post-load fetch mutation, an inserted external script, and the default CLI path.
  • The remaining 3 focused scenarios had passed before the final rebase; their post-rebase rerun was interrupted before execution by a local containerd storage I/O failure, not a test failure.
  • Representative native Markdown fetches completed for Kabum (96,824 bytes, 33.4 s) and Nintendo (52,948 bytes, 11.8 s) within the 45-second total budget. A single Douyin observation timed out waiting for the site's Load event; an earlier certified call from the same fixed build completed in 4.1 s, so no site-specific completion exception is included here.

@lanyue-llk

Copy link
Copy Markdown
Contributor Author

Closing after review. Extending default done with a bounded DOM-stability wait changes the public completion contract and added substantial latency on quiet pages. Explicit completion modes remain the supported mechanism; this approach is intentionally excluded from #1501.

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