Repository navigation
feat(dispatch): 協尋單每一步也推播——推給對方,標題講「接下來要做什麼」(U3) - #63
Merged
Merged
Conversation
協尋的節奏是小時級(司機要回車上翻、乘客要等),雙方幾乎都不在 App 前景。 先前每一步都只走 WS,整條流程等於要靠當事人自己想起來去開 App 看: 建了單司機不知道、找到了乘客不知道、付了款司機不知道。 - LostItemService 加 SetAppNotifier;建單推司機,之後每一次狀態轉換推給對方 (司機標記尋獲/歸還 → 推乘客;乘客付款/取消 → 推司機)。動作發起者自己剛按完, 系統匣再跳一則只是噪音。 - 標題講的是「收訊者接下來要做什麼」而非內部狀態名:found 對乘客是 「司機找到你的遺失物了」(=該付處理費了);closed 對乘客是「協尋已結案」、 對司機是「乘客取消了協尋」——同一個狀態對兩邊的意思不一樣。 - data 只帶 type+ride_id,物品描述放通知本文並以 rune 截斷;App 醒來後重讀協尋清單。 驗收:go test ./internal/service -run 'TestLostItem' 通過(真 PostGIS+Redis), 整合測試走完 open→found→paid→returned 四步逐一驗到收訊者與標題。 反向確認:把 pushLostItem 改成永遠早退 → FAIL(建單得到 0 則)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
U/U2/U3 先前的證據都只到 service 層。這批用本機 postgis+redis 容器+go run 起真後端 (FCM_CREDENTIALS_FILE 留空 → LogPusher stub),以 curl 走完整條 HTTP 路徑, 從 log 的 token 前綴判定「推給誰、推了什麼」:10 則推播收件人全部正確, 另跑一輪取消路徑——乘客自己取消完全沒有推播(負向斷言成立)、admin 取消推 ride.cancelled、 司機放棄推 ride.redispatched。 scripts/push_e2e.sh、scripts/push_cancel_e2e.sh 連同踩到的四個坑一起收進 repo (registry 拉不到只能改跑本機 server、車牌長度上限、vehicle-review 參數是 approve、 建單回的是 ride_id)。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Jul 29, 2026
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.
問題
協尋的節奏是小時級(司機要回車上翻、乘客要等),雙方幾乎都不在 App 前景。
先前每一步都只走 WS,整條流程等於要靠當事人自己想起來去開 App 看——
建了單司機不知道、找到了乘客不知道、付了款司機不知道。
做了什麼
LostItemService加SetAppNotifier;建單推司機,之後每一次狀態轉換推給對方(司機標記尋獲/歸還 → 推乘客;乘客付款/取消 → 推司機)。
動作發起者自己剛按完,系統匣再跳一則只是噪音。
found對乘客是「司機找到你的遺失物了」(=該付處理費了);closed對乘客是「協尋已結案」、對司機是「乘客取消了協尋」——同一個狀態對兩邊的意思不一樣,共用一句文案會有一邊看不懂。
data只帶type+ride_id,物品描述放通知本文並以 rune 截斷;App 醒來後重讀協尋清單(狀態可能又變過了)。
驗收
go test ./internal/service -run 'TestLostItem'通過(真 PostGIS + Redis 容器):整合測試走完 open→found→paid→returned 四步,逐步驗到收訊者、標題與 data type;
TestLostItemPushTitle釘住五種標題(含 closed 的兩種說法);未注入 notifier 仍可建單。pushLostItem改成永遠早退 → FAIL(建單得到 0 則)。App 端同批
fleet-app PR #81(已合併):
lost_item.created/lost_item.updated進兩端白名單,收到後只重讀協尋清單。🤖 Generated with Claude Code