fix(web/claw): fetch an image again for a card the mirror rebuilt
android / debug (push) Successful in 2m31s
ci / docker (push) Successful in 2m3s
ci / web (push) Successful in 15s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 2m3s
android / release (push) Successful in 2m13s
ci / checks (push) Successful in 1m7s
ci / test (push) Successful in 39s
ci / chart (push) Successful in 5s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 13s
ci / publish-edge-chart (push) Successful in 3s
android / debug (push) Successful in 2m31s
ci / docker (push) Successful in 2m3s
ci / web (push) Successful in 15s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 2m3s
android / release (push) Successful in 2m13s
ci / checks (push) Successful in 1m7s
ci / test (push) Successful in 39s
ci / chart (push) Successful in 5s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 13s
ci / publish-edge-chart (push) Successful in 3s
A page read, a mirror reset, or a turn folding into the record builds new card objects, and the pass that fetches image bytes remembered attachment ids, so a rebuilt card whose bytes had not landed was never asked for again. The guard now rides the card object: a new card gets its fetch, and the useClaw cache answers a repeat with the blob it already holds, so nothing is requested twice. The object URL also lands on every card naming the id, not only the first. A page's open tail is dropped and re-read with the turn's beginning above it, which can leave two cards for one attachment, and the second stayed blank.
This commit is contained in:
1 parent
ea6edfe67a
commit
70b53665d5
3 files changed
+23
-16
No files matched your search
@@ -437,13 +437,14 @@ export function useTranscript() {
|
||||
}
|
||||
}
|
||||
|
||||
/** An attachment's object URL landed; stored on its card. The useClaw
|
||||
/** An attachment's object URL landed; stored on every card that names
|
||||
* the id. Two cards can hold one id when a page's open tail is dropped
|
||||
* and re-read, so the loop does not stop at the first. The useClaw
|
||||
* cache keeps a reconnect's replay from refetching the bytes. */
|
||||
function setAttachmentUrl(id: string, url: string): void {
|
||||
for (const card of cards()) {
|
||||
if (card.kind === 'attachment' && card.attachment.id === id) {
|
||||
card.attachment.url = url
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user