<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>250470</bug_id>
          
          <creation_ts>2023-01-11 11:51:46 -0800</creation_ts>
          <short_desc>Restore/recreate corrupted SQLite file of local storage</short_desc>
          <delta_ts>2023-01-30 11:13:10 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Przemyslaw Gorszkowski">pgorszkowski</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>sihui_liu</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1924855</commentid>
    <comment_count>0</comment_count>
    <who name="Przemyslaw Gorszkowski">pgorszkowski</who>
    <bug_when>2023-01-11 11:51:46 -0800</bug_when>
    <thetext>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 &quot;vi&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925264</commentid>
    <comment_count>1</comment_count>
    <who name="Przemyslaw Gorszkowski">pgorszkowski</who>
    <bug_when>2023-01-13 00:33:29 -0800</bug_when>
    <thetext>I am working on fix base on change from WPE 2.28: https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/c3dbb59a9972d31a8bef31090d74b8de2715966a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925960</commentid>
    <comment_count>2</comment_count>
    <who name="Przemyslaw Gorszkowski">pgorszkowski</who>
    <bug_when>2023-01-17 02:19:12 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/8716</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926345</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-18 11:52:19 -0800</bug_when>
    <thetext>&lt;rdar://problem/104390130&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1926865</commentid>
    <comment_count>4</comment_count>
    <who name="Przemyslaw Gorszkowski">pgorszkowski</who>
    <bug_when>2023-01-20 04:33:23 -0800</bug_when>
    <thetext>The bug report about creating the test for Cocoa: https://bugs.webkit.org/show_bug.cgi?id=250892</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1929474</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-30 11:13:07 -0800</bug_when>
    <thetext>Committed 259573@main (d5346d022b5c): &lt;https://commits.webkit.org/259573@main&gt;

Reviewed commits have been landed. Closing PR #8716 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>