Repository navigation
Conversation
No authentication and caching yet
Based on discussion in #37 and implementation in nodeSolidServer/node-solid-server#1060
|
A problem with this implementation is that it returns quite a lot of 404-statuses, to which there are two problems:
Any thoughts on this? My thinking was that it's ok to return 404, since the result for the consuming client code is that it's just ignored. But it might be annoying for developers checking console for various reasons to see a 404 being returned (especially annoying if they're trying to debug and is side-railed). |
Oh, yeah, that is by design and documented as the way to disable the quota system. So, basically, parsing the file takes around ~200 ms, and then computing the size of the file system takes ~100 ms, so the idea was that you can avoid this cost by not having the But then, I might not quite understand what will return a 404, is it just the |
As the code is written now, there are various things that could go wrong:
The missing triples might be a stretch to return 404s, but my thinking was that there is some data missing, hence we don't have an account resource to return. But thinking more of it, we could also return 200 and a graph that doesn't have those triples (i.e. an empty graph for now). We could apply the same strategy when we cannot dereference the various graphs (WebID, serverSide.ttl). |
OK, I just needed to clear out a little misunderstanding on my part, I thought you were talking about the resource the user was requesting when they got an over-quota error, not the
👍
👍
👍
Right. Indeed an error. Actually, I wonder if that should result in a
👍 It does indeed make sense for a 404 for that resource.
👍
👍
Yeah, I think it makes sense, except for the server side error for
|
|
I'm just wondering what happens if the quota system is disabled, will the user also get a 404 on |
If the quota system is disabled, i.e. serverSide.ttl does not have a triple with Are there other indicators that a quota-system is not in use? |
|
I'm unsure of the caching-thing myself, as @rubensworks mentions. It could be an annoyance for people uploading a lot of files in a short timespan, and not see the updated info. Right now I've cached the data for one hour, but we could make it less, like a minute. But then there might not be the big need for this cache anyway. Another way of doing this could be to have the cache as a service that size-altering commands (ie POST, PUT, PATCH, DELETE) could call whenever something is changed on the server; it could simply remove the cached value for the userId, which would regenerate the info on next call. I'm worried that this is a bit overcomplicating it though =/ |
If we're not sure about the performance impact, I would just remove the cache, and look for solutions if we experience a performance issue. |
I agree wholeheartedly to this; I'll remove the caching mechanism for now. |
I agree it is very strange, but as the wording is SHOULD, we have to expect cases where people have removed One of the problems is also whether or not we should return a 200 or 404 (or maybe 500 in some cases). The problem is that we have no way of knowing whether the server enforces a quota-system, expect to infer whether serverSide.ttl and Maybe we should have it in config.json whether or not POD providers want to enforce a quota-system? |
| return resource.endsWith(this.suffix) | ||
| } | ||
|
|
||
| static createFromLDPAndRequest (resource, ldp, req) { |
There was a problem hiding this comment.
This could be moved as a method to ldp.js instead, something like createACL(resource, req) if that's a better abstraction? @kjetilk @rubensworks
There was a problem hiding this comment.
I think it's fine to keep it here, but not strong opinion.
Right, but in that case, we either have to require
Yeah, we could... I just didn't want to spend so much time on this stop-gap measure, but I suppose we might have to. Regarding caching, Tim was (rightly) worried about the write performance, and caching in RAM should help, but indeed, just a max-age wouldn't do the trick, the cache would need to be invalidated on write. More work, and it isn't strictly necessary for small Pods, so I can live with not having it in. |
Adding an option to the init-script is an easy and quick thing to do. Not necessarily smart though, so am open to being convinced to not do it. I'll add it as another branch though, so that we can discuss it separately from this issue. (Just to add what I'm thinking of doing: I'll add an option called "enforceQuota" or something, that is only prompted if the user is setting up a multiuser-server, and set it to false by default. I guess we should expand upon it as well, i.e. copy serverSide.ttl as serverSide.ttl.inactive or serverSide.ttl. I should have something in place by the end of day latest.) |
|
I'll close this until we have enforceQuota in place. I'll reopen the PR then. |
This is a fix for #918
I have not written tests for this, but plan to do that ASAP. But would be nice to have some eyes on the code in case I've missed something.