Skip to content

Commit d09a05f

Browse files
authored
fix: bust cache for .info() calls (#626)
1 parent d4b6be8 commit d09a05f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/shy-waves-obey.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@supabase-cache-helpers/storage-core": patch
3+
---
4+
5+
fix: bust cache for .info() calls

packages/storage-core/src/url-fetcher.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export const createUrlFetcher = (
2828
if (config?.ensureExistence) {
2929
const { data: exists } = await fileApi.exists(path);
3030
if (!exists) return;
31-
const { data: fileInfo } = await fileApi.info(path);
31+
// the `info` endpoint is cached - we need to bust it
32+
const { data: fileInfo } = await fileApi.info(
33+
`${path}?bust=${Date.now()}`,
34+
);
3235
if (!fileInfo) return;
3336
const value = fileInfo.lastModified || fileInfo.updatedAt;
3437
if (!value) return;

0 commit comments

Comments
 (0)