Bug 22658 - db.transaction doesn't seem to execute properly
Summary: db.transaction doesn't seem to execute properly
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P1 Major
Assignee: Nobody
URL: http://webkit.org/misc/DatabaseExampl...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-04 13:24 PST by toxicstink
Modified: 2011-12-08 02:32 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 toxicstink 2008-12-04 13:24:47 PST
db.transaction seems to skip over its arguments & do nothing.

1. Load <http://webkit.org/misc/DatabaseExample.html>
2. Open the Inspector and switch to the Scripts panel.
3. In DatabaseExample.html place a breakpoint on line 232.
4. In WebKit click the 'New Note' button.
5. In Inspector step through the code & notice that db.transaction(...) is not properly executed.

The transaction should execute its arguments inserting a new note into the database, instead it doesn't execute the arguments & nothing is inserted into the database.  If an error callback is added to the transaction arguments (on a local copy) it doesn't get called either. ie:

        db.transaction(function (tx)
        {
            tx.executeSql("INSERT INTO WebKitStickyNotes (id, note, timestamp, left, top, zindex) VALUES (?, ?, ?, ?, ?, ?)", [note.id, note.text, note.timestamp, note.left, note.top, note.zIndex]);
        },
        function(tx, error) {
          reportError('sql', error.message);
        });
Comment 1 Brady Eidson 2008-12-04 14:12:14 PST
I think this is more a bug about javascript breakpoints with callbacks...  have you tried running Safari under the debugger and setting "real" breakpoints in the native WebCore code that is executed?
Comment 2 toxicstink 2008-12-04 15:29:43 PST
(In reply to comment #1)
> I think this is more a bug about javascript breakpoints with callbacks...  have
> you tried running Safari under the debugger and setting "real" breakpoints in
> the native WebCore code that is executed?
> 

No haven't tried - I'm not currently set up for that.  Either way it seems there's an issue with db.transaction working properly since new notes aren't inserted into the created database.
Comment 3 Brady Eidson 2008-12-04 15:35:25 PST
Right... except inserting new notes in the database works fine for me right now on ToT.

Comment 4 toxicstink 2008-12-04 18:10:41 PST
(In reply to comment #3)
> Right... except inserting new notes in the database works fine for me right now
> on ToT.
> 

It's working for me on Mac OS X builds including the latest but I'm seeing the issue on all Windows builds.  Just gave the latest build (r39005) a try but WebKit won't launch at all with this build, I get a dialog with this message:

Safari.exe - Entry Point Not Found
The procedure entry point CFURLCacheCopySharedURLCache could not be located in the dynamic link library CFNetwork.dll.

Are you on OS X or Windows?  I'm on XP specifically.
Comment 5 toxicstink 2008-12-08 16:14:04 PST
I downloaded r39088 from today and tried the test site:

http://webkit.org/misc/DatabaseExample.html

Still doesn’t work on Windows, still works on Mac (as expected).
Comment 6 toxicstink 2008-12-16 20:53:12 PST
 I downloaded r39293 today and tried the test site:
 
 http://webkit.org/misc/DatabaseExample.html
 
 Still doesn’t work on Windows, still works on Mac (as expected).
 

Comment 7 toxicstink 2009-01-27 10:57:01 PST
Should I expect that this bug will ever be verified?  I just checked Windows r40286 (doesn’t work) and Mac r40288 works.  It seems like a major problem as SQLite is unusable on Windows.
Comment 8 Dimitri Glazkov (Google) 2009-02-02 08:52:58 PST
Works like a charm for me on Windows Nightly r40471. Are you sure you're launching the nightly build?
Comment 9 toxicstink 2009-02-04 12:42:21 PST
Really?!  I just tried r40471 & same result - notes will not be saved to the database.  I'm definitely launching the nightly build.  So to be sure:

1) You're running this on Windows XP?
2) Created notes get saved to the database?

Thanks for taking a look.
Comment 10 Yonatan Schor 2011-12-08 02:32:58 PST
Ran into the same problem when switching from the Safari on iOS 4.* to the one on iOS 5 (AppleWebKit/534.46).
db.transaction simply didn't execute when invoked from certain DOM events.
worked around it by invoking it though JavaScript's setTimeout...