Skip to content

Commit 9712ebb

Browse files
committed
fix(client): discard catalog responses after shutdown
1 parent 1790baf commit 9712ebb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎packages/client/src/solid/data.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,7 @@ export function createData(config: CreateDataInput) {
14301430
return
14311431
}
14321432
const response = await load(locationQuery(location))
1433+
if (shutdowns.has(id)) return
14331434
const key = locationKey(response.location)
14341435
publish(key, response.data)
14351436
if (options?.alias && key !== id) publish(id, response.data)

‎packages/client/test/solid-data.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,9 +1272,12 @@ test("discards queued MCP refreshes and ignores an old read finishing after shut
12721272
setup.emit("location.shutdown")
12731273
release.resolve()
12741274
await load
1275+
expect(setup.data.location.mcp.resource.list()).toBeUndefined()
12751276
for (const type of mcpEvents) setup.emit(type)
12761277
await setup.flush()
12771278
expect(setup.requests.toSorted()).toEqual(["/api/mcp/resource:/project", "/api/mcp:/project"])
1279+
await setup.data.location.mcp.resource.sync()
1280+
expect(setup.data.location.mcp.resource.list()).toEqual([])
12781281
} finally {
12791282
release.resolve()
12801283
await load

0 commit comments

Comments
 (0)