Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Platform: all Fix(zh-Hant): 重播時速報卡片不會在事件仍在播報時消失 Fix(en-US): the replayed EEW card no longer disappears while its alert still stands
Platform: all New(zh-Hant): 重播沒抓到速報時會說明是尚未出現、正在重試,還是整場都沒偵測到 New(en-US): a replay without EEW now says whether it is not in yet, retrying, or was not detected at all
whes1015
force-pushed
the
feat/replay-eew-states
branch
from
November 20, 2026 20:02
46b8b54 to
993dd57
Compare
Platform: all Fix(zh-Hant): 重播超出速報保留範圍或早於第一筆時,畫面不再顯示成連線異常 Fix(en-US): a replay outside the EEW archive no longer looks like a broken connection
whes1015
force-pushed
the
feat/replay-eew-states
branch
from
November 20, 2026 20:13
993dd57 to
135da47
Compare
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 19 selected item(s). |
This branch has not been deployed
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.
這個 PR 做了什麼
地震報告的重播畫面在沒有速報時原本是一片空白,使用者分不出「還沒出現」、「載入失敗」、「這場根本沒有速報」。這個 PR 把這三件事分開講,並修掉卡片會中途消失的問題:
/api/v2/eq/eew/{sec}回傳的是「該秒仍然有效」的速報集合,不是「該秒發布」。實測 2026-11-01 M5.6 事件,同一筆 serial 在 +30 秒到 +120 秒都還在集合裡,之後回到[]。原本卡片直接綁在輪詢結果上,事件還在播報時就會消失;現在保留最後一組非空集合,空回應代表「沒有新的」,不是「沒有」。ReplayEewSlot(card/pending/waiting/retrying/unavailable/none)決定槽位顯示什麼,優先序寫成純函式replayEewSlot,可單獨測試。失敗一律走「正在重試」或「暫時無法取得」,絕不借用「沒有資料」的說法。origin − 60 s、中間、origin + 300 s),三點都 200 且皆空才說「此次重播未偵測到速報資料」,並以小字說明依據;任一點失敗則不下結論。結果快取在 session 內,不會每次重進都重打。相關 issue
無。
怎麼驗
新增的測試:
test/features/earthquake/replay_eew_probe_test.dart:三點各打一次、任一有資料即 found、樣本失敗不下結論、JMA 與 CWA-only 過濾,以及replayEewSlot的優先序(卡片優先、失敗優先於空集合、未決定時不說話)。test/features/earthquake/presentation/widgets/replay_eew_notice_test.dart:四種提示各自的文字與圖示,並斷言「重試」與「沒有資料」不會同時出現。test/features/earthquake/presentation/pages/report_replay_page_test.dart:archive.eews = []之後卡片仍在;生命週期改成平台實際送出的鏈(inactive → hidden → paused → … → resumed),因為卡片現在整場保留一個AppLifecycleListener。檢查清單
tool/check.sh全綠AppLocalizations(12 語系)