Bug 174621 - [WinCairo] IndexedDB: fails to open database after restart
Summary: [WinCairo] IndexedDB: fails to open database after restart
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Windows 10
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-18 03:10 PDT by isaac+webkit
Modified: 2022-02-01 11:34 PST (History)
3 users (show)

See Also:


Attachments
example html file which reproduces (requires dexie.js to be alongside) (1.08 KB, text/html)
2017-07-18 03:10 PDT, isaac+webkit
no flags Details
The Dexie.js dependency on the example (194.51 KB, application/x-javascript)
2017-07-18 03:10 PDT, isaac+webkit
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description isaac+webkit 2017-07-18 03:10:06 PDT
Created attachment 315783 [details]
example html file which reproduces (requires dexie.js to be alongside)

Description

After restarting MiniBrowser it can no longer open IndexedDB databases created in the previous invocation

Steps To Repeat

1. Start minibrowser
2. Open example.html
3. Click Ok on Nicolas' shoe size.
4. Close minibrowser
5. Open minibrowser
6. Open example.html

Expected Behavior

See Nicolas' shoe size

Actual Behavior

Displays an alert with:
---------------------------
JavaScript Alert
---------------------------
Ooops: OpenFailedError: UnknownError An unknown error occurred within Indexed Database.
---------------------------
OK   
---------------------------
Comment 1 isaac+webkit 2017-07-18 03:10:44 PDT
Created attachment 315784 [details]
The Dexie.js dependency on the example

Required to use example.html
Comment 2 isaac+webkit 2017-07-18 03:18:23 PDT
Stepping through the debugger, using my application code (which is similar to the example above, except that the datastore is called 'events' and the keypath is 'eventid'. 

It looks like it fails in WebCore\Modules\indexeddb\server\IDSerialization.cpp line 72, in deserializeIDBKeyPath.

This is because decoder->decodeEnum("type") returns false.

Investigating even further I stepped through the KeyedDecoder::decoder constructor and it failed to correctly parse the provided data as a binary plist.

However copying the data from the debugger and providing it to plutil, verified that the plist was valid.

For reference the hex (from the debugger) is the following:  

62 70 6c 69 73 74 30 30 d2 01 02 03 04 54 74 79 70 65 56 73 74 72 69 6e 67 10 01 57 65 76 65 6e 74 49 64 08 0d 12 19 1b 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 23

After using a hex editor to place that in a file, then using plutil -lint it returns:
keypath.plist: OK

And using plutil -p returns:
{
  "type" => 1
  "string" => "eventId"
}
Comment 3 Brady Eidson 2017-07-18 12:01:18 PDT
Nobody has made an effort to confirm the serialization and deserialization work on Windows.

They work fine on Mac, iOS, and Linux.