Repository navigation
emrg: pack the preview preload, and guard every preload path main.js names - #3306
Merged
Merged
Conversation
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.
The packaged app was missing
preview-preload.js, so the HTML preview's annotation interface never loaded: the file exists in the repo and the build's file whitelist left it out, so it is absent fromapp.asar.Measured on the installed v0.3.88 (
~/Applications/EMRG.app):npx asar list app.asar | grep -c preview-preloadanswers 0, whilemain.jsnames the file as the preview view's preload. A preload that cannot be found is not a crash — the page loads without it, which is exactly what the host saw: a rendered page and no way to annotate.Why no test caught it:
build-config.test.jsscansrequire("./x")inmain.js,preload.jsandconfig_fields.js, and a preload is not required — it is a path handed toWebContentsView. The whitelist was never asked about it.Two changes:
package.jsonbuild.filesgainspreview-preload.js, besidemain.jsandpreload.js.build-config.test.jsgains a guard over the other carrier: everypath.join(__dirname, "*.js")inmain.jsmust be covered bybuild.files. Measured that it fires — with the entry removed the test reportsactual: [ 'preview-preload.js' ], expected: []; with it restored, 10 passed.The guard also holds the two paths that already ship (
preload.js,conn-manager.js-style requires keep their own test), so a future preload added the same way cannot ship missing.Readings:
node --test test/build-config.test.js10 passed;cd emrg/gui && npm test280 executed, 273 passed, 8 skipped;scripts/check-node-test-count.pyagreeing withAgent.md(1282 renderer + 280 GUI);tests/test_doc_counts.py82 passed.The host reaches this only through a published release: the installed
.pkgcarries the whitelist's decision.