Repository navigation
fix(dispatch): 「乘客已上車」也推給司機(多裝置/跨管道) - #57
Merged
Merged
Conversation
ride.picked_up 先前只推乘客。司機的第二台裝置(或 LINE 那條路徑)標記上車後, 這一台會停在「前往上車點」階段——按鈕還是「乘客已上車」,按下去只會被後端拒絕 (狀態已是 PickedUp),而「放棄此單」這時也已不可用。 App 端本來就有這則事件的處理(切到 onTrip 階段),缺的一直是事件本身。 與 ride.stop_updated(#53)、ride.cancelled(#56)同一族。 測試:pickUpFixture 抽出可注入 publisher 的版本;新增一案斷言乘客與司機各收到一則。 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.picked_up先前只推乘客。司機的第二台裝置(或 LINE 那條路徑)標記「乘客已上車」後,這一台會停在前往上車點階段:PickedUp);CancelByDriver只接受Accepted);GET /driver/rides/active還原,畫面不會自己好。App 端本來就有
ride.picked_up的處理(切到onTrip階段),缺的一直是事件本身——與ride.stop_updated(#53)、ride.cancelled(#56)同一族。改了什麼
PickUp在推乘客之外,補推同一則事件給該司機。動作來源那台會多收到一則自己造成的事件(它已經自己切好階段了)——一次無害的重複,遠比兩台顯示不同階段便宜。驗收
go build ./.../go vet/gofmt乾淨。pickUpFixture抽出可注入fakePublisher的版本(原簽名不變,既有 5 案不受影響)。TestPickUp_也推給司機:斷言乘客與司機各收到一則ride.picked_up,且ride_id正確。TestPickUp*(6 案,真 PostGIS)PASS。publish後該案 FAIL。🤖 Generated with Claude Code