Skip to content

Commit d5cfb22

Browse files
authored
fix: delete hydration cache on effect teardown (#14611)
1 parent 646836c commit d5cfb22

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/thin-clubs-press.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: delete hydration cache on effect teardown

packages/kit/src/runtime/client/remote-functions/shared.svelte.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/** @import { RemoteFunctionResponse } from 'types' */
33
/** @import { Query } from './query.svelte.js' */
44
import * as devalue from 'devalue';
5-
import { app, goto, query_map } from '../client.js';
5+
import { app, goto, query_map, remote_responses } from '../client.js';
66
import { HttpError, Redirect } from '@sveltejs/kit/internal';
77
import { tick } from 'svelte';
88
import { create_remote_cache_key, stringify_remote_arg } from '../../shared.js';
@@ -62,6 +62,7 @@ export function create_remote_function(id, create) {
6262
void tick().then(() => {
6363
if (!entry.count && entry === query_map.get(cache_key)) {
6464
query_map.delete(cache_key);
65+
delete remote_responses[cache_key];
6566
}
6667
});
6768
}

0 commit comments

Comments
 (0)