Bug 238169

Summary: Add logging for LocalStorage and IndexedDB data migration
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: Website StorageAssignee: Sihui Liu <sihui_liu>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, ggaren, sihui_liu, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch for landing none

Description Sihui Liu 2022-03-21 16:58:57 PDT
...
Comment 1 Sihui Liu 2022-03-21 17:01:12 PDT
Created attachment 455303 [details]
Patch
Comment 2 Chris Dumez 2022-03-23 14:38:36 PDT
Comment on attachment 455303 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        Add loggings for LocalStorage and IndexedDB data migration

loggings -> logging

> Source/WebCore/platform/sql/SQLiteFileSystem.cpp:98
> +        allMoved |= FileSystem::moveFile(makeString(oldFilePath, suffix), makeString(newFilePath, suffix));

This doesn't look right to me?

Shouldn't allMoved be initialized to false and the operator be &| here?

As it stands, I think this function will always return true.
Comment 3 Sihui Liu 2022-03-23 14:57:39 PDT
Created attachment 455563 [details]
Patch
Comment 4 Sihui Liu 2022-03-23 14:58:09 PDT
Comment on attachment 455303 [details]
Patch

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

>> Source/WebCore/platform/sql/SQLiteFileSystem.cpp:98
>> +        allMoved |= FileSystem::moveFile(makeString(oldFilePath, suffix), makeString(newFilePath, suffix));
> 
> This doesn't look right to me?
> 
> Shouldn't allMoved be initialized to false and the operator be &| here?
> 
> As it stands, I think this function will always return true.

Yes, it should be &! Updated.
Comment 5 Chris Dumez 2022-03-23 15:34:21 PDT
Comment on attachment 455563 [details]
Patch

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

r=me

> Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp:358
> +            RELEASE_LOG(Storage, "%p - StorageBucket::resolvedLocalStoragePath New path '%s'", this, localStoragePath.utf8().data());

%{public}s if you want to see the path in public builds.

Given that the paths do not contain any origin information, I think it's OK.

> Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp:389
> +        RELEASE_LOG(Storage, "%p - StorageBucket::resolvedIDBStoragePath New path '%s'", this, idbStoragePath.utf8().data());

%{public}s
Comment 6 Sihui Liu 2022-03-23 21:42:16 PDT
Created attachment 455603 [details]
Patch for landing
Comment 7 EWS 2022-03-23 23:26:32 PDT
Committed r291786 (248814@main): <https://commits.webkit.org/248814@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455603 [details].
Comment 8 Radar WebKit Bug Importer 2022-03-24 00:58:28 PDT
<rdar://problem/90752697>