Repository navigation
fix(location): stop recording a refused GPS fix as a crash - #633
Merged
Merged
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): turning location off or denying it is no longer recorded as an app error
whes1015
force-pushed
the
fix/location-refusal
branch
from
October 22, 2026 00:31
e0e22d3 to
1d6219e
Compare
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 做了什麼
關掉定位、或拒絕定位權限,不再被記成 Crashlytics 錯誤。定位還是拿不到,呼叫端一樣得到空結果;差在這不再被當成故障。
正式程式碼:
isLocationRefusal認LocationServiceDisabledException和PermissionDeniedExceptionLocationService的現在位置、上次位置、鄉鎮查詢碰到這兩種就只記警告DeviceLocationReporter的定位串流一樣。訂閱還是會放下,定位服務回來之後restart仍會重開測試:拒絕的上次位置、現在位置、鄉鎮查詢不會進 crash sink;真正的平台錯誤仍會。串流被關掉不進 sink,換一個別的錯誤仍會,而且
restart之後還聽得到。Crashlytics(近 89 天,到 2026-10-20 22:46,UTC+8;重寫版
26w42l/26w43a):89f9c2f9…定位服務關掉,13 次 / 7 人。最新一筆今天 17:07,26w43af7253cc4…使用者拒絕定位,1 次 / 1 人,26w42l。訊息就是 Android 的PERMISSION_DENIED沒有做:
7277e6d4…(219 次 / 88 人)是每次啟動故意送的非致命,不是這次要拿掉的no such table: fix(18 次 / 14 人)已在 fix(location): record movement history on Android #630 修,最新一筆仍是修之前的26w42l(426000781),今天 18:49MissingPluginException各 1 次,沒有對上能改的程式相關 issue
開 PR 前搜過
gh issue list --state all --search '定位 權限 OR location permission OR Crashlytics'。沒有對應的 issue。怎麼驗
本機:
tool/dev/analyze.sh通過tool/check/commits.sh origin/main..HEAD通過tool/check.sh通過(完整測試 3628 通過,另有 6 個跳過)。本機是 Darwin,CI 是 Linuxtool/dev/test.sh test/core/geo/location_service_test.dart test/core/geo/device_location_reporter_test.dart通過實機用
tool/run.sh:location stream的錯誤上報檢查清單
tool/check/commits.sh origin/main..HEAD通過—— commit 訊息就是更新日誌,格式見 commit.md
mise exec -- flutter analyze與mise exec -- flutter test通過—— 實際跑的是
tool/dev/analyze.sh與 pre-push 的tool/check.sh。沒有直接打mise execAppLocalizations,沒有寫死gh pr checks:每一項都是 pass 或 skipped)—— 沒過不能合併,見 pr.md
——
build、Android、iOS、code-review、changes、codecov/project、codecov/patch都是 passAppSpacing/AppRadius/AppMotion,深色模式看過,文字對比度可接受
—— 沒有改版面