Content

Bug #615

Transaction Error: SecurityError: DOM Exception 18 when trying to store

Added by Boyan Bratoev about 5 years ago. Updated over 4 years ago.

Status:Closed Start date:09/17/2014
Priority:Normal Due date:
Assignee:- % Done:

100% Total progress

Category:-
Target version:Olla

Description

Trying to run Apollo Enyo 1 app. It uses Mojo.Depot wrapper.
Turned on debugging on the app and the console throws:Transaction Error: SecurityError: DOM Exception 18.
The only other interesting log is in messages:
2014-09-17T02:59:10.571703Z [29039] user.warning configurator [] Configurator CONFIGURATOR_WARNING {"directory":"/media/cryptofs/apps/usr/palm/applications/com.jmtk.apollo/configuration/db/kinds","parent":""} Failed to open directory: /media/cryptofs/apps/usr/palm/applications/com.jmtk.apollo/configuration/db/kinds, under

messages (18.4 kB) Boyan Bratoev, 09/17/2014 03:28 AM


Issue Hierarchy ()

History

Updated by Boyan Bratoev about 5 years ago

Traced the code a bit more:
Error: SecurityError: DOM Exception 18
code: 18
constructor: DOMExceptionConstructor
line: 394
message: "SecurityError: DOM Exception 18"
name: "SecurityError"
sourceURL: "file:///media/cryptofs/apps/usr/palm/applications/com.jmtk.apollo/lib/depot.js"
stack: "[email protected][native code][email protected]:///media/cryptofs/apps/usr/palm/applications/com.jmtk.apollo/lib/depot.js:394:[email protected]:///media/cryptofs/apps/usr/palm/applications/com.jmtk.apollo/lib/prototype.js:101:28?eval [email protected][native code]?_evaluateOn?_evaluateAndWrap?evaluate"

Seems like the error is coming from a native method openDatabase, which I assume is locate @ /usr/sbin/mojodb-luna

Updated by Boyan Bratoev about 5 years ago

  • Target version set to Affogato

Did a simple test with this code in the javascript console:
var db = window.openDatabase(
'MyDB', // dbName
'1.0', // version
'test database', // description
2 * 1024 * 1024, // estimatedSize in bytes
function(db) {} // optional creationCallback
);
Error: SecurityError: DOM Exception 18
code: 18
constructor: DOMExceptionConstructor
line: 1
message: "SecurityError: DOM Exception 18"
name: "SecurityError"
stack: "[email protected][native code]?eval [email protected][native code]?_evaluateOn?_evaluateAndWrap?evaluate"
proto: DOMExceptionPrototype

Updated by Simon Busch about 5 years ago

  • Target version deleted (Affogato)

Updated by Achim Königs about 5 years ago

There is a thread for this on webos nation (see http://forums.webosnation.com/luneos/328514-legacy-new-apps-issues.html#post3425201 ), which currently shows two possible solutions:
1. set a default quota for web sql database
2. react to https://qt-project.org/doc/qt-5/qwebpage.html#databaseQuotaExceeded QT signal and ask user if quota should be increased.

Nicest thing might be to do both in the long run? ;) Question for both solutions would be if quota applies to just one app or to all web apps?

Updated by Simon Busch about 5 years ago

Instead of getting a signal QtWebkit will try to create a dialog in our case. We can workaround this by reacting on Component.onCompleted of the created Item and pass the new quota to webkit.

The following code needs to be applied to luna-webappmanager and made a bit more dynamic to fit the needs of the app and the space we have available.

diff --git a/src/qml/ApplicationContainer.qml b/src/qml/ApplicationContainer.qml
index b8cefa3..5c1fac6 100644
--- a/src/qml/ApplicationContainer.qml
+++ b/src/qml/ApplicationContainer.qml
@@ -120,6 +120,23 @@ Flickable {
         experimental.preferences.serifFontFamily: "Times New Roman" 
         experimental.preferences.cursiveFontFamily: "Prelude" 

+        experimental.databaseQuotaDialog: Item {
+            Component.onCompleted: {
+                console.log("Database quota extension request:");
+                console.log(" databaseName: " + model.databaseName);
+                console.log(" displayName: " + model.displayName);
+                console.log(" currentQuota: " + model.currentQuota);
+                console.log(" currentOriginUsage: " + model.currentOriginUsage);
+                console.log(" expectedUsage: " + model.expectedUsage);
+                console.log(" securityOrigin:");
+                console.log("   scheme: " + model.securityOrigin.scheme);
+                console.log("   host: " + model.securityOrigin.host);
+                console.log("   port: " + model.securityOrigin.port);
+
+                var quota = 1000; /* in bytes */
+                model.accepeted(quota);
+            }
+        }
+
         function getUserAgentForApp(url) {
             /* if the app wants a specific user agent assign it instead of the default one */
             if (webApp.userAgent.length > 0)

Updated by Simon Busch about 5 years ago

  • Target version set to Black Tie

Updated by Simon Busch about 5 years ago

  • Target version changed from Black Tie to Breve

Updated by Simon Busch about 5 years ago

  • Target version changed from Breve to Later

Updated by Herman van Hazendonk over 4 years ago

  • Target version changed from Later to Olla
  • % Done changed from 0 to 100
  • Status changed from New to Feedback

This should be resolved for quite some time already, will check tonight.

Updated by Herman van Hazendonk over 4 years ago

  • Status changed from Feedback to Closed

Sorted :)

Also available in: Atom PDF