Bug 250470 - Restore/recreate corrupted SQLite file of local storage
Summary: Restore/recreate corrupted SQLite file of local storage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-11 11:51 PST by Przemyslaw Gorszkowski
Modified: 2023-01-30 11:13 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Przemyslaw Gorszkowski 2023-01-11 11:51:46 PST
The problematic scenario:
1. Open any site with local storage (e.g.: http://www.sharonminsuk.com/code/storage-test.html)
2. Save some local storage value
3. Corrupt a SQLite file of the local storage for this site: (just find http_www.sharonminsuk.com_0.localstorage file and change it via "vi" tool)
4. Close browser
5. Open  site with local storage (e.g.: http://www.sharonminsuk.com/code/storage-test.html) again
6. The local storage value from the previous session is not available
7. Save some new local storage value
8. Close browser
9. Open  site with local storage (e.g.: http://www.sharonminsuk.com/code/storage-test.html) again
10. The local storage value from the previous session is not available
11. Close browser
12. Open  site with local storage (e.g.: http://www.sharonminsuk.com/code/storage-test.html) again
13. The local storage value from the previous session is available

As we can see we need two restarts of browser to fix saving of the local storage values.

There is a fix from wpe in version 2.28(https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/c3dbb59a9972d31a8bef31090d74b8de2715966a) which can be adopted to new local storage implementation and fix the existing problem.
Comment 1 Przemyslaw Gorszkowski 2023-01-13 00:33:29 PST
I am working on fix base on change from WPE 2.28: https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/c3dbb59a9972d31a8bef31090d74b8de2715966a
Comment 2 Przemyslaw Gorszkowski 2023-01-17 02:19:12 PST
Pull request: https://github.com/WebKit/WebKit/pull/8716
Comment 3 Radar WebKit Bug Importer 2023-01-18 11:52:19 PST
<rdar://problem/104390130>
Comment 4 Przemyslaw Gorszkowski 2023-01-20 04:33:23 PST
The bug report about creating the test for Cocoa: https://bugs.webkit.org/show_bug.cgi?id=250892
Comment 5 EWS 2023-01-30 11:13:07 PST
Committed 259573@main (d5346d022b5c): <https://commits.webkit.org/259573@main>

Reviewed commits have been landed. Closing PR #8716 and removing active labels.