Repository navigation
fix: close function pages when user code fails - #5554
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. Walkthrough
ChangesFunctionRunner cleanup
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change closes function pages before disconnecting when user code fails, while preserving the original error and logging cleanup failures; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice. Comment |
|
Current-head status:
No further code changes were needed. |
Code review — PLT-1524 (OSS half)Reviewed against the ticket's items 11-13. All three are implemented as specified, and the ordering constraint that matters (close the page before Notes: 1. MINOR —
|
|
Fix itself is right — awaiting Two spots the same reasoning applies but didn't get covered: 1. The success path still doesn't await the close ( const response = await this.runCode(code, context);
console.debug(`... closing page.`);
this.page.close().catch(this.log); // <- not awaitedOnce 2. Setup between Minor, not blocking: the Node |
cb94894 to
f35cdb1
Compare
|
Addressed both human review follow-ups on the rebased head.
Rebase and verification:
The findings were top-level PR comments, not review threads, so GitHub provides nothing to mark resolved. |
🤖 I have created a release *beep* *boop* --- ## [2.56.1](v2.56.0...v2.56.1) (2026-09-01) ### Bug Fixes * **AUTO-288:** preserve raw profile paths during token shimming ([#5547](#5547)) ([2222d9f](2222d9f)) * close function pages when user code fails ([#5554](#5554)) ([a36bb85](a36bb85)) ### Build System & Runtime * bump Node to 24.20.0 and npm to 11.19.1 ([#5553](#5553)) ([f1e5077](f1e5077)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: browserless-actions-bot[bot] <186328842+browserless-actions-bot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
What changed
Function runs now close their page before disconnecting when user code throws or rejects. Cleanup failures are logged without replacing the original user error, and the runner module remains importable in Node for focused tests.
Why
A failed function run could leave its page alive until the surrounding browser was eventually released. Closing the page while its CDP transport is still connected releases those resources immediately.
Testing
npm run build:testsnpx mocha --no-package build/shared/utils/function/client.spec.js— 4 passingSummary by CodeRabbit