Skip to content

fix(wechat): persist token under BUB_HOME#51

Merged
PsiACE merged 2 commits into
bubbuild:mainfrom
IceCodeNew:fix/wechat-token-bub-home
Jul 13, 2026
Merged

fix(wechat): persist token under BUB_HOME#51
PsiACE merged 2 commits into
bubbuild:mainfrom
IceCodeNew:fix/wechat-token-bub-home

Conversation

@IceCodeNew

Copy link
Copy Markdown
Contributor

Summary

  • resolve the WeChat token path from BUB_HOME
  • preserve ~/.bub/wechat_token.json as the fallback when BUB_HOME is unset
  • document the token location
  • add coverage for configured and default paths

Why

Bub's Docker deployment mounts its persistent runtime directory at /data and sets BUB_HOME=/data. The WeChat plugin previously hard-coded the token under Path.home() / ".bub", so container recreation discarded the login even though /data/wechat_token.json persisted.

Verification

  • uv run ruff check packages/bub-wechat
  • uv run --group test pytest -q packages/bub-wechat/tests (2 passed)

Comment on lines +23 to +24
bub_home = os.getenv("BUB_HOME")
home = Path(bub_home).expanduser() if bub_home else Path.home() / ".bub"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use bub.home to handle this logic, check impl in schdule

@PsiACE PsiACE left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@PsiACE PsiACE merged commit add4a6a into bubbuild:main Jul 13, 2026
1 check passed
@IceCodeNew IceCodeNew deleted the fix/wechat-token-bub-home branch July 13, 2026 04:21
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.

2 participants