From 2977db39b6b01261c50dd8366e47d029a4b90810 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 26 Oct 2026 05:53:34 +0000 Subject: [PATCH] fix: keep missing bundled assets classified as NOT_FOUND after merging main Merging main brought the hotfix that filters SDK messages through a fixed vocabulary before classification and appends that evidence to safeText. "asset" was not in the vocabulary, so "Could not read asset" reduced to "could not read" and the NOT_FOUND rule from 0.13.7 never matched, failing MapRenderDiagnosticsTest.missingBundledAssetIsReportedAsNotFound. Allow "asset"/"assets" as diagnostic vocabulary and expect the evidence suffix the merged safeText now carries. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FdDjmR7v3NW8B5F37mxZWE --- app/src/main/java/dev/navframe/app/MapRenderDiagnostics.kt | 2 +- app/src/test/java/dev/navframe/app/MapRenderDiagnosticsTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/dev/navframe/app/MapRenderDiagnostics.kt b/app/src/main/java/dev/navframe/app/MapRenderDiagnostics.kt index 27b2fac..6ebded6 100644 --- a/app/src/main/java/dev/navframe/app/MapRenderDiagnostics.kt +++ b/app/src/main/java/dev/navframe/app/MapRenderDiagnostics.kt @@ -54,7 +54,7 @@ internal fun classifyMapRenderFailure(message: String?): MapRenderFailure { /** Preserve only known diagnostic vocabulary, never arbitrary SDK text or identifiers. */ internal fun safeSdkEvidence(message: String?): String { if (message.isNullOrBlank()) return "EMPTY" - val allowed = setOf("failed", "failure", "error", "exception", "load", "loading", "loaded", "style", "map", "snapshot", "snapshotter", "render", "rendering", "fully", "tile", "tiles", "data", "no", "not", "missing", "empty", "invalid", "corrupt", "unsupported", "resource", "request", "cancelled", "canceled", "cancel", "timeout", "timed", "out", "file", "archive", "pmtiles", "read", "write", "open", "permission", "denied", "such", "directory", "end", "unexpected", "parse", "parsing", "json", "geojson", "glyph", "glyphs", "font", "sprite", "image", "bitmap", "memory", "allocation", "context", "lost", "egl", "opengl", "framebuffer", "shader", "gpu", "network", "connection", "socket", "resolve", "dns", "http", "status", "code", "server", "returned", "forbidden", "found", "active", "already", "started", "finished", "destroyed", "source", "sources", "size", "dimensions", "download", "unable", "cannot", "could", "compression", "compressed", "gzip", "zstd", "protobuf", "decode", "decoding", "truncated", "eof", "i", "o", "to", "of", "is", "been", "has", "was", "be", "gl", "graphics", "canvas", "layer", "supported") + val allowed = setOf("failed", "failure", "error", "exception", "load", "loading", "loaded", "style", "map", "snapshot", "snapshotter", "render", "rendering", "fully", "tile", "tiles", "data", "no", "not", "missing", "empty", "invalid", "corrupt", "unsupported", "resource", "request", "cancelled", "canceled", "cancel", "timeout", "timed", "out", "file", "archive", "pmtiles", "read", "write", "open", "permission", "denied", "such", "directory", "end", "unexpected", "parse", "parsing", "json", "geojson", "glyph", "glyphs", "font", "sprite", "image", "bitmap", "memory", "allocation", "context", "lost", "egl", "opengl", "framebuffer", "shader", "gpu", "network", "connection", "socket", "resolve", "dns", "http", "status", "code", "server", "returned", "forbidden", "found", "active", "already", "started", "finished", "destroyed", "source", "sources", "asset", "assets", "size", "dimensions", "download", "unable", "cannot", "could", "compression", "compressed", "gzip", "zstd", "protobuf", "decode", "decoding", "truncated", "eof", "i", "o", "to", "of", "is", "been", "has", "was", "be", "gl", "graphics", "canvas", "layer", "supported") // Strip entire URLs, paths and quoted payloads before vocabulary extraction. val stripped = message.lowercase(java.util.Locale.ROOT) .replace(Regex("""[a-z][a-z0-9+.-]*://\S+"""), " ") diff --git a/app/src/test/java/dev/navframe/app/MapRenderDiagnosticsTest.kt b/app/src/test/java/dev/navframe/app/MapRenderDiagnosticsTest.kt index 43080b9..66ea2ac 100644 --- a/app/src/test/java/dev/navframe/app/MapRenderDiagnosticsTest.kt +++ b/app/src/test/java/dev/navframe/app/MapRenderDiagnosticsTest.kt @@ -33,7 +33,7 @@ class MapRenderDiagnosticsTest { } @Test fun missingBundledAssetIsReportedAsNotFound() { // MapLibre's AssetManagerFileSource message for an absent glyph range or other asset. - assertEquals("UNKNOWN/NOT_FOUND/SDK_CALLBACK", mapErrorDetail("Could not read asset").safeText()) + assertEquals("UNKNOWN/NOT_FOUND/SDK_CALLBACK/WORDS_COULD_NOT_READ_ASSET", mapErrorDetail("Could not read asset").safeText()) } @Test fun timeoutHasSeparateStageAndDoesNotPretendThatTheNetworkFailed() { val failure = MapRenderException(MapRenderFailure.TIMEOUT, MapRenderStage.STYLE_READY)