Bug 229811

Summary: Implement Storage API
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dvpdiner2, nbrustein, sihui_liu, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 229925, 229965, 230053, 230059, 230675, 248918    
Bug Blocks:    

Description Sihui Liu 2021-09-02 09:30:03 PDT
Spec: https://storage.spec.whatwg.org
Comment 1 Radar WebKit Bug Importer 2021-09-02 09:30:40 PDT
<rdar://problem/82678873>
Comment 2 Sam Sneddon [:gsnedders] 2022-10-28 05:00:44 PDT
AFAICT, the only thing left to do here is https://github.com/WebKit/WebKit/blob/a121340322ef72e3e303af58db1c88cb23bf397d/Source/WebCore/Modules/storage/StorageManager.idl#L36 :

// FIXME: add Promise<StorageEstimate> estimate();

That said, we don't appear to have any open bug for that?
Comment 3 Nate Brustein 2023-03-20 07:27:16 PDT
I'm not seeing StorageManager.persist() and persisted() work in the way I expect.

Here is what I'm seeing in Safari:

 * storage.persist() will resolve to true
 * In the same session, storage.persisted() will resolve to true
 * After refreshing the page storage.persisted() will resolve to false

I would expect that if storage.persisted() resolved to true in one session, it would still be true in a subsequent session. That's what I'm seeing in Chrome and FF.

Am I misunderstanding the behavior here, or is this unexpected?
Comment 4 Sihui Liu 2023-05-10 14:54:01 PDT
(In reply to Nate Brustein from comment #3)
> I'm not seeing StorageManager.persist() and persisted() work in the way I
> expect.
> 
> Here is what I'm seeing in Safari:
> 
>  * storage.persist() will resolve to true
>  * In the same session, storage.persisted() will resolve to true
>  * After refreshing the page storage.persisted() will resolve to false
> 
> I would expect that if storage.persisted() resolved to true in one session,
> it would still be true in a subsequent session. That's what I'm seeing in
> Chrome and FF.
> 
> Am I misunderstanding the behavior here, or is this unexpected?

Hi, the persisted flag was not persisted (as WebKit didn't evict data on storage pressure), and this particular issue is fixed at https://bugs.webkit.org/show_bug.cgi?id=256483.