-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving text from HTML's web storage into the Storage Standard #95
Comments
I think this mostly follows from the requirements we already have around UI, storage pressure, and tying storage to specific objects, except for the script running thingie.
This doesn't list sufficient reasons, e.g., storage pressure, but fortunately the Storage Standard covers that already. Script running is important though. |
https://www.w3.org/Bugs/Public/show_bug.cgi?id=21319#c3 is linked in the source for the last paragraph, which makes me question how much buy-in it has. As part of Storage Standard discussions we have discussed origin vs site as well and my recollection is that in general we don't really want to put sites on a pedal and instead encourage mitigations that also work against a bad actor that has 10k to buy some registrable domains (or uses github.io or some such). I think the other requirements are already captured by the existing text. The one exception is the 5 MiB limit. We might well want to keep that for localStorage/sessionStorage, but the current infrastructure doesn't cleanly allow for it. #69 might help with this I suppose. |
Refactoring things out of the HTML monolith? 🎉
Yep... but those two sentences are somewhat in conflict, so probably deserve more nuance. If the user clears data, it should happen even if script is running. To do so properly may require stopping script from running, so it's not wrong, just complicated. Re: Compression - yeah, I think that ship has sailed. Chrome reports actual quota usage regardless of compression or overhead (e.g. write-ahead logs etc prior to compaction) Re: origin vs. site - there's also the challenges of preventing cross-origin information leakage which we probably need to document in Storage at some point. Re: 5 MiB limit - FWIW, I think Chrome is at 10MiB (@mkruisselbrink ?). Agreed that we should keep the limit for localStorage/sessionStorage. I think it would be fine for any storage endpoint to impose its own bottle size limit in addition to a bucket limit. |
And use this to port HTML's 5 MiB suggestion. See #95.
In general I find the text in HTML much clearer and more detailed than what is in Storage today. So let me try to raise some specific concerns in this issue, before we proceed with merging whatwg/html#5560.
I have bolded a sentence which I cannot find a counterpart in Storage (after #93).
I have bolded sentences for which I cannot find counterparts in Storage (after #93). It sounds like maybe you disagree with sentence 2, and I believe Chrome does too (our most-starred bug is about guarding against this "attack", and I think we've decided to not address it). So that one perhaps should be dropped. But the others seem valuable. |
|
And use this to port HTML's 5 MiB suggestion. See #95.
"legacy-clone a browsing session storage shed" can be used by HTML to define creation of auxiliary browsing contexts, as part of whatwg/html#5560. "obtain a storage key" can be used by APIs that share keying logic with storage, such as BroadcastChannel and shared workers. See whatwg/html#3054. It's potentially also useful for Indexed DB as discussed in w3c/IndexedDB#334. Also helps a bit with #95 by reorganizing and adding some more detail to how a user agent is supposed to manage storage. Closes #92.
I can't find anything in Storage that says user agents are allowed to clear session storage upon user request or for security reasons. I can only find storage pressure.
The sentence (2) talks about a limit on the total size consumed by all bottles. I cannot find a counterpart in Storage.
Are you referring to
If so, I'd like to get general confirmation that we want to remove this restriction. As I said above, it seems like Chrome does not intend to implement the restriction, and I guess maybe you're saying Firefox doesn't either? Additionally, if we're really moving to a world where "Unless anything suggests it's allowed, it's not", then it'd be good to ensure that nobody is doing this today, since such a mitigation would become disallowed.
This seems reasonable, but I'd like us to note it as a normative change, since we're disallowing user agents from doing something. We should also ensure that no user agents are currently doing it.
I'm hesitant to remove user-friendly normative text from the specification.
Should we add the opposite statement? This seems important for interoperability... otherwise the 5 MiB quota is pretty meaningless. |
1:
2:
I guess I could add implementation-defined to that: #108. 3: Firefox currently has this restriction, but we are thinking of removing it. As quotas are implementation-defined as per 2, I don't think we would be really disallowing anything. We're just not putting specific solutions in the specification that might not be ideal. 4: Does it matter if implementers agree it's a bad model? Exhaustively testing this across all APIs feels like a waste of time if we all want to move past it. 5: How is requiring particular UI user-friendly? I'm not sure we even know what the best UI would be here in our future partitioned world. 6: Unless we define the cost of each operation exactly we're not going to get interoperability, so I'd rather have it be somewhat vague as I'm not sure we want to commit on how to serialize code units and such. |
The text you quoted loses the mention of why user agents should offer this, namely upon user request or for security reasons.
Agreed, thanks for pointing that out
I think this comes to the crux of the disagreement here. I don't think of this as putting things in to the spec. I'm approaching this from the perspective of removing things from the spec. (At least, for whatwg/html#5560.) I'm not very comfortable removing things from the spec without some kind of confirmation, preferably multi-implementer.
Again, I'd love to see that implementer agreement expressed, if we're going to make normative removals. And I'd like to see tests, at least informal ones, for the specific API for which you're removing the spec text (localStorage/sessionStorage).
The text in question does not require a particular UI. It suggests (should) that a UI exist at all. Again, it's a removal of a normative should statement, and I'd like to see multi-implementer agreement before removing normative statements.
I still think adding the opposite statement would be better than leaving this ambiguous, especially if we're making a normative change in the spec. But I agree we're not going to get interop, so it's not a big deal. |
I think the problem is that you are putting a lot of weight on text that had no implementer commitments or tests to begin with. I agree we should have implementer agreement though, so maybe @inexorabletash can chime in. 1: I suppose we could allow removal for "security reasons", but it seems rather arbitrary. Do we actually have a concrete scenario where a user agent does this? 3: Consider Firefox confirmed. 4: Consider Firefox confirmed. We also only ever had it for IDB as far as I'm aware. I guess it should be fairly easy to write a demo for these APIs though so I'll give that a shot. Edit: https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8251 and https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8252. Interestingly enough Safari seems to have a much higher limit for sessionStorage and throws a RangeError when it's reached... Filed https://bugs.webkit.org/show_bug.cgi?id=214037 on that. Nobody shows UI though. 5: It does require a particular UI, it suggests that it should have storage size. The new text simply suggests you should be able to clear sites, not what you have to display about them. |
@pwnall @inexorabletash it would be nice to be able to move forward with this. Could you please share your thoughts? |
Sorry for the delay here! (FWIW, tracking multiple points across multiple replies has been difficult for me. Thank you @annevk for introducing a numbering scheme!)
I tried to separate clear Chrome position (Chrome / we) from the parts that may only represent personal opinion (I). Sorry for the shifts in voice resulting from this. Please don't hesitate to ask follow-up questions if my answers are not clear, or if I misunderstood the points being discussed here. |
Thanks, that helps a lot. I think for 4 browsers aren't really prevented from doing anything if it's not mentioned as browser UI isn't covered and it also seems somewhat weird to mention it given that nobody does anything currently nor is planning to. 5: Very good point, Firefox will most likely also move away from this and probably will also not meet "Instead user agents should offer users the ability to clear all storage for each group of schemelessly same site origins." from the current draft. Maybe we should make it "User agents should offer users the ability to clear storage for websites they visit and may indicate usage for each website." which is sufficiently vague that implementations can do whatever, but still gives some guarantees to users (and coupled with the bucket is the smallest unit requirement also some guarantees to developers). 6: I recall that we discussed this at TPAC and I'm similarly interested in tackling this medium/long term. But yeah, specification-wise that would also be a pretty significant undertaking. |
No, I think this covers it. Please re-ping me on anything needs approval; I've lost track. |
As some of the advice seems a bit dated, I'm opening this issue to track and discuss what kind of changes we might be making. The relevant PRs are whatwg/html#5560 and #93.
The text was updated successfully, but these errors were encountered: