Error when calling Communications.makeJsonRequest() for Epix in simuator

Environment:
- MacOS 10.12.2
- Eclipse Neon.2, plug-in 2.2.3
- SDK 2.2.3


Detailed description of the issue:

When using the simulator and trying to call the Communications.makeJsonRequest() method for the Epix device the simulator crashes with a "Symbol Not Found Error" as such:

Symbol Not Found Error
in makeJsonRequest (/private/var/jenkins/workspace/Tech-CIQ-Mac-Rel/mbsimulator/submodules/technology/monkeybrains/virtual-machine/api/Communications.mb:165)
in makeRequest (/Users/douglasr/develop/garmin/watchfaces/CrashTest/source/CrashTestView.mc:44)
in onUpdate (/Users/douglasr/develop/garmin/watchfaces/CrashTest/source/CrashTestView.mc:24)
Failed invoking <symbol>


A call to the Communications.makeImageRequest() works without issue.


Steps to reproduce the issue:

1. Create a new widget project.
2. Use the view code given below.
3. Run the project and the simulator will crash immediately.


Any applicable additional information:
This is was replicated using a new project with only the Epix device (SDK 1.2.x) chosen as supported but was originally encountered on a project supporting multiple devices.


A code sample that can reproduce the issue:

using Toybox.Application as App;
using Toybox.Communications as Comms;
using Toybox.WatchUi as Ui;

class CrashTestView extends Ui.View {

function initialize() {
View.initialize();
}

// Load your resources here
function onLayout(dc) {
setLayout(Rez.Layouts.MainLayout(dc));
}

// Called when this View is brought to the foreground. Restore
// the state of this View and prepare it to be shown. This includes
// loading resources into memory.
function onShow() {
}

// Update the view
function onUpdate(dc) {
makeRequest();
// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
}

// Called when this View is removed from the screen. Save the
// state of this View here. This includes freeing resources from
// memory.
function onHide() {
}

function makeRequest() {
var params = {
"test" => "xyz"
};
var options = {
"Content-Type" => Toybox.Communications.REQUEST_CONTENT_TYPE_JSON
};

try {
Comms.makeJsonRequest( "somesite.example.com", params, options, method(:updateData) );
}
catch (ex) {
}
}

function updateData(responseCode, json_data) {
}
}
  • Former Member
    Former Member
    I see the same error on
    -Windows 7
    -Eclipse Neon, plugin 2.2.3
    -SDK 2.2.3

    due to an internal call to makeWebRequest, which is not supported by IQ 1.2.

    it is working on a real Epix device?
    I own only a Fenix3


    Environment:
    - MacOS 10.12.2
    - Eclipse Neon.2, plug-in 2.2.3
    - SDK 2.2.3


    Detailed description of the issue:

    When using the simulator and trying to call the Communications.makeJsonRequest() method for the Epix device the simulator crashes with a "Symbol Not Found Error" as such:

    Symbol Not Found Error
    in makeJsonRequest (/private/var/jenkins/workspace/Tech-CIQ-Mac-Rel/mbsimulator/submodules/technology/monkeybrains/virtual-machine/api/Communications.mb:165)
    in makeRequest (/Users/douglasr/develop/garmin/watchfaces/CrashTest/source/CrashTestView.mc:44)
    in onUpdate (/Users/douglasr/develop/garmin/watchfaces/CrashTest/source/CrashTestView.mc:24)
    Failed invoking <symbol>


    A call to the Communications.makeImageRequest() works without issue.


    Steps to reproduce the issue:

    1. Create a new widget project.
    2. Use the view code given below.
    3. Run the project and the simulator will crash immediately.


    Any applicable additional information:
    This is was replicated using a new project with only the Epix device (SDK 1.2.x) chosen as supported but was originally encountered on a project supporting multiple devices.


    A code sample that can reproduce the issue:

    using Toybox.Application as App;
    using Toybox.Communications as Comms;
    using Toybox.WatchUi as Ui;

    class CrashTestView extends Ui.View {

    function initialize() {
    View.initialize();
    }

    // Load your resources here
    function onLayout(dc) {
    setLayout(Rez.Layouts.MainLayout(dc));
    }

    // Called when this View is brought to the foreground. Restore
    // the state of this View and prepare it to be shown. This includes
    // loading resources into memory.
    function onShow() {
    }

    // Update the view
    function onUpdate(dc) {
    makeRequest();
    // Call the parent onUpdate function to redraw the layout
    View.onUpdate(dc);
    }

    // Called when this View is removed from the screen. Save the
    // state of this View here. This includes freeing resources from
    // memory.
    function onHide() {
    }

    function makeRequest() {
    var params = {
    "test" => "xyz"
    };
    var options = {
    "Content-Type" => Toybox.Communications.REQUEST_CONTENT_TYPE_JSON
    };

    try {
    Comms.makeJsonRequest( "somesite.example.com", params, options, method(:updateData) );
    }
    catch (ex) {
    }
    }

    function updateData(responseCode, json_data) {
    }
    }
  • Former Member
    Former Member
    Hey Everyone,

    Thank you for reporting this. We did verify this and have created a ticket.

    -Coleman
  • Is there any update to this? I'd like to include the Epix in my supported list but I can't really test things without mucking around with the code to prevent calls to the makeJsonRequest() method.

    Cheers,
    Douglas
  • Former Member
    Former Member
    Hey,

    I checked on the ticket and it looks like it was prioritized for a while and has now been assigned out to be fixed as we are able to focus more resources on some of our longer standing bugs while addressing bug fixes from the recent beta release. We will let you know when a fix is in place, then close the ticket after the SDK has been released.

    Thanks,
    -Coleman
  • Okay, we have a fix in place for this, which will be available in the 2.3.1 release.