fix(weixin): make WeChat channel work in packaged macOS app#30
Merged
Conversation
GUI-launched macOS apps inherit a minimal PATH (no Homebrew), and the PyInstaller bundle didn't ship the node bridge, so the WeChat channel silently failed (blank QR) in the packaged app. - weixin_channel: resolve `node` to a full path with Homebrew/usr fallbacks; load the bridge from sys._MEIPASS when frozen; surface missing-node and bridge start failures as an `error` status instead of failing silently - Makefile + taskboard.spec: bundle channels/weixin_bridge via --add-data - electron main: prepend common bin dirs to PATH when spawning the backend - tests: cover node-path resolution, Homebrew fallback, _MEIPASS path, and the missing-node error status Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
@claude please review it |
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
The WeChat (Weixin) channel worked in dev but silently failed in the packaged macOS app — users saw a blank QR code with no error.
Two root causes:
/opt/homebrew/bin), so neither the Electron-spawned Python backend norshutil.which("node")could findnode.channels/weixin_bridge, so even with node present there was no script to run.Changes
channels/weixin_channel.pynodeto a full path, falling back to/opt/homebrew/bin,/usr/local/bin,/usr/binwhen not on PATH.sys._MEIPASSwhen frozen (PyInstaller) instead of beside the source module.FileNotFoundError) and bridge start failures as anerrorlogin status (last_error) instead of failing silently.Makefile+taskboard.spec— bundlechannels/weixin_bridgeinto the binary via--add-data.taskboard-electron/src/main.js— prepend common bin dirs toPATHwhen spawning the Python backend so child processes resolvenode.tests/test_weixin_more.py— cover full node-path resolution, Homebrew fallback,_MEIPASSpath, and the missing-node error status.Verification
make check— 828 passed, coverage 92.78% (≥90 gate)build:checkOK🤖 Generated with Claude Code