gallery/harnesses/gtauri
Greg Pomerantz bb349dac82 gtauri: URI-driven MediaStore events; remove truncation machinery
Watching is now exactly what the OS tells us, with no filesystem
scanning on the event path:

- MainActivity's ContentObserver receives the changed URI from
  Android. It queries that ONE row (~ms, no debounce) and drops a
  one-line payload: A|media_id|path|size (row exists) or
  D|media_id (row gone). Per-event files (.ms_recent.N, never
  overwritten) so a burst cannot clobber an unread event. A zero-arg
  JNI call wakes Rust; a 1 s backstop also drains the queue, so a
  lost wake self-heals in a second.
- Rust applies the payload directly: upsert with media_id stored, or
  delete resolved by id (items row first, then a media_map table that
  records id→path for EVERY add event — including rows created by a
  filesystem walk, which doesn't know the id). Content changes reset
  decode-failure state so a still-being-written photo retries.
- The disk is the truth: the payload size is ignored in favor of a
  stat (the scanner can leave _size NULL).
- The full FS walk remains as startup baseline + 5-min reconciliation,
  and the mtime-diff incremental rescan remains as a second
  independent path. Verified on the emulator: add → grid in ~2 s
  (incl. OS scanner), delete → grid in ~2 s via media_id, missed wake
  drained in 1 s.

Truncation machinery REMOVED (per user: FUSE is reliable; the
'truncations' were counting errors and a stale-DB cross-check firing
on legitimate changes): the two-strike mass-delete guard, the
walked_max watermark, the layer-2 re-walk, the per-directory stale
cross-check, and the read_dir_full retries are all gone. The one
invariant that replaces them: a walk that hits ANY filesystem error
fails and is NOT applied (an error is not 'those files are gone').
The phone DB now converges to the exact disk count (8,439 = 8,399
Camera + 27 Screenshots + 11 Messaging + 2 Bluesky); the earlier
10,166/8,438 swings were real disk-state changes, not truncation.

Emulator display fixed: the AVD image ships with
debug.hwui.drawing_enabled=0 (every window renders black, HWUI
drawing disabled system-wide). 'adb shell setprop
debug.hwui.drawing_enabled 1' after each boot restores rendering —
it is a runtime prop, so it must be re-set on every cold boot.
2026-11-02 11:09:29 -05:00
..
capabilities gtauri: Tauri v2 gallery harness WORKING on emulator 2026-10-31 18:59:51 -04:00
frontend/dist gtauri: fix camera-photo latency, delete blank boxes, truncation guard 2026-11-02 08:01:13 -05:00
gen gtauri: URI-driven MediaStore events; remove truncation machinery 2026-11-02 11:09:29 -05:00
icons gtauri: Tauri v2 gallery harness WORKING on emulator 2026-10-31 18:59:51 -04:00
scripts gtauri: Tauri v2 gallery harness WORKING on emulator 2026-10-31 18:59:51 -04:00
src gtauri: URI-driven MediaStore events; remove truncation machinery 2026-11-02 11:09:29 -05:00
.tauriignore gtauri: Tauri v2 gallery harness WORKING on emulator 2026-10-31 18:59:51 -04:00
app-icon.png gtauri: Tauri v2 gallery harness WORKING on emulator 2026-10-31 18:59:51 -04:00
build.rs gtauri: Tauri v2 gallery harness WORKING on emulator 2026-10-31 18:59:51 -04:00
Cargo.lock gtauri: event-driven watching + defense against stale VFS dir listings 2026-11-01 20:24:01 -05:00
Cargo.toml gtauri: event-driven watching + defense against stale VFS dir listings 2026-11-01 20:24:01 -05:00
tauri.conf.json gtauri: event-driven watching + defense against stale VFS dir listings 2026-11-01 20:24:01 -05:00