fix: force disk fallback in LocatorConverter to fix MD/TXT reading position (#40)

Background pre-processing for single-file imports (MD/TXT) was generating empty DB cache entries because it only looked at RAM content. This caused position saves in Vertical Mode to fail. This fix ensures that an empty cache entry triggers a disk-read fallback to generate valid semantic blocks on-demand.
This commit is contained in:
Aryan 2026-03-07 22:34:08 +05:30 committed by GitHub
parent b9f8825ad7
commit 6bc4f9bafd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 104 additions and 51 deletions

View file

@ -181,6 +181,9 @@ class CfiJsBridge(
@JavascriptInterface
fun onCfiExtracted(jsonResponse: String) {
try {
// --- ADDED LOG ---
Timber.tag("PosSaveDiag").d("CfiJsBridge.onCfiExtracted: Raw JSON received from JS: $jsonResponse")
val json = JSONObject(jsonResponse)
val cfi = json.optString("cfi", "/4")
val logArray = json.optJSONArray("log")
@ -200,7 +203,7 @@ class CfiJsBridge(
onCfiReady(cfi)
}
} catch (e: Exception) {
Timber.e(e, "Error parsing CFI JSON response: $jsonResponse")
Timber.tag("PosSaveDiag").e(e, "CfiJsBridge.onCfiExtracted: Error parsing CFI JSON response: $jsonResponse")
onCfiReady("/4")
}
}