Repository navigation
doc: clarify Web Storage behavior #53871
Description
Activity
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on Jul 16, 2024 Hello sir, can you assign this Issue to me. I want to start my contribution journey and I think I can handle this issue
We don't typically assign issues. If you want to work on this, just open a PR 😄
PR submitted.
Hi Colin, a quick question here, I am trying to figure out where the 10MB quota comes from in node (if you don't mind pointing out for me).
Deno has its own implementation of
webstorageapi and the 10mb comes fromconst MAX_STORAGE_BYTES: usize = 10 * 1024 * 1024;indenoland/deno/ext/webstorage/lib.rshere, in nodejs the closest thing I could find itsSQLITE_CONSTRAINTis19which means/* Abort due to constraint violation */, maybe I missed something.Sure. It comes from here.
Reacted by jakecastelliOhh I see, thanks! A follow up question, should there be a test case for it?
Thanks for giving more context on the WPT tests!
I think I should've asked a bit more specific, should there be a test for testing 10mb quota in node? Given the fact it is up to individual implementors. Hope my question is not disturbing though 🙏
I guess it wouldn't hurt. I would recommend not doing repeated writes like the WPT tests though. That approach works because they don't know what the upper bound will be. Since we know Node's upper limit, we can do it in just a few writes.
Reacted by jakecastelli- added a commit that references this issue
on Aug 2, 2024 - added a commit that references this issue
on Aug 14, 2024 Closed by #53881
Affected URL(s)
https://nodejs.org/api/globals.html, https://nodejs.org/api/cli.html
Description of the problem
I think that we should clarify some behaviors of Web Storage in Node.js vs. browsers.
--localstorage-fileas its origin.Other things that would be good to note:
For reference, here are the Deno docs on Web Storage.