Skip to content

Commit 01afb52

Browse files
fix: Use no-cache for fetching registry (#3760)
To prevent users from having stale registry data, we fetch using `no-cache` which always should recheck the registry for new updates instead of relying on the browser cache. If the content has not changed the browser will re-use the existing data and we keep falling back to the previous version in state. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Ensure registry fetches bypass HTTP cache by calling fetch with { cache: 'no-cache' } in safeFetch. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2afb2a3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent d49e222 commit 01afb52

File tree

1 file changed

+1
-1
lines changed
  • packages/snaps-controllers/src/snaps/registry

1 file changed

+1
-1
lines changed

packages/snaps-controllers/src/snaps/registry/json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ export class JsonSnapsRegistry extends BaseController<
423423
* @private
424424
*/
425425
async #safeFetch(url: string) {
426-
const response = await this.#fetchFunction(url);
426+
const response = await this.#fetchFunction(url, { cache: 'no-cache' });
427427
if (!response.ok) {
428428
throw new Error(`Failed to fetch ${url}.`);
429429
}

0 commit comments

Comments
 (0)