fix(gui): release cache waits for materialized previews

Merged
JL
5d ago
+103-17

After a native history refresh preserves existing preview bytes alongside an incoming preview cache key, Status and channel previews could wait indefinitely for a cache read that the materialization scheduler would never admit. Use the scheduler's reference eligibility rule for UI wait decisions, and make Status use the same failure-aware wait predicate. A full cache key still receives its local attempt; missing full files release the wait without discarding the existing preview.

Follow-up to merged #284 and its Codex P2 finding. Based on current main 39fca7f; no changes to the merged branch.

Reproduction uses synthetic rows and the real Chat::insert_history_message path: retain preview bytes, refresh an empty row carrying only preview_cache_key, then check scheduling and wait decisions. The new regression test fails on main before this fix. A second test covers reopened image/video status, full-cache eligibility, failure release, and preview preservation.

Validation on 2507412:

  • Materialization tests: 16 passed.
  • Full GUI tests with all features: 616 passed, 9 ignored.
  • GUI Clippy across all targets/features with -D warnings: passed.
  • Workspace formatting and diff whitespace checks: passed.
  • Web check using nightly-2026-10-29, wasm32 and build-std: passed; existing warnings in unchanged paths remain.

This is a correctness follow-up; no new performance claim or real-account measurement. Remote CI and automatic review are pending.


Summary by cubic

Fixes Status and channel previews waiting indefinitely for a cache read that the materialization scheduler would never admit, which happened when a history refresh preserved existing preview bytes but introduced a new preview cache key. Wait decisions now use the scheduler's reference eligibility rule, and Status uses the same failure-aware predicate.

  • A full cache key still receives its local read attempt; a failed attempt releases the wait without discarding the preserved preview bytes.
  • Adds regression tests for preserved previews, reopened image/video status, full-cache eligibility, and failure release.