mirror of
https://github.com/Dasemu/NavFrame.git
synced 2026-11-26 07:16:06 +00:00
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FdDjmR7v3NW8B5F37mxZWE
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -54,7 +54,7 @@ internal fun classifyMapRenderFailure(message: String?): MapRenderFailure {
|
|||||||
/** Preserve only known diagnostic vocabulary, never arbitrary SDK text or identifiers. */
|
/** Preserve only known diagnostic vocabulary, never arbitrary SDK text or identifiers. */
|
||||||
internal fun safeSdkEvidence(message: String?): String {
|
internal fun safeSdkEvidence(message: String?): String {
|
||||||
if (message.isNullOrBlank()) return "EMPTY"
|
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.
|
// Strip entire URLs, paths and quoted payloads before vocabulary extraction.
|
||||||
val stripped = message.lowercase(java.util.Locale.ROOT)
|
val stripped = message.lowercase(java.util.Locale.ROOT)
|
||||||
.replace(Regex("""[a-z][a-z0-9+.-]*://\S+"""), " ")
|
.replace(Regex("""[a-z][a-z0-9+.-]*://\S+"""), " ")
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class MapRenderDiagnosticsTest {
|
|||||||
}
|
}
|
||||||
@Test fun missingBundledAssetIsReportedAsNotFound() {
|
@Test fun missingBundledAssetIsReportedAsNotFound() {
|
||||||
// MapLibre's AssetManagerFileSource message for an absent glyph range or other asset.
|
// 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() {
|
@Test fun timeoutHasSeparateStageAndDoesNotPretendThatTheNetworkFailed() {
|
||||||
val failure = MapRenderException(MapRenderFailure.TIMEOUT, MapRenderStage.STYLE_READY)
|
val failure = MapRenderException(MapRenderFailure.TIMEOUT, MapRenderStage.STYLE_READY)
|
||||||
|
|||||||
Reference in new issue
Block a user