← Back to PRs

#12803: fix(line): avoid false 'not configured' warnings for file/env token sources

by puritysb open 2026-02-09 18:14 View on GitHub →
channel: line channel: voice-call gateway commands size: S
## Problem `collectStatusIssues`, `isConfigured`, and `describeAccount` only checked `channelAccessToken`/`channelSecret` string fields directly. When credentials were provided via `tokenFile`, `secretFile`, or environment variables (`tokenSource: "env"`/`"file"`), the status check falsely reported them as "not configured". ## Fix Check `tokenFile`, `secretFile`, and `tokenSource` in addition to the direct string fields across all three functions: - `isConfigured` - `describeAccount` - `collectStatusIssues` ## Changes - **1 file changed**: `extensions/line/src/channel.ts` Fixes #11094 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Fixes false "not configured" warnings when LINE credentials are provided via file or environment variables instead of direct config values. The PR updates `isConfigured`, `describeAccount`, `collectStatusIssues`, and `buildAccountSnapshot` to check `tokenSource` in addition to the direct string fields. However, the fix has a **critical flaw** in `collectStatusIssues` (line 595-596): it assumes `tokenSource !== "none"` guarantees both token and `channelSecret` are available, but `tokenSource` only tracks where the **token** came from. The token and `channelSecret` are resolved independently via separate files (`tokenFile`/`secretFile`) or separate environment variables. If only the token source is configured but the corresponding auth credential source is missing, this will incorrectly suppress the "channel secret not configured" warning. The existing comment thread correctly identifies this issue. The `account.channelSecret` field is already populated by the account resolution logic, so the check should rely on that field directly rather than inferring availability from `tokenSource`. <h3>Confidence Score: 2/5</h3> - This PR has a logical error that could suppress important configuration warnings - The PR addresses a real issue (false warnings for file/env token sources) but introduces a bug in the `collectStatusIssues` function that conflates token availability with auth credential availability. This could hide legitimate configuration errors where users have configured a token source but not the corresponding auth credential source. The logic needs correction before merge. - Pay close attention to `extensions/line/src/channel.ts` lines 595-596 in `collectStatusIssues` <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs