404s on ACLs throw an error
Vinnl opened this issue · comments
Search terms you've used
ACL, 404, rejects Promise, throws error.
Describe the bug
When I call fetchLitDatasetWithAcl
and the request to fetch an ACL file results in a 404 (which is an expected situation, e.g. when the user does not have Control access), then instead of the acl being null
, it appears that it throws an error/rejects the Promise.
To Reproduce
Steps to reproduce the behavior:
const resource = await unstable_fetchLitDatasetWithAcl('https://dayton.dev.inrupt.net/public/');
const acl = unstable_getAgentAccessModesAll(resource);
This supposedly throws.
Expected behavior
For resource
to just be the Resource with acl: { resourceAcl: null; fallbackAcl: null }
.
Log output
Additional context
Reproduced from this report: https://github.com/inrupt/pod-manager/pull/20#issuecomment-645535608
With a bit more experience and looking at Dayton’s original report, the error seems to be that his Pod on dev.inrupt.net did not have a root ACL, even though the spec says that it can not be deleted, so this might have been an issue with that dev version of NSS.
I ruled out that he did not have Control access, because otherwise no Link header should be present to discover the URL of that ACL in the first place. I also ruled out that the ACL just did not exist, as the report in the screenshot shows a request to https://dayton.dev.inrupt.net/.acl, which thus should exist and not result in a 404.
This is therefore probably not an issue in solid-client and should be safe to close.