Repository navigation
Conversation
乘客端「撥打司機電話」按鈕(O7)2026-07-17 就上線了,資料讀後端的 driver_phone。但 drivers.phone 沒有任何寫入路徑——註冊不收、沒有更新 端點、司機端沒有欄位——所以號碼恆為空字串、hasPhone 永遠 false, 這顆按鈕從來沒有真正出現過。 - DriverProfile 模型 + fetchProfile/updatePhone(PUT /api/driver/profile) - DriverController: phone/hasPhone/savePhone;載入失敗靜默降級,電話是 選填,不該擋住車輛設定流程,也不該掛一條與當前操作無關的錯誤 - 車輛資訊頁加獨立的電話區塊與獨立送出鈕:電話與車輛走不同端點, UI 若共用一顆「儲存」,司機改電話就會連帶把車輛重送審(O5) - 三個 Fake API 補上 profile 端點——init()/login() 觸碰的端點沒覆蓋, testWidgets 在 FakeAsync 下會永久卡住(既有坑) 需搭配 dispatch 的 PUT /api/driver/profile(分支 claude/driver-phone-profile)。 驗收:flutter analyze 無 issue、flutter test 182 passed(新增 9); 反向確認移除電話長度檢查後對應測試會 FAIL。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
widget test 用 Fake API,證明不了「App 真的把電話寫進後端、而且沒把車輛 審核狀態弄壞」。而系統層的合成滑鼠事件在本機 agent 環境送不進模擬器 (cliclick 移動游標正常但點擊靜默失效,Tab/方向鍵焦點也只能停在第一個 AppBar icon),所以互動必須改由 Flutter 自己派送。 integration_test 同時解掉兩件事:點擊不經系統事件,且能在斷言裡直接 向後端重查,不必相信 controller 的記憶體狀態。 實跑(iPhone 17 Pro + 後端 docker):輸入 0988-123-456 → 儲存 → SnackBar 出現 → 後端回正規化後的 0988123456 → 車輛仍 approved/can_accept。 外部 curl 交叉驗證 GET /driver/me 一致(操作前該欄為空字串)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
補上原本缺的 UI 互動驗證 ✅原描述裡「未驗:模擬器上的手動互動」這一項已補完,作法換了一層: 新增 實跑結果(iPhone 17 Pro + 後端 docker,
外部 curl 交叉驗證: 順帶記下踩到的坑: |
- README: 司機聯絡電話段(含「不可與 vehicle 端點共用」的理由)、 測試指令、iOS UI 驗收優先走 integration_test 的提醒 - TODO: 「下次任務」改成可直接接手的狀態——先合兩個相依 PR, 再做 A5 階段 5(iOS 實機)→ A1 鎖屏長跑背景定位實機驗收, 含 `-d ios` 免查 device-id、以及卡在哪三件人工操作 - tool/watch_driver_location.sh: A1 驗收腳本從 scratchpad 收進 repo (每 5 秒讀 Redis driver:<id>:loc 的 updated_at 判斷背景定位有沒有斷; 後端沒掛 gin.Logger(),請求層不印 log,所以看 Redis 不看 log) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
thothawei
added a commit
that referenced
this pull request
Jul 27, 2026
PR #40 的功能(司機端聯絡電話填寫)後來由別的 PR 進了 main,但它帶的兩個檔案 從未落地,且 main 至今沒有對應的東西: - integration_test/driver_phone_test.dart:在**真模擬器跑真 App、打真後端**的驗收。 widget test 用 Fake API,證明不了「電話真的寫進後端、而且沒把 O5 車輛審核弄壞」。 main 先前完全沒有 integration_test 基礎建設,故一併補上 dev dependency。 **對接 main 的實作調整**:原始測試呼叫 api.fetchProfile(),main 沒有這條路徑—— 改用 fetchVehicle(),它順帶回 phone,一次查詢同時驗「號碼正規化落地」與 「改電話不重置審核」。 - tool/watch_driver_location.sh:監看司機位置在鎖屏期間是否持續更新, 以 Redis 的 driver:<id>:loc 為真相來源(後端沒掛 gin.Logger,請求層不印 log)。 **這正是待辦 A5 階段 5「A1 鎖屏長跑背景定位實機驗收」要用的工具**—— 下次接上 iPhone 就會需要它。 驗收:flutter analyze 無 issue、flutter test 216 passed(既有測試不受影響, integration_test 不在 flutter test 的預設掃描範圍);shell 腳本 bash -n 語法通過。 整合測試本身需要真模擬器+後端才能跑,本批未執行。 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
2026-07-27 逐一比對後關閉:本 PR 的功能已全數在 main(司機端聯絡電話填寫於 2026-07-22 由後續 PR 上線並實跑驗證)。
救回的兩個檔案 main 至今沒有對應物:整合測試是「真模擬器跑真 App 打真後端」的驗收 救回時對接 main 的實作做了一處調整:整合測試原本呼叫 分支 |
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.
問題
乘客端「撥打司機電話」按鈕(O7)2026-07-17 就上線了,資料來自後端
driver_phone。但drivers.phone在全系統沒有任何寫入路徑——註冊不收、後端沒有更新端點、司機端沒有欄位。所以號碼恆為空字串、hasPhone永遠 false,這顆按鈕從來沒有真正出現過。docs/TODO.md其實早就寫過「drivers.phone欄位已存在,只是沒填寫入口」,只是一直沒人接。做法
DriverProfile模型 +fetchProfile/updatePhone(PUT /api/driver/profile)DriverController:phone/hasPhone/savePhone。載入失敗靜默降級——電話是選填,不該擋住車輛設定流程,也不該在頁面上掛一條與當前操作無關的紅字init()/login()觸碰的端點沒覆蓋,testWidgets在 FakeAsync 下會永久卡住(既有坑,這次又踩到一次)驗證
flutter analyze無 issue、flutter test182 passed(原 173,新增 9)can_accept:true(審核沒被重置);走完整叫車鏈路後乘客端/customer/rides/active首次帶出"driver_phone":"0912345678"未驗:模擬器上的手動互動。本機 bash 能移動游標但送不出合成點擊事件(
cliclick缺輔助使用授權,非座標問題),Tab/方向鍵焦點導航也只能停在第一個 AppBar icon。建議合併前由人在模擬器點一次確認。相依
需搭配後端 PR thothawei/fleet-dispatch#42(
PUT /api/driver/profile)。後端未合之前,這頁的「儲存聯絡電話」會拿到 404。🤖 Generated with Claude Code