Skip to content

Commit 13bb9d7

Browse files
author
Daniel Beeke
committed
fixing a strange race condition which ended up in having some blank nodes duplicated but not correctly as they would have different identities
1 parent 4956f6f commit 13bb9d7

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shapething/localstore",
3-
"version": "0.1.12",
3+
"version": "0.1.13",
44
"license": "MIT",
55
"exports": "./lib/LocalStore.ts"
66
}

lib/LocalStore.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ export class LocalStore implements Source, RdfJsStore {
240240

241241
// Clear the cache so fresh data wil be fetched.
242242
this.#cache.deleteGraph(graph)
243+
this.#inFlightCachePromises.delete(graph.value)
243244

244245
if (error) reject(error)
245246
resolve(undefined)
@@ -339,9 +340,6 @@ export class LocalStore implements Source, RdfJsStore {
339340
if (!this.#inFlightCachePromises.has(graph.value)) {
340341
const promise = this.#parseAndStoreGraph(graph, fileHandle)
341342
this.#inFlightCachePromises.set(graph.value, promise)
342-
promise.then(() => {
343-
this.#inFlightCachePromises.delete(graph.value)
344-
})
345343
}
346344

347345
return this.#inFlightCachePromises.get(graph.value)

0 commit comments

Comments
 (0)