Skip to content

fix(plugins): skip nested packages in dev folders and summarize blocked frame requests - #37300

Merged
nwparker merged 2 commits into
mainfrom
nwparker/plugin-b8-dev-folder-papercuts
Nov 2, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/plugin-b8-dev-folder-papercuts

Conversation

@nwparker

@nwparker nwparker commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​298 $\color{#cf222e}{\Huge{\mathbf{−}}}$​15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​283
Prod 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​207 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​190

ELI5

Two annoyances hit while building the Excalidraw plugin. A plugin folder with a nested build/node_modules was refused for having too many files, so authors had to delete it before loading. And when a plugin page tried to fetch something from the internet, which plugin frames don't allow, the logs filled with one line per request, so real errors were dropped.

What Changed

  • Dev folders skip nested packages. Hashing and watching a development plugin folder now skip node_modules, .orca and .git at any depth, not just the top level. A dev folder with build/node_modules (2,000+ files) loads. Installed plugins are unchanged: they still hash everything except the root .git.

  • Blocked requests are summarized. Network refusals and content-policy blocks from a plugin frame are counted per kind and origin, and logged every 5 s and when the frame closes, for example:

    [frame] blocked font-src https://unpkg.com (x48): plugin frames have no network

    They no longer count toward the 20-lines-per-10-s cap, so real errors still get through.

Why

Both came from the from-scratch editor build and from Excalidraw's own README, which tells authors to delete build/node_modules before loading. Skipping only dev folders keeps installed-plugin integrity unchanged. Summarizing blocks tells the author exactly what was blocked and why, in one line.

Linked Issue

N/A (maintainer).

Visual Proof

N/A: log output and folder loading only; covered by tests.

Testing

  • New tests:
    • Dev hashing: ignores a nested build/node_modules with more than 2,000 files, plus nested .git and .orca, while installs still hash nested node_modules.
    • Watcher: ignores nested paths and the native pattern.
    • Tally: parsing, counting and flushing.
    • Diagnostics: 40 refusals of each kind log only on teardown while a real error still logs.
  • src/main/plugins and watcher suites pass. pnpm tc, the ast-grep gates and the freshness checks pass.

Risk

Level: Low. Dev folders only for hashing. Content-policy lines are recognized by Chromium's English console text; if that wording changes, they fall back to ordinary rate-limited lines. Plain revert.

Agent skill upstream boundary

  • Not applicable.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I stated the risk
  • N/A for visuals with reason

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 14 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 58a08ffb-a88f-4da3-a5cc-35c58f22f72e
Commits

Reviewing files that changed from the base of the PR and between 1cc843e and 8cbca3e.

Files selected for processing: 13
  • docs/reference/plugin-authoring.md
  • src/main/plugins/panels/plugin-frame-blocked-requests.electron.test.ts
  • src/main/plugins/panels/plugin-frame-blocked-requests.test.ts
  • src/main/plugins/panels/plugin-frame-blocked-requests.ts
  • src/main/plugins/panels/plugin-frame-guest-diagnostics.test.ts
  • src/main/plugins/panels/plugin-frame-guest-diagnostics.ts
  • src/main/plugins/panels/plugin-frame-session-policies.ts
  • src/main/plugins/plugin-content-hash-dev-folder.test.ts
  • src/main/plugins/plugin-content-hash.ts
  • src/main/plugins/plugin-dev-watcher-ignore.test.ts
  • src/main/plugins/plugin-dev-watcher-ignore.ts
  • src/main/plugins/plugin-dev-watcher.test.ts
  • src/main/plugins/plugin-dev-watcher.ts
  • 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

Dev folders and their watcher now skip .git, .orca and node_modules at any
depth, so a nested build/node_modules no longer trips the 2,000-file limit
or re-reviews the plugin; installs still hash everything but the root .git.

Requests a plugin frame makes off its own files (session-cancelled or
refused by its content policy) are counted per kind and origin and logged
every 5 s and on teardown, outside the 20-lines-per-10-s console budget:
[frame] blocked font-src https://unpkg.com (x48): plugin frames have no network
…est logging

- Electron 43 prints "Loading the font '…' violates …" (and Connecting to / Framing /
  Fetching content from); read it alongside the older "Refused to …" wording, name the
  unset directive from the fallback note, and treat fetch's repeat as an echo. An Electron
  test captures the bundled runtime's real messages.
- Keep at most 32 kind-and-origin counts and log at most 8 lines per flush, folding the
  rest into one overflow count line.
@nwparker
nwparker force-pushed the nwparker/plugin-b8-dev-folder-papercuts branch from 24db311 to 8cbca3e Compare November 2, 2026 04:10
@nwparker
nwparker enabled auto-merge (squash) November 2, 2026 04:19
@nwparker
nwparker merged commit fbe891c into main Nov 2, 2026
46 of 48 checks passed
nwparker added a commit that referenced this pull request Nov 2, 2026
…argv's tail (#37329)

On Linux the probe launcher appends --no-sandbox, so argv[length - 2] is the --user-data-dir flag rather than the config path. The page then wrote result.json under a directory named after that flag, threw, never exited, and the launcher timed it out at 30s on every Linux run since #37300. The sibling Electron probes already pass the result path in config.json; this one now does too.
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