solid-client-js icon indicating copy to clipboard operation
solid-client-js copied to clipboard

getResourceInfoWithAccessDatasets fails to return ACP data

Open pduchesne opened this issue 10 months ago • 1 comments

Search terms you've used

getResourceInfoWithAccessDatasets

Bug description

The getResourceInfoWithAccessDatasets method in acp.ts does not return the access datasets as expected. More specifically, when the resource is ACP-controlled and the policy URL is set in internal_resourceInfo.aclUrl (as is the case with f.i. the Inrupt PodSpaces) In that case, the internal_fetchAcl method internally receives a AclIsAcrError, and results in null ACLs https://github.com/inrupt/solid-client-js/blob/9cbd59aaa7f2f820de003bb89f45507bd5241804/src/acl/acl.internal.ts#L93-L96 However, getResourceInfoWithAccessDatasets ignores the empty ACLs or the AclIsAcrError and returns thinking it is indeed an ACL (L206), and never reaches the fetchAcr call as it should in that case. https://github.com/inrupt/solid-client-js/blob/9cbd59aaa7f2f820de003bb89f45507bd5241804/src/acp/acp.ts#L204-L209

Expected result

Get the ACR datasets as expected when the ACP policy URL is set in internal_resourceInfo.aclUrl

Actual result

pduchesne avatar Apr 05 '24 20:04 pduchesne