Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Connect a client to a T3 Code server and open a workspace PDF in the Files panel.
- Click Open file in preview browser. The PDF opens in a Browser tab.
- Within about 30 minutes, overwrite the PDF at the same path, for example by rebuilding it.
- Check the Files panel: it shows the new PDF.
- Close the Browser tab and click Open file in preview browser again.
Expected behavior
The Browser tab shows the current file, matching the Files panel.
Actual behavior
The Browser tab shows the previous version of the PDF, while the Files panel beside it shows the new one.
The button:
Browser tab after reopening, still on the old subtitle (personal details redacted):
Files panel at the same moment, on the new subtitle (personal details redacted):
Cause
Two caches line up:
- The button reuses its signed URL.
FilePreviewPanelcreates its runner withoutrefresh: true, soexecuteAtomQueryreturns the value cached byassets.createUrl, which stays fresh for 30 minutes. - The client caches that URL. Asset responses send
Cache-Control: private, max-age=3600, and the PDF is embedded by the client, so the same URL is served from its HTTP cache without reaching the server.
The Files panel escapes this because it mints a new URL per workspace revision, under a different resource key (media-file for PDFs, against workspace-file for the button). That re-mint does not refresh the button's entry.
The other two openFileInPreview callers, ChatMarkdown and DesktopWebLinkCoordinator, already pass refresh: true. Only this button does not.
Proposed fix
--- a/apps/web/src/components/files/FilePreviewPanel.tsx
+++ b/apps/web/src/components/files/FilePreviewPanel.tsx
@@
const createAssetUrl = useAtomQueryRunner(assetEnvironment.createUrl, {
reportFailure: false,
+ refresh: true,
});Each click then mints a new signed URL, so the browser cannot match the old entry. A regression test could assert that two clicks on the button request two mints.
This does not change reloading a tab that is already open: it keeps the same URL, so it can still get cached bytes until max-age runs out. That would need a server change for mutable workspace files, such as no-cache, and seems better handled separately.
What I checked
- A URL minted before the overwrite, fetched directly from the server afterwards, returned the new bytes with
cache-control: private, max-age=3600. The server is correct, so the stale bytes come from the client side. - Running
executeAtomQueryagainst a counting atom returned the cached value withrefresh: falseand a new value withrefresh: true. - The missing option and the cache header are present in the versions listed below.
I have not run the proposed patch in the app.
Impact
Minor bug or occasional failure
Version or commit
Seen on 0.1.11-nightly.20261117.4851. The same code is in 0.1.11-nightly.20261118.4864 and main @ a93e61a.
Environment
T3 Code server on Linux, used remotely from a macOS client.
Workaround
Open the file from a link in chat, which mints a new URL, or wait about 30 minutes before reopening it from the Files panel.
Related
Same family, different code path: #15676 and #15739 (both closed). #36202 and #36205 cover expired URLs in the Browser panel, not stale content.



Activity
imryanthedev commentedon Nov 18, 2026
Hey I see we both opened our PR at the same time. And that we more or less have the same code.
I would appreciate it if you could please consider mine instead?
Appreciate you guys fixing this bug and working on this project in all cases.
imryanthedev commentedon Nov 18, 2026
Well that was quick. Thanks for dealing with the bug 🫡