專案

一般

配置概況

動作

Bug #1323

進行中

[Bug] `GET /api/user/check/completed/profile/undefined` 把字串 "undefined" 帶進 LINE API

是由 陳國瑋約 2 個月 前加入.

狀態:
New
優先權:
High
被分派者:
開始日期:
2026-06-10
完成日期:
預估工時:

概述

問題

近 7 天每日 1~4 次 com.linecorp.bot.messaging.client.MessagingApiClientException: code=400 ... error='The value for the userId parameter is invalid' 錯誤。請求路徑是 /api/user/check/completed/profile/undefined,把字串 "undefined" 帶到 LINE profile API。

根因

前端(LIFF 或後台前端)在某些情境下用 undefined 作為 path variable 呼叫 API。常見原因:

  • 變數未初始化
  • 變數被覆寫成 undefined
  • 邏輯分支沒填值

建議修法

  1. 前端:檢查呼叫 /api/user/check/completed/profile/{lineId} 的地方,lineId 為空/undefined 時不要發 request
  2. 後端(防禦):CommonController 收到 undefined 字串時回 400,不要打 LINE API
  3. 觀察 6/9 22:47 那筆是 api/user/check/completed/profile/undefined 直接被呼叫,且 ss3a exception handler 接住 — 確認 SS3A 是否會回應客戶端有意義的 error

影響

  • 用戶體驗:少數 lineId 未就緒的邊界 case
  • LINE API 額度:浪費 API call(line 對 400 不收費但不該發)

範圍

  • 前端:LINE LIFF 與 admin 前端呼叫此 API 的位置
  • 後端:java/src/main/java/com/crazysundiet/hm/front/common/controller/CommonController.java

沒有任何資料可供顯示

動作

匯出至 Atom PDF