Repository navigation
feat(driver): 沒搶到的單,接單卡自己消失(配合後端 ride.taken) - #74
Merged
Merged
Conversation
同一張單同時推給半徑內每一位待命司機,只有一位搶得到。先前沒搶到的人 沒有任何事件收得掉那張全螢幕接單卡——他得自己按下去拿到「手慢了」才會消失, 期間卡片蓋著整個畫面。 後端補送 ride.taken(dispatch T2)後,這一側收到就把 pendingOffer 清掉。 **不寫錯誤訊息**:他什麼都沒做,卡片安靜地收掉才是正確行為。 逾時/乘客取消時後端改送 ride.cancelled 給所有收過 offer 的人,既有處理已涵蓋。 測試:新增 3 案;反向確認拿掉處理後 1 案 FAIL。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
問題
同一張單會同時推給半徑內每一位待命司機,只有一位搶得到。沒搶到的人手機上那張全螢幕接單卡沒有任何事件收得掉——
ride.accepted只送給接到的那位,逾時取消也只通知乘客。他得自己按下去、拿到「手慢了,這單已被其他司機接走」才會消失,期間卡片蓋著整個畫面。每一趟車都會發生在所有沒搶到的司機身上。這一側改什麼
ride.taken的處理:是自己這張待接的單就把接單卡收掉。ride.cancelled給所有收過 offer 的人,App 既有處理已能收掉卡片,不需再改。驗收
flutter analyze無 issue、flutter test291 passed(288 +新 3)。test/driver_offer_taken_test.dart:ride.taken收掉卡片且不報錯/別張單不動/ride.cancelled一樣收掉。ride.taken處理後 1 案 FAIL。🤖 Generated with Claude Code