Merge pull request #11 from Dasemu/hotfix/tft-render-diagnostics

Improve TFT map failure diagnostics and preserve incident onset
This commit is contained in:
dasemu authored and GitHub committed 2026-10-13 16:00:33 +02:00
commit 4d0df9c0a2
7 files changed
+127 -17

No files matched your search

+3 -1
View File
@@ -14,11 +14,13 @@ Each event contains its UTC timestamp, app version, Android API level, MapLibre
The backoff attempt is capped at four, like the renderer's existing retry policy. Repeated failures continue to create separate timestamped records after that limit. Only the first successful render following failures creates a recovery record; normal successful frames are not logged.
From 0.13.6, diagnostics also retain the callback/exception class, a bounded sequence of allowlisted SDK diagnostic words (`WORDS_...`), screen interactive state, low-memory status and available system memory. Render stages distinguish camera updates, route GeoJSON updates and snapshot requests; native snapshot failure callbacks carry `SnapshotterErrorCallback` rather than the generic `SDK_CALLBACK`. URL/path/quoted payloads are removed before extracting known diagnostic words. An empty callback is distinguished from an unclassified nonempty message. This exposes messages such as snapshot/failed/no/tile/data without copying arbitrary SDK text. These fields are evidence, not proof that memory or screen state caused the failure.
Raw SDK messages, stack traces, URLs, tokens, coordinates, route geometry, destinations, search text, and Bluetooth identifiers are excluded. The history contains fixed labels and numbers, not a copy of Logcat. Network state is diagnostic context: a disconnected network does not itself explain a failure of a selected local map.
## Storage and limits
The history is a private app file named `tft-map-diagnostics.json` in Android's `noBackupFilesDir`. No storage permission is required; the app does not upload it automatically, and it is excluded from backup/device transfer. The file retains the latest 100 failure/recovery events and is bounded at 128 KiB. Older events are discarded when the limit is reached.
The history is a private app file named `tft-map-diagnostics.json` in Android's `noBackupFilesDir`. No storage permission is required; the app does not upload it automatically, and it is excluded from backup/device transfer. The file retains up to 100 failure/recovery records and is bounded at 128 KiB. Starting with 0.13.6, consecutive identical failures at the maximum retry backoff are grouped into one record with an occurrence count and first/last UTC timestamps. Initial retries and recovery records remain separate; the aggregate shows the latest navigation, network and TFT states. Changes in error classification, source, mode or app version start a new record. This prevents a long stream of identical failures from immediately erasing its onset. Older records are discarded when the limit is reached. Existing 0.13.2–0.13.5 files remain readable; previously evicted events cannot be recovered.
File operations run on an IO dispatcher. Writes are synced and replaced atomically, so an interrupted replacement preserves the previous completed history. A failure that occurs while a shutdown interrupts its write may not be retained. Clearing app data or uninstalling NavFrame deletes the history.