Repository navigation
test(customer): 救回接手既有訂單的三個邊界(來自被取代的 PR #60) - #69
Merged
Merged
Conversation
關掉重複 PR 前逐檔比對,發現 #60 的 customer_place_order_timeout_test 裡有三條 main 完全沒有的斷言:接手時要一併帶出司機資訊(否則乘客會先看到一段假的「配對中」, 司機可能已經在門口)、對帳本身失敗時要維持原錯誤、後端回終態訂單時不算數 (把已完成的上一趟接手過來,乘客會盯著一張永遠不會動的行程)。 反向確認:拿掉 _applyActiveRide 與 isTerminal 判斷後,這三案中有 2 案 FAIL (第三案「對帳失敗」由既有 catch 覆蓋,仍保留以釘住行為)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
回前景會呼叫 ensureConnected();漏看 _disposed 的話,已登出的 client 會帶著舊 token 重新連上,上一個帳號的事件就繼續進來。main 的 app_lifecycle_test 有「斷線立刻重連」 與「已連上不重建」,唯獨缺這條。 誠實標記:這是 defense-in-depth 的行為斷言,不是釘住某一行—— ensureConnected 與 _open() 各有一道 _disposed 守門,單獨拿掉任一道測試都仍 PASS, 兩道同時拿掉才 FAIL(connector 被呼叫 2 次)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Owner
Author
|
追加一案(同樣是逐檔比對撈到的):「登出後 誠實標記:這是 defense-in-depth 的行為斷言,不是釘住某一行。
|
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.
為什麼
關掉重複 stack(#59/#60/#61)前逐檔比對時發現:#60 的
test/customer_place_order_timeout_test.dart裡有三條斷言,main 上一條都沒有(grep過weak_network_test與customer_create_conflict_test,都沒有driverInfo/isTerminal/對帳失敗的案例)。程式碼本身在 main 已經是對的——缺的是釘住它的測試。少了它們,下一個人重構
_adoptRideIfCreated時三條行為都會靜悄悄壞掉。救回的三案
驗收
flutter analyze無 issue、flutter test280 passed(277 +新 3)。_applyActiveRide(ride)與isTerminal判斷後,這三案中 2 案 FAIL。第三案(對帳失敗)由既有的catch覆蓋,拿不掉也不會紅——仍保留以釘住行為,這裡誠實標記它不是新防線。至此 #59/#60/#61 三支被取代的 PR 內容已全部救回(功能在 #66、測試在本 PR),可以安全刪分支。
🤖 Generated with Claude Code