[Bug]: Renewing a workspace HTML preview URL discards form input
Problem
An interactive HTML workspace preview loses its form input when the signed asset URL renews. This can happen without closing or editing the file. The HTML sandbox blocks localStorage, so a page using that for persistence has no saved copy to restore.
Trigger in current main
Source checked at 1f093d119b:
packages/client-runtime/src/state/assets.tsrefreshes subscribed asset URLs every 30 minutes.WorkspaceBrowserPreviewinapps/web/src/components/files/FilePreviewPanel.tsxpasses the renewed URL intoBrowserDocumentFrame.BrowserDocumentFrame.tsxuseskey={props.src}andsrc={props.src}on the HTML iframe. A new signature recreates the frame, clearing the document's memory and input fields.
The installed 0.0.45 host (6c8fed35dded) has the same refresh interval and iframe behavior. Its older sandbox additionally blocks downloads, as covered by #14362. That export fix does not fix renewal-driven reloads.
Reproduction
Open a workspace HTML file containing a textarea, enter some text, and leave its Files preview open through an asset-URL renewal. Expected: the existing document and input remain. Actual code path: a new signed URL remounts the frame.
For a deterministic component reproduction, render BrowserDocumentFrame with /assets/token-a/review.html, then update it to /assets/token-b/review.html for the same file revision. The iframe instance and its src both change. A changed file revision should still load the new document; a fresh authorization token should not count as a content change.
Evidence limits
This came from investigating lost feedback in a generated HTML review. The original user-side viewing surface has not been established. I reproduced the sandbox storage error and blocked/exporting download variants through the installed T3 native preview tools, using synthetic input only. The renewal trigger above is from the actual source and a focused component reproduction, not a claim to have recorded the user's original loss or waited 30 minutes in a current-main remote client.
closing as addressed by #17736, merged into main: workspace HTML previews keep the loaded document when only the signed asset URL renews. A resource or revision change still loads a new document, but token renewal no longer clears form input.
thanks for reporting this. if you still face it on a build containing this fix, please ask us to reopen this issue or open a new issue linking back here, with your version, os and reproduction steps.
closed at the request of @UtkarshUsername.