Repository navigation
feat(app): 對話訊息的推播——兩端收下 chat.message、只點亮未讀角標(第十三輪) - #80
Merged
Merged
Conversation
對話先前只走 WS:對方 App 一離開前景 WS 就斷了,訊息只會躺在伺服器上, 要等他自己再打開 App 才看得到。斷掉的正是最需要的兩個情境—— 司機到了要聯絡乘客、乘客回報遺失物。後端同批補上送出路徑(dispatch #62)。 - 白名單:新增 isChatPush,兩端過濾器改成 isDriverPush(派單邀請 ∪ 對話)與 isCustomerPush(行程狀態五種 ∪ 對話);原本兩支保留、語意不變。 - 收到對話推播只點亮未讀角標: * 不能餵進 _handleWsEvent——推播 data 只有 type 與 ride_id,RideMessage.fromJson 會解析失敗被丟掉,角標根本不會動(司機端原本整條推播都直接進 _handleWsEvent)。 * 不必重讀行程/協尋——對話不影響行程狀態。 * 聊天室開著時忽略——那代表 App 在前景、WS 也連著,同一則已經顯示了。 驗收:flutter analyze 無 issue、flutter test 325 passed(317+新 8,含「派單推播照樣 開接單卡」與「行程狀態推播仍走對帳」兩案的回歸網)。 反向確認:白名單拿掉對話 → 1 案 FAIL;兩端 controller 拿掉分流 → 2 案 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.
問題
行程內對話先前只走 WS:對方 App 一離開前景 WS 就斷了,訊息只會躺在伺服器上,
要等他自己再打開 App 才看得到。斷掉的正是最需要的兩個情境——
司機到了要聯絡乘客、乘客回報遺失物。
後端同批補上送出路徑:dispatch PR #62
(推給收訊那一方,不推發話者自己的其他裝置)。
做了什麼
isChatPush,兩端過濾器改成isDriverPush = 派單邀請 ∪ 對話、isCustomerPush = 行程狀態五種 ∪ 對話。原本兩支(
isRideOfferPush/isCustomerRidePush)保留、語意不變。_handleWsEvent:推播 data 只有type與ride_id,RideMessage.fromJson會解析失敗被丟掉,角標根本不會動(司機端原本整條推播都直接進
_handleWsEvent,這次多了一層分流)。afterId增量)補齊——與第十一輪「推播只當訊號」同一條原則。
驗收
flutter analyze無 issue、flutter test325 passed(317 +新 8)。新增
test/chat_push_test.dart:白名單 2 案、司機端 3 案(角標 +1/聊天室開著忽略/派單推播照樣開接單卡)、乘客端 3 案(角標 +1 且不重讀行程/聊天室開著忽略/
行程狀態推播仍走對帳)。後兩案是這次新增分流的回歸網——分流寫錯會把原路徑吃掉。
google-services.json)。🤖 Generated with Claude Code