Uploaded image for project: 'Apache Ripple'
  1. Apache Ripple
  2. RIPPLE-94

Some errors in emulation of Contacts and Console APIs



    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None


      The Cordova Mobile Spec test app provides a framework for running tests against plugins. At Intel we ran this framework against the emulator and discovered several defects in the Ripple emulation for various APIs.

      This JIRA reports two specific errors in the emulation of the Contacts plugin. I have not supplied a specific test case; to see the issue you really have to run the Mobile spec test.

      1) Deleting an email from a contact
      A contact is associated with an array of email addresses. If you assign one of these email addresses to a null string, then saving the contact should reduce the size of the array. Ripple wasn't doing this.
      2) Wrong error "code" when deleting a non-existent contact
      When you attempt to delete a non-existent contact, Ripple was invoking the "error" callback passed to exec as follows:

      error({code: 3, message: "could not find contact with id (" + id + ")"}); // PENDING_OPERATION_ERROR

      This is wrong for two reasons. First, the caller (the JavaScript layer) has passed in an error callback that expects to receive just the integer error code, not this object. Second, the correct error code is not 3 (PENDING_OPERATION_ERROR) but 0 (UNKNOWN_ERROR), at least according to the test in the plugin.

      In addition, there is a problem with the emulation of the Console native service. Here again there are two errors. One is that the Console plugin invokes a native service named "Console", not "Debug Console". So there's a missing entry in the Emulator array in bridge.js. Second, the object invoked from exec needs a function called logLevel.

      The Mobile Spec test invokes console.logLevel in the deviceready event handler, so you always get that annoying "missing API" dialog.




            jchorn Julian Horn
            jchorn Julian Horn
            0 Vote for this issue
            1 Start watching this issue