fix: keep BetterDiscord cold-start injection and add local pack builds#235
Open
XxUnkn0wnxX wants to merge 1 commit intoGooseMod:mainfrom
Open
fix: keep BetterDiscord cold-start injection and add local pack builds#235XxUnkn0wnxX wants to merge 1 commit intoGooseMod:mainfrom
XxUnkn0wnxX wants to merge 1 commit intoGooseMod:mainfrom
Conversation
Fixes - keep the OpenAsar settings entry injection working on BetterDiscord cold start without depending on footer injection - prefer the `App Settings` section when it is available while staying close to upstream's DOM-only settings hook Build - add `scripts/pack.js` for local `app.asar` builds without editing the working tree in place - support `--disable-autoupdate` and `--update-repo owner/repo` build stamping via `src/index.js` and `src/asarUpdate.js` - ignore `tmp/`, `AGENTS.md`, and `.venv/` in `.gitignore` Docs - document local build usage in `docs/build.md` - update `README.md` with local build references while keeping upstream workflow references Verification - `node -c src/mainWindow.js` - `node -c src/index.js` - `node -c src/asarUpdate.js` - `node -c scripts/pack.js` - `node scripts/pack.js --disable-autoupdate --version nightly-$(git rev-parse --short HEAD)-localtest --output tmp/app.asar`
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.
Summary
This is a heavily trimmed-down follow-up to the earlier closed PR:
#233
The main goal is to fix one specific regression:
with BetterDiscord installed, OpenAsar could be missing on a normal cold launch of Discord, but then appear correctly after a soft refresh with
Cmd+R/Ctrl+R.So the real bug here is a cold-boot injection failure, not a generic "BetterDiscord support" issue.
This version intentionally keeps only the minimum changes needed to:
What This PR Fixes
src/mainWindow.jsThis is the actual runtime fix.
Upstream currently ties the sidebar-item injection too closely to the footer/version injection path. On cold boot, if the footer lookup misses or arrives late, the OpenAsar sidebar item can be skipped entirely. After a soft refresh, the settings DOM is more stable, so the same install can suddenly work.
This PR keeps the logic DOM-only and close to upstream, but changes the critical behavior:
App Settingssection when presentAdvancedfallbacks are still keptThe intended outcome is simple:
Cmd+R/Ctrl+RWhy The Build Files Are Included
The extra build changes are not unrelated cleanup.
While testing this bug, local packed builds could replace themselves with the upstream nightly release on launch. That made it hard to tell whether a cold-boot fix really worked, because the running code could stop matching the packed code almost immediately.
Because of that, this PR keeps the minimum build-time support needed for reliable local verification:
src/index.jsandsrc/asarUpdate.jsGooseMod/OpenAsarwhen nothing is stampedscripts/pack.js--disable-autoupdate--update-repo owner/repo--versionand--outputThese arguments are additive:
Docs In This PR
docs/build.mdIncluded so the local pack flow is documented and reproducible.
README.mdOnly lightly updated to point to the local build docs.
.gitignoreAdds local-only ignores for:
tmp/AGENTS.md.venv/What Was Intentionally Left Out
To keep this version reviewable, it does not include:
Files Changed
.gitignoreREADME.mddocs/build.mdscripts/pack.jssrc/asarUpdate.jssrc/index.jssrc/mainWindow.js