Skip to content

fix(export): retire pending PDF image replies with their frame - #35419

Merged
OrcaWin merged 1 commit into
mainfrom
audit/pdf-image-reply-retirement
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
audit/pdf-image-reply-retirement

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 0

LoC: +3/-3

Release PDF image-readiness script replies with their document frame when an export is aborted or times out. The helper already waits for loading before this call; public frame execution preserves its main world and user-gesture parameter. Two existing test mocks adapt the API shape, with all assertions unchanged.

Validation: 38 existing helper/IPC tests, node typecheck, lint/format, nine quality groups, and all five unchanged precommit tasks pass. Actual hidden native43.8.1 controls use ordinary production-builder HTML and schedule owner abort immediately after the real public script invocation: N1/N10 baseline retained1/6 destroyed WebContents JS wrappers after5s versus0/0 with the fix. Native replies are not held or fabricated. Healthy no-image/image PDFs have identical extracted text and rendered pixels. Additional helper-only pending-image controls preserve the real60000ms timeout and release retained wrappers; normal Markdown parsing removes the lazy-image attribute used by that adverse fixture, so no normal-editor lazy-image bug is claimed.

Requester retirement reaches the helper through the existing abortWhenRendererGone signal in export IPC. Native proof is at controlled helper/HTML-builder seams; natural race frequency, full editor UI reproduction, heap bytes/RSS/CPU/latency savings and macOS/Windows execution are unmeasured. Required aggregate pnpm check:changed --maxWorkers=2 passed (exit 0, 20/20 checks, 212.2s) on author head 5ee24e5 vs main bbd635e; after a clean rebase onto main ce44117, the reviewer's rerun passed 21/21 checks in 110.2s on 572a0b0.

The initial package build unexpectedly auto-refreshed dependency state/postinstall while the shared aggregate was active; the incident and captured output are preserved. It reported already-up-to-date and native rebuild skipped; no zero-shared-write claim. Postrun pinned runtime hash verified. Later normal hooks used strict external tool dispatch without skipping tasks.

Frozen author: 5ee24e573fa6d502d9ce2407fc8eb0d7eaaa5d10 (rebased without changes to 572a0b00aa6). Evidence: /home/neil/.local/state/orca-electron-audit/pdf-image-reply-retirement-{candidate,implementation,review,root-review}/. This follows the already merged export-owner cancellation fix.

@OrcaWin
OrcaWin force-pushed the audit/pdf-image-reply-retirement branch from 5ee24e5 to 572a0b0 Compare October 29, 2026 03:30
@OrcaWin
OrcaWin marked this pull request as ready for review October 29, 2026 03:30
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable defect was found in the changed code.

Summary

Changes PDF image waiting to call mainFrame.executeJavaScript, so the request belongs to the document frame.

  • PDF exports retire image-wait replies with their document frame.

OrcaWin explicitly described the controlled native checks and the unmeasured platforms and full-editor behavior. Those limits are not reported as new defects.

Reviews (1) · Last reviewed commit: "fix(export): retire pending PDF image re..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 75de53f2-a8ae-49d1-9d0c-26200a7a163c
Commits

Reviewing files that changed from the base of the PR and between 26aa174 and 572a0b0.

Files selected for processing: 3
  • src/main/ipc/export.test.ts
  • src/main/lib/html-to-pdf.test.ts
  • src/main/lib/html-to-pdf.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

htmlToPdf now executes the image-readiness script through webContents.mainFrame.executeJavaScript. The Electron test doubles in the PDF and export tests now provide executeJavaScript on webContents.mainFrame.

Priority: Normal

Merge Risk: Minimal · up to 572a0

The PDF export change has no identified merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description follows the template's main sections (LoC summary, What Changed-style summary, validation, and a note on scope), but it does not follow the template structure. It lacks the ELI5, Linke… Add an ELI5 section in plain language. Add a What Changed section that states the before and after behavior and the mechanism changed. Add a Why section that explains why this approach was chosen over alternatives. Link a real issue in the …
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title names the change: PDF image-readiness replies are retired with their document frame in the export fix. The changeset does switch the helper's script call to webContents.mainFrame.executeJava…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: PDF image-readiness replies are retired with their document frame in the export fix. The changeset does switch the helper's script call to webContents.mainFrame.executeJavaScript so pending replies are released when a frame is gone. The title uses the conventional fix(export) prefix and is specific to the main change, though it leans on the term 'retire' and does not mention the abort/timeout trigger.

Full details: Description check

Explanation

The description follows the template's main sections (LoC summary, What Changed-style summary, validation, and a note on scope), but it does not follow the template structure. It lacks the ELI5, Linked Issue (the 'Fixes #' line is absent and no issue is linked), Visual Proof (required for behavior changes; no N/A reason given), Review, Agent skill upstream boundary, and AI Disclosure sections. The Testing section gives validation results but does not include the template's checklist items or platform list in the expected format. It also includes long, dense evidence paths and frozen-commit details that do not match the template. Required items are missing, so the description is not complete.

Resolution

Add an ELI5 section in plain language. Add a What Changed section that states the before and after behavior and the mechanism changed. Add a Why section that explains why this approach was chosen over alternatives. Link a real issue in the Linked Issue section using 'Fixes #<number>'. In the Visual Proof section, add a before/after reference or write N/A with a reason. Fill in the Testing section with the platforms actually tested (the description says macOS/Windows were not run). Complete the Review, Agent skill upstream boundary, and AI Disclosure sections, or mark them as not applicable. Tick or update the checklist items. Trim the evidence and log paths, which do not belong in the PR body.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit 05922cc into main Oct 29, 2026
66 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