Skip to content

Commit ba8507c

Browse files
committed
fix(files): clear image dimensions on content swap (completes self-heal)
The self-heal rework left the old image's dimensions in the row after a content replacement, so the next view of the new bytes reserved a wrong-sized box before correcting. Clear width/height on the content-swap write so the row never describes stale content: the next view falls back to the baseline first-load reflow and the browser's measurement backfills the correct size. No server-side decode (EXIF-safe), and the client's overwrite-on-mismatch handles a late PATCH.
1 parent 17499b1 commit ba8507c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

apps/sim/lib/uploads/contexts/workspace/workspace-file-manager.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,13 @@ export async function updateWorkspaceFileContent(
13121312
key: uploadResult.key,
13131313
size: content.length,
13141314
contentType: nextContentType,
1315+
// Replaced bytes: drop the old image's dimensions so the row never describes stale content.
1316+
// The next view reserves nothing (the baseline first-load reflow) rather than a wrong-sized
1317+
// box, then the browser's measurement backfills the correct value. No server-side decode here
1318+
// (avoids EXIF-orientation guesswork), and a late in-flight PATCH that lands after this is
1319+
// corrected on the next view since the client overwrites on mismatch.
1320+
width: null,
1321+
height: null,
13151322
updatedAt: now,
13161323
contentUpdatedAt,
13171324
})

0 commit comments

Comments
 (0)