W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

[Bug 16441] New: Spec should note that onsuccess shouldn’t be used for writes.

From: <bugzilla@jessica.w3.org>
Date: Mon, 19 Mar 2012 20:12:35 +0000
To: public-webapps@w3.org
Message-ID: <bug-16441-2927@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16441

           Summary: Spec should note that onsuccess shouldn’t be used for
                    writes.
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Indexed Database API
        AssignedTo: dave.null@w3.org
        ReportedBy: yonathan@gmail.com
         QAContact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org


You generally should listen to the transaction’s “complete” event instead of
the put/add request’s “success” event, because the transaction may fail after
“success.” There’s at least one example of someone being confused by the
wording[1]. Perhaps the spec should point out that you usually want to listen
to “complete” for write requests.

Use of a write request’s “success”/“error” events is probably reserved for
advanced use cases (e.g. to commit part of a transaction even when the later
requests fail, or to retry a write that failed, or to measure progress when a
transaction has multiple parts).

 [1]: https://developer.mozilla.org/en/IndexedDB/Using_IndexedDB

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Monday, 19 March 2012 20:12:41 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:50 GMT