debug: hex dump batch_stories responses >1KB that parse 0 stories

This commit is contained in:
Majjo
2026-04-20 15:17:45 +02:00
parent d9593fa629
commit ded49b8b1b

View File

@@ -381,6 +381,12 @@ class CompanionServer : Feature("CompanionServer") {
}
}
}
// If still 0 and response is large enough to contain stories, dump hex for inspection
if (parsed == 0 && buffer.size > 1000) {
val hexPreview = buffer.take(128).joinToString(" ") { "%02x".format(it) }
pushStoryDebug("no_match", mapOf("endpoint" to endpoint, "hex_preview" to hexPreview, "bytes" to buffer.size))
context.log.warn("CompanionServer: [$endpoint] ${buffer.size}B parsed 0 — hex: $hexPreview", "CompanionServer")
}
}
context.log.info("CompanionServer: [$endpoint] parsed $parsed new stories (total=${capturedStories.values.sumOf { it.size }})", "CompanionServer")