Repository navigation
Conversation
| return this.store.fetcher.load(doc) | ||
| // force = true to reload the doc | ||
| // but first remove doc: this is to avoid just adding quads | ||
| if (options && options.force) this.store.removeDocument(doc as NamedNode) |
There was a problem hiding this comment.
I'm quite new to Typescript so may have misunderstood but if someone passed a NamedNode array or a string to load() will it work to pass that to removeDocument as a NamedNode?
There was a problem hiding this comment.
Yes it will work if you don't use force = true. If you use force = true doc must be a Named node.
I took this solution because it was used elsewhere in the code, it was simple, it was compatible with the used cases and offer a plus possibility to load(). In an other way there is no regression
If you don't use force = true then load can receive NamedNode, NamedNode Array or String like before.
There was a problem hiding this comment.
@edwardsph I made the changes. I don't know anything in typescript. My initial idea was wrong. Load now can pass a NamedNode, NamedNode Array or a string to load() and pass that to removeDocument() as namedNode.
Tested locally with all 3 types.
|
"his.store.fetcher.load(doc) with no options reuse the existing document in store. |
|
If you want to reload something already loaded you have There is also fetcher.unload. Do not use store.removeDocument as it will leave the cache metadata wrong. |
|
@timbl Thanks.
The proposed patch do not change the actual use of x.load() in solid-ui Shall there be possibility to
|
|
Finally modified only getContainerMembers(). Recursive delete must be sure to act on the latest situation and not from a cache that may not be up to date. |
|
@bourgeoa is this still accurate? Shall we merge it? |
|
For me it was good to merge. |
|
Because this PR was hard to merge due to the refactoring of code, I created a new PR with just the prominent changes of this PR: https://github.com/solid/solid-logic/tree/loadImprovement @bourgeoa please check it and close and merge these PRs if ok. |
this.store.fetcher.load(doc) with no options reuse the existing document in store.
This is not what we expect. We want load a new document.
options.force = true reload the document but adds new triples
we neee to remove the document from store in that case
force = true is used in aclDocUrl() and getContainerMembers().
@michielbdejong Should it be a default for load() ?
solid spec implies that delete is atomic (delete ressource and auxiliary one in the same operation)
I remove the acl delete in recursiveDelete()