{"record":{"id":"938091fea9a83596","repo":"sveltejs/kit","slug":"refreshall-is-invalid-for-live-queries-use-reco","errorCode":null,"errorMessage":"refreshAll() is invalid for live queries. Use reconnectAll() instead.","messagePattern":"refreshAll\\(\\) is invalid for live queries\\. Use reconnectAll\\(\\) instead\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/kit/src/runtime/app/server/remote/requested.js","lineNumber":210,"sourceCode":"\t\t\tyield* race_all(selected, async (payload) => {\n\t\t\t\tconsume(payload);\n\t\t\t\ttry {\n\t\t\t\t\tconst parsed = parse_remote_arg(payload);\n\t\t\t\t\tconst validated = await __.validate(parsed);\n\t\t\t\t\treturn {\n\t\t\t\t\t\targ: validated,\n\t\t\t\t\t\tquery: __.bind(payload, validated),\n\t\t\t\t\t\tignore: create_ignore(payload)\n\t\t\t\t\t};\n\t\t\t\t} catch (error) {\n\t\t\t\t\trecord_failure(payload, error);\n\t\t\t\t\tthrow new Error(`Skipping ${__.name}(${payload})`, { cause: error });\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tasync refreshAll() {\n\t\t\tif (__.type === 'query_live') {\n\t\t\t\tthrow new Error('refreshAll() is invalid for live queries. Use reconnectAll() instead.');\n\t\t\t}\n\n\t\t\tfor await (const { query } of result) {\n\t\t\t\tvoid (/** @type {RemoteQuery<Output>} */ (query).refresh());\n\t\t\t}\n\t\t},\n\t\tasync reconnectAll() {\n\t\t\tif (__.type !== 'query_live') {\n\t\t\t\tthrow new Error('reconnectAll() is invalid for regular queries. Use refreshAll() instead.');\n\t\t\t}\n\n\t\t\tfor await (const { query } of result) {\n\t\t\t\tvoid (/** @type {RemoteLiveQuery<Output>} */ (query).reconnect());\n\t\t\t}\n\t\t},\n\t\tasync ignoreAll() {\n\t\t\tfor await (const { ignore } of result) ignore();\n\t\t}","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/kit/src/runtime/app/server/remote/requested.js#L192-L228","documentation":"`refreshAll()` re-runs regular queries to fetch fresh data; live queries instead maintain a server-push subscription, so refreshing them is meaningless. SvelteKit throws this to redirect you to `reconnectAll()`, which re-establishes the underlying live connections.","triggerScenarios":"Calling `requested(myLiveQuery, limit).refreshAll()` where `myLiveQuery` was created with `query.live(...)` (type `query_live`).","commonSituations":"Copy-pasting refresh logic written for regular queries into a component that batch-iterates live queries; refactoring a `query` into `query.live` without updating the refresh calls.","solutions":["Replace `.refreshAll()` with `.reconnectAll()` for live-query batches.","Keep separate helper functions for refreshing regular vs live batches.","If the data should be pull-based, change the remote function from `query.live` to `query`."],"exampleFix":"// before\nawait requested(liveNotifications, Infinity).refreshAll();\n// after\nawait requested(liveNotifications, Infinity).reconnectAll();","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isLiveQueryBatch(fn) { return fn.type === 'query_live'; }","tryCatchPattern":"try {\n  if (isLiveQueryBatch(myQuery)) await batch.reconnectAll();\n  else await batch.refreshAll();\n} catch (e) {\n  console.error(e.message);\n}","preventionTips":["Name live queries consistently (e.g. `*Live`) so maintenance calls are obvious.","Never share one refresh helper across live and regular query batches.","Update call sites when converting `query` to `query.live`."],"tags":["remote-functions","live-queries","api-misuse"],"backgroundTag":"wrong-refresh-method-for-live-query","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}