# fix\(clients\): later image reads show updated file contents · PR \#23510 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/23510)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: open

Source repository: pingdotgg/t3code

Source branch: fix/issue-13138-preview-cache

Target branch: main

Head commit: bf4c90b14702fa8dc5370645aa02eed37c76f76e

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/23510)

[Commits](https://git.cafe/pingdotgg/t3code/pull/23510/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/23510/diffs?format=markdown)

## Description

---

## Problem

A later Read of an overwritten image reused an earlier Read’s signed URL and displayed stale bytes. Writing red, green, then blue to the same path and expanding each Read showed red in all three previews.

## Change

Include the Read item identity in the client asset-query cache key on web and mobile. Strip that identity before RPC execution, including the local-media fallback, so each later Read obtains a fresh URL while repeated rendering of the same Read reuses its cache entry. The server contract is unchanged.

## Scope and approval

Fixes #13138

Triaged bug via the automated issue flow. This only corrects inspected-image cache reuse; it does not snapshot historical image bytes.

## Verification

- Regression test failed on main: later Read descriptors were identical. Both focused files now pass, 22 tests, including after merging main.
- Production atom test verifies same-key reuse, distinct-key URLs, and removal of the client key from remote and fallback RPCs; a mutation check fails when stripping is removed.
- Scoped client-runtime, web, and mobile typechecks passed. Targeted lint and formatting passed.
- Real app with Claude: already-open red rows remained red; a new Read after overwriting green displayed RGB 0,255,0.
- Paired real-web recordings show stale red/red/red before and red/green/blue after, including atomic replacement outside the workspace. Row collapse/reopen and one lightbox open/close added no signing requests in summarized traces; the atom test directly proves reuse.

### Evidence

[Full evidence index: recordings, narrated steps, all before/after pairs, diffs, rendering environment, and row accounting](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/30ed830480c82312/issue-13138-evidence-index-corrected.md). Linux Chromium 154, 390×900 CSS pixels, DPR 2, light theme below. Diff0 amplifies absolute RGB differences 8×; DiffT marks differences greater than 16/255.

Visible differences: R1 stays red; R2red→green and R3red→blue. Geometry/captions same.390 light includes small breadcrumb chevron hover contrast;1440 includes codec/background noise and base-only Scroll to end affordance.

780×1800; Diff0 76444pixels (5.444729%); DiffT 76416pixels (5.442735%).

|Before|After|Diff0|DiffT|
|---|---|---|---|
|![S1-base-390-light.png](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2436d38c297d7ae5/S1-base-390-light.png)<br>source [3b95e7831b](https://git.cafe/pingdotgg/t3code/commit/3b95e7831b11b17627dff16843bc087bfca397ec)<br>SHA256 `fd7ea1695123652bd6b3cfd9b85048c6fe969b79d8b6ca21585529695e00472b`|![S1-head-390-light.png](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2e90f59ee21ad87b/S1-head-390-light.png)<br>source [423865defb](https://git.cafe/pingdotgg/t3code/commit/423865defb0022956d0a4894a497c9a5d5e9fc96)<br>SHA256 `411256fba930452bc6ce92b39858c61f720f667fff2c1e4a4d44d1e90fa2602b`|![S1-diff0-390-light.png](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/64d644e097ad9925/S1-diff0-390-light.png)<br>source 3b95e7831b11b17627dff16843bc087bfca397ec vs 423865defb0022956d0a4894a497c9a5d5e9fc96<br>SHA256 `5c369414aa7ee3101cbea0dfe7caf6023415aa82c44662162e6f00cb4ff0e3dc`|![S1-diffT-390-light.png](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/99a48b5b1f698533/S1-diffT-390-light.png)<br>source 3b95e7831b11b17627dff16843bc087bfca397ec vs 423865defb0022956d0a4894a497c9a5d5e9fc96<br>SHA256 `762aabf77c139be27a74fa83c2f97129b056383a86dc9e1215debe62d32018f9`|

[Before: atomic overwrite recording](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/60680694d3405382/atomic-base-390-light.mp4) · [After: atomic overwrite recording](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4d32c91fb604d968/atomic-head-390-light.mp4). At approximately 0.8 seconds R1 is red, 2.4 seconds follows green replacement/R2, and 4 seconds follows blue replacement/R3. Baseline stays red; fixed previews update.

Visible differences: later Read image colors change; small breadcrumb hover contrast also differs. Desktop recording-derived frames include codec noise and a Scroll-to-end affordance difference. The index lists every observed difference; no pixel-equivalence claim is made.

Limitations: captures above predate the main merge; exact revision provenance is in the index. Independent final-head reconstruction passed: atomic overwrite yielded decoded red/green/blue; all 17 delivered diff pairs and 68 image hashes verified. Grouped/detail-only extraction, event-ingestion captures, retry/thread revisit, and ordinary markdown/tool-output visual controls are incomplete. Static conditional fixtures bypass signing. Native iOS is unverified: both source-specific EAS builds failed to resolve GhosttyKit despite the framework being included. Electron desktop is unverified on this Linux VM. cannot-verify ios desktop.

![Independent final-head rebuild: red, green, and blue](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/03f6384884427987/final-head-S1-390-light.png)

Implemented with Claude Opus 5.5 in the Claude Code harness; triage, evidence, and review with GPT-6.1-sol in the Codex harness through T3 Code.

