Bug 238169 - Add logging for LocalStorage and IndexedDB data migration
Summary: Add logging for LocalStorage and IndexedDB data migration
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Website Storage (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-21 16:58 PDT by Sihui Liu
Modified: 2022-03-24 00:58 PDT (History)
4 users (show)

See Also:


Attachments
Patch (9.69 KB, patch)
2022-03-21 17:01 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch (9.71 KB, patch)
2022-03-23 14:57 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff
Patch for landing (9.79 KB, patch)
2022-03-23 21:42 PDT, Sihui Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>