Skip to content

Rebuild the iOS push pipeline, and move wind particles into the map - #551

Merged
whes1015 merged 40 commits into
mainfrom
storage/sqlite-async
Aug 24, 2026
Merged

Rebuild the iOS push pipeline, and move wind particles into the map#551
whes1015 merged 40 commits into
mainfrom
storage/sqlite-async

Conversation

@whes1015

@whes1015 whes1015 commented Aug 23, 2026

Copy link
Copy Markdown
Member

40 則 commit,涵蓋 storage、通知、地圖和風場。通知佔了大半,也是最值得細看的部分 —— iOS 的推播壞在好幾個地方,而且每一個都是無聲失敗,修正過程改變了通知管線的歸屬。

通知(12 則)

iOS 前景推播完全沒有反應,而且沒有任何東西說明原因。 依照發現的順序:

  • GoogleService-Info.plist 在磁碟上,卻從來沒有被加進 Xcode target。原生 Firebase 每次啟動印四行錯誤,要等 Dart 執行到 Firebase.initializeApp 才設定完成。
  • awesome_notifications 根本無法算繪這種推播。 它自己的原始碼就寫著 —— "we do not chain to a previously-installed delegate … FCM is handled by awesome_notifications_fcm" —— 而且它的遠端路徑還要求 Notification Service Extension、App Groups 和 mutable-content,SNS 直送 APNs 一項都不會帶。awesome_notifications_fcm 裝回來了,跟改寫前一樣。
  • 前景仍然是死的。 awesome 握著 UNUserNotificationCenter.delegate,而對一個它建不出 model 的推播,它會走到一個從不呼叫 completion handlercatch。Apple 的合約對這種情況沒有 timeout —— "if the handler is not called in a timely manner then the notification will not be presented"。無橫幅、無聲音、無 log。現在由 NotificationDelegateProxy 代為回答 server 推播,其餘(包含點擊)原封轉發。
  • firebase_messaging 移除。 它留著只為了 APNs token,而那個 token 來自 didRegisterForRemoteNotificationsWithDeviceToken —— 所有宣稱能「取得」它的 SDK,都只是讀回同一個 callback。改由 ApnsTokenPlugin 直接讀。
  • 推播 token 原本有四個寫入點,彼此之間沒有平台判斷,所以 iOS 上一個 FCM token 可能在幾秒後覆蓋掉正確的 APNs token。這個錯誤是無聲的:寫入回 202,之後每次查詢都 401。現在只有一個寫入點。

每次啟動印一行,說明推播到底有沒有起來 —— 因為它的每一種失敗從外面看都一模一樣:

push: ready · iOS · channels 18 ok · token APNs …
push: DEGRADED · iOS · channels 18 ok · token MISSING — this device cannot be reached

地圖與風場(7 則)

  • 風場粒子從 Flutter 疊層搬進地圖自己的 GL pass。 Android 上,一個在平台視圖之上每幀重繪的疊層,在 HCPP 模式下會每幀洩漏一張全螢幕圖形緩衝 —— 實測 GPU 記憶體 16 秒內從 394 MB 漲到 8 GB,然後 process 被系統殺掉。
  • HCPP 刻意關閉,manifest 裡連同量測數據寫明原因。
  • 時間軸的預熱不再驅逐它自己剛注入的 frame。
  • app 現在會回應 onTrimMemory / didHaveMemoryPressure,而不是對系統一毛不還、然後被 lmkd 挑中。

雨量、儲存、其他

  • 雨量改用氣象署公布的分級,小間距與大間距兩張門檻表。
  • SQLite 換成 sqlite_async;資料庫延遲開啟的 session 可以復原。

驗證

tool/check.sh 在每一則 commit 上都通過。通知在實機上測過前景、背景、終止三種狀態,兩個平台皆是;從通知點進 app 的深連結仍然正確路由。

已知未修:自訂通知音在配對的 Apple Watch 或 macOS iPhone Mirroring 上不會播放 —— watchOS 沒有對應的 API,而 Mac 上那則是 app 碰不到的轉發。

Fix(zh-Hant): 修正從通知點開 app 時,資料庫可能被背景引擎鎖住、把已設定好的安裝當成第一次使用
Fix(en-US): fix a notification-tap cold start that locks the database and makes a configured install look like a first run
Fix(zh-Hant): 資料庫開啟延遲時,設定會先留在記憶體、開啟後自動補回,不再整段工作階段被當成第一次使用
Fix(en-US): settings survive a session without a database — they stay in memory and are replayed when it opens, instead of the session masquerading as a first run
Fix(zh-Hant): 修正首頁雨滴卡片捲出畫面後,會在 App 日誌灌入大量錯誤
Fix(en-US): Fix the home rain card flooding the app log with errors once it scrolls away
Fix(zh-Hant): 修正「未來 1 小時降水預報」的掃描範圍沿用雷達圓弧,網格四角被誤標為未觀測
Fix(en-US): Fix the 1h precipitation forecast outlining radar coverage instead of its own grid
@whes1015
whes1015 force-pushed the storage/sqlite-async branch from 25a361b to 7779993 Compare August 23, 2026 14:09
whes1015 and others added 23 commits August 23, 2026 22:15
Optimization(zh-Hant): 地圖疊圖只抓資料真實存在的縮放層級,Android 上連續縮放更流暢、也省下白費的流量
Optimization(en-US): map overlays fetch only the zoom levels their data really has, smoothing repeated pinch-zooms on Android and cutting wasted requests
New(zh-Hant): 雨量圖改用中央氣象署階梯色階並預設顯示過去一小時,長時窗自動改用大間距門檻
New(en-US): the rainfall map switches to the CWA banded scale and defaults to the past hour, widening its thresholds for long windows
Optimization(zh-Hant): 地圖時間軸的預熱不再互相沖掉剛載入的圖磚,拖曳時間軸與平移地圖後更快穩定、不再閃空白
Optimization(en-US): the map timeline's tile warming no longer evicts tiles it just loaded, so scrubs and pans settle faster without flashing blank
Fix(zh-Hant): 系統記憶體吃緊時主動釋放隱藏來源的圖磚,Android 不再於約 1 GB 時被系統直接殺掉
Fix(en-US): decoded tile textures are handed back when the OS asks for memory, instead of the process being killed around 1 GB on Android
New(zh-Hant): 修正推播全部變成公告音效——相容後端仍在送的巢狀格式,通知回到正確類別、音效與點擊頁面
New(en-US): push notifications land on their proper category, sound and tap route again by accepting the legacy nested payload format the backend still sends
Platform: android

Fix(zh-Hant): 修正升級後 Android 通知音效錯亂或靜音——強制重建通道以取得正確的音效資源
Fix(en-US): force channel recreation after app updates so Android plays each alert's own sound instead of a stale cached one
Fix(zh-Hant): 修正前景收到推播時完全沒有通知——後端的 40-bit 訊息編號超出 32-bit 驗證,改為略過編號照常顯示
Fix(en-US): fix foreground pushes not rendering at all — the backend's 40-bit message id fails awesome's 32-bit validation, so oversized ids are now ignored and the alert still shows
Platform: android

Fix(zh-Hant): 修正升級後 Android 背景推播變成系統音效——通道改以原始 key 重建,系統渲染找得到正確類別與音效
Fix(en-US): fix background pushes falling back to the system sound after an update — channels are rebuilt under their plain keys so the system render finds the right category and sound
Platform: android

Fix(zh-Hant): 修正 App 內通知音效不斷循環播放——不再把每則推播標記為持續鳴響的警報類別
Fix(en-US): fix in-app notification sounds repeating endlessly — pushes no longer inherit the insistent alarm flag that replays the sound until opened
Platform: android

Fix(zh-Hant): 修正背景推播變成系統音效——以原始 key 鏡像通知通道,讓 FCM 的系統渲染找得到正確類別
Fix(en-US): fix background pushes playing the system sound — channels are mirrored under their plain keys so FCM's own renderer finds the right one
New(zh-Hant): 風場粒子改由地圖原生 GPU 圖層繪製,Android 上更省資源、也為地圖縮放順暢化鋪路
New(en-US): wind particles are now advected by the map's native GPU layer, cutting Android resource cost and paving the way for smoother zooming
Platform: ios

Fix(zh-Hant): 修正開發版與重簽安裝被誤判成 App Store 或 TestFlight 版本的問題
Fix(en-US): dev builds and re-signed installs are no longer taken for app store or testflight ones
PiscesXD and others added 13 commits August 24, 2026 12:48
New(zh-Hant): 常用地區的新增地區頁面可以搜尋縣市與鄉鎮
New(en-US): the region picker gained search for counties, cities, and townships
New(zh-Hant): 地圖圖層可以隱藏,不需要的圖層不再出現在選單
New(en-US): map layers can be hidden from the picker
Platform: ios

Optimization(zh-Hant): 風場粒子動畫在 iOS 改用原生渲染,更流暢省電
Optimization(en-US): wind particles render through the native path on iOS too
Pins 9804c2f: screen-space trail buffers are now invalidated whenever the
camera moves, when a new forecast field lands, and after a lost EGL
context — the native particle layer had lost the overlay's drop-on-move
behaviour, so pans, pinches and rotations smeared streaks anchored to the
old camera over the new one.
Platform: ios

Fix(zh-Hant): 修正 iOS 冷啟動窗口內收到的推播被靜默丟棄——App 提早接手通知代理,awesome 的呈現器無法顯示時由系統補上橫幅與音效
Fix(en-US): fix pushes arriving in the cold-start window being silently dropped on iOS — the app claims the notification-center delegate early and presents whatever awesome's presenter declines
Platform: ios

Fix(zh-Hant): 修正 iOS 啟動時 Firebase 設定檔缺失
Fix(en-US): fix the missing Firebase configuration on iOS startup
Optimization(zh-Hant): 推播改由單一管線處理,兩個平台行為一致
Optimization(en-US): push now runs through one pipeline, the same on both platforms
Platform: ios

Fix(zh-Hant): 修正 App 開啟時收到的推播不會顯示也沒有聲音
Fix(en-US): fix pushes that arrived with the app open showing nothing and playing no sound
Fix(zh-Hant): 修正 iOS 推播 token 可能被錯誤型別覆蓋,導致推播收不到
Fix(en-US): fix the iOS push token being overwritten with the wrong kind, which stopped pushes arriving
Platform: android

Fix(zh-Hant): 修正僅支援 OpenGL ES 的舊款 Android 裝置上,玻璃雨滴效果的背景影像上下顛倒
Fix(en-US): fix the rain-on-glass backdrop rendering upside down on Android devices limited to the OpenGLES backend
@whes1015 whes1015 changed the title Storage/sqlite async Rebuild the iOS push pipeline, and move wind particles into the map Aug 24, 2026
@whes1015
whes1015 merged commit 89aa717 into main Aug 24, 2026
6 checks passed
@whes1015
whes1015 deleted the storage/sqlite-async branch August 24, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants