Repository navigation
fix(eew): end an early warning the live stream stopped sending - #35
Merged
Merged
Conversation
Platform: all An EEW reaches the app only when it is issued or updated; the stream never says it expired. The live loop aged shake reports but not EEWs, so one the server had already stopped listing stayed active: the towns kept the colour of its predicted intensity, and every later earthquake waited behind it until the window was reloaded. Age EEWs on every live poll the way the HTTP loop does, keep a predicted area off the map once its EEW is no longer active, and let the EEW cache's own expiry announce the end instead of dropping layers without a word. Fix(zh-Hant): 地震預警結束後,地圖不會再卡在預估震度的鄉鎮填色 Fix(en-US): the map no longer stays coloured by a warning's predicted intensity after it ends
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.
Platform: all
Fix(zh-Hant): 地震預警結束後,地圖不會再卡在預估震度的鄉鎮填色
Fix(en-US): the map no longer stays coloured by a warning's predicted intensity after it ends
問題回報:ET-2026-0179(卡在強震即時警報預估震度畫面),附件 log
161.log的時間軸可直接對上。原因
預警只會在發布/更新時由 SSE 送進來,結束不會另外送。即時模式在連線活著時,輪詢只幫震度速報做逾時老化,漏了 EEW,所以伺服器在 16:45:04 已經送了空清單、發震也早就超過 240 秒,本機的
variable.data.eew仍留著 1150075 →EewEnd永遠不會發 → 預估震度的鄉鎮填色(feature state)沒有東西會把它塗回去。10 分鐘後eew_cache自己到期,只清掉圓環圖層與資訊卡,畫面就變成「卡片說暫無預警、地圖還是一片藍」。修法
data.ts:SSE 活著時的每輪輪詢也對 EEW 做老化(與 HTTP 輪詢、震度速報同一條路),時間到就正常發EewEnd。estimate.ts:重畫鄉鎮填色時只認variable.data.eew裡還在的預警,不在的面積直接丟棄;alertedCities的清空移到守衛之前,單一預警結束那條路本來清不到。eew.ts:快取到期改成發EewEnd,讓各模組自己收乾淨,而不是只拿掉自己那幾層。驗證
bun run typecheck、bun run build:web通過;bun run lint只剩preview.tsx原有的 react-refresh warning。fetchData走 SSE 分支:修之前EewEnd0 次、data.eew仍有 1 筆、預估面積還在、2 個鄉鎮填色沒退;修之後EewEnd1 次、data.eew0 筆、面積清空、填色歸零。