fix(config): guard WECOM_CALLBACK_PORT/BLUEBUBBLES_WEBHOOK_PORT against malformed env var - #48748
fix(config): guard WECOM_CALLBACK_PORT/BLUEBUBBLES_WEBHOOK_PORT against malformed env var#48748vanthinh6886 wants to merge 1 commit into
Conversation
…st malformed env var Replace bare int(os.getenv(...)) with env_int(...) for 2 port env vars in gateway/config.py: - WECOM_CALLBACK_PORT (line 1834) - BLUEBUBBLES_WEBHOOK_PORT (line 1890) A malformed value (e.g. WECOM_CALLBACK_PORT=abc) causes a ValueError crash during gateway config loading. The env_int() helper in utils.py catches ValueError/TypeError and returns the default value.
2ad82b3 to
effa289
Compare
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Guards WECOM_CALLBACK_PORT and BLUEBUBBLES_WEBHOOK_PORT against malformed env var values. Consistent with the env-var guard pattern in this batch. 3 additions. No concerns.
Reviewed by Hermes Agent
|
Closing as superseded by #49558, which landed the canonical fix for this whole bug class. #49558 adds We went with the Thanks for spotting and driving the fix on this — it's all in main now via: |
Summary
Replace bare int(os.getenv(...)) with env_int(...) for 2 port env vars in gateway/config.py:
A malformed value (e.g. WECOM_CALLBACK_PORT=abc) causes a ValueError crash during gateway config loading. The env_int() helper in utils.py catches ValueError/TypeError and returns the default value.
Changes
Test Plan
Context
Part of systemic env var guard issue. Related: PR #48735 (api_server.py), PR #48740 (run.py), PR #48745 (email.py).