Bug 187631

Summary: IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: New BugsAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, alecflett, beidson, cdumez, commit-queue, ddkilzer, ews-watchlist, jsbell, realdawei, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Sihui Liu 2018-07-12 17:40:27 PDT
If we currently have 2 IDB databases:
IDB1: top level frame origin A with subframe origin A
IDB2: top level frame origin B with subframe origin A
IDB2 won't be deleted if user asks to delete all IDB databases for origin A. This is because we are managing IDB database deletion by their mainframe origin.
Comment 1 Radar WebKit Bug Importer 2018-07-13 06:46:24 PDT
<rdar://problem/42164227>
Comment 2 Sihui Liu 2018-07-13 16:58:39 PDT
Created attachment 345004 [details]
Patch
Comment 3 Brady Eidson 2018-07-16 10:40:44 PDT
Comment on attachment 345004 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345004&action=review

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:-136
> -    auto pid = [webView _webProcessIdentifier];
> -    if (pid)
> -        kill(pid, SIGKILL);

This seems unrelated. You mentioned you think it's the cause of some flakiness and there's a bug for it. We should implement it over in that bug.

It seems weird that we thought we needed to reset all processes but this change would stop doing that.
Comment 4 Sihui Liu 2018-07-16 10:56:34 PDT
Created attachment 345101 [details]
Patch for landing
Comment 5 WebKit Commit Bot 2018-07-16 11:35:56 PDT
Comment on attachment 345101 [details]
Patch for landing

Clearing flags on attachment: 345101

Committed r233853: <https://trac.webkit.org/changeset/233853>
Comment 6 WebKit Commit Bot 2018-07-16 11:35:58 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Dawei Fenton (:realdawei) 2018-07-17 10:17:50 PDT
Jut  that after this patch (In reply to WebKit Commit Bot from comment #5)
> Comment on attachment 345101 [details]
> Patch for landing
> 
> Clearing flags on attachment: 345101
> 
> Committed r233853: <https://trac.webkit.org/changeset/233853>

Just want to note that after this patch we are getting a different failures at a different line number.  Not sure if this patch is dependent on 

https://bugs.webkit.org/show_bug.cgi?id=187066#c6 for a complete fix?


TestWebKitAPI.WebKit.WebsiteDataStoreCustomPaths
        
        /Volumes/Data/slave/highsierra-release/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:220
        Value of: [[NSFileManager defaultManager] fileExistsAtPath:fileIDBPath.get().path]
          Actual: true
        Expected: false
Comment 8 Sihui Liu 2018-07-18 09:36:53 PDT
(In reply to David Fenton (:realdawei) from comment #7)
> Jut  that after this patch (In reply to WebKit Commit Bot from comment #5)
> > Comment on attachment 345101 [details]
> > Patch for landing
> > 
> > Clearing flags on attachment: 345101
> > 
> > Committed r233853: <https://trac.webkit.org/changeset/233853>
> 
> Just want to note that after this patch we are getting a different failures
> at a different line number.  Not sure if this patch is dependent on 
> 
> https://bugs.webkit.org/show_bug.cgi?id=187066#c6 for a complete fix?
> 
> 
> TestWebKitAPI.WebKit.WebsiteDataStoreCustomPaths
>         
>        
> /Volumes/Data/slave/highsierra-release/build/Tools/TestWebKitAPI/Tests/
> WebKitCocoa/WebsiteDataStoreCustomPaths.mm:220
>         Value of: [[NSFileManager defaultManager]
> fileExistsAtPath:fileIDBPath.get().path]
>           Actual: true
>         Expected: false

Yes. With 187066's patch, the test should pass.
Comment 9 Dawei Fenton (:realdawei) 2018-07-18 10:22:08 PDT
(In reply to Sihui Liu from comment #8)
> (In reply to David Fenton (:realdawei) from comment #7)
> > Jut  that after this patch (In reply to WebKit Commit Bot from comment #5)
> > > Comment on attachment 345101 [details]
> > > Patch for landing
> > > 
> > > Clearing flags on attachment: 345101
> > > 
> > > Committed r233853: <https://trac.webkit.org/changeset/233853>
> > 
> > Just want to note that after this patch we are getting a different failures
> > at a different line number.  Not sure if this patch is dependent on 
> > 
> > https://bugs.webkit.org/show_bug.cgi?id=187066#c6 for a complete fix?
> > 
> > 
> > TestWebKitAPI.WebKit.WebsiteDataStoreCustomPaths
> >         
> >        
> > /Volumes/Data/slave/highsierra-release/build/Tools/TestWebKitAPI/Tests/
> > WebKitCocoa/WebsiteDataStoreCustomPaths.mm:220
> >         Value of: [[NSFileManager defaultManager]
> > fileExistsAtPath:fileIDBPath.get().path]
> >           Actual: true
> >         Expected: false
> 
> Yes. With 187066's patch, the test should pass.

Super! thanks.