fix(webui): report the tray as found when it runs from the sidecar - #38
Merged
Conversation
/requirements read $DECKBRIDGE_TRAY_BIN only, but app.ts resolves the tray from that env var *or* a `deckbridge-tray` sidecar next to the executable — which is how every packaged release ships it. Result: a downloaded release showed a visible, working tray icon while the page said "Not found (DECKBRIDGE_TRAY_BIN not set)". Extracts that resolution into resolveTrayBin() in tray.ts and calls it from both app.ts and the requirements check, so the two can't disagree again. The sidecar probe also picks up .exe on Windows and uses parentDir(), which handles backslash-separated exePaths — the old inline probe did neither. Adds a regression test for both branches of the resolver.
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.
Problem
Reported on a downloaded v0.9.0 release: tray icon visible and working, but
http://localhost:3000/requirementssaysapp.tsresolves the tray from$DECKBRIDGE_TRAY_BINor adeckbridge-traysidecar next to the executable — the sidecar is how every packaged release ships it. The requirements check only ever looked at the env var, which is unset in a packaged run. Pure false negative; pre-existing, not related to the slim-runtime change.Fix
Extract the resolution into
resolveTrayBin()intray.ts;app.tsandrequirements.tsboth call it, so the spawn path and the reported path can't diverge again.Two incidental improvements in the shared version: the sidecar probe appends
.exeon Windows, and it usesparentDir()(handles\as well as/) instead oflastIndexOf('/')— the old inline probe would never have found the sidecar on Windows.app.ts's "no tray" log line was also misleading (DECKBRIDGE_TRAY_BIN not seteven when the real problem was a missing sidecar); it now names both.Verified
Compiled binary +
deckbridge-traystaged side by side, run withDECKBRIDGE_TRAY_BINunset:{"name":"tray","ok":true,"message":"Found: /private/tmp/pkgtest/deckbridge-tray"}, tray spawns.ok:false,"Not found (no deckbridge-tray next to the executable, DECKBRIDGE_TRAY_BIN not set)".Plus a regression test in
ts/test/tray.test.tsfor both branches of the resolver (15 passed).mise run ci-checksgreen.