Under Review
over 1 year ago

Communications.makeWebRequest triggers "Not Enough Arguments Error" when simulating connection failure when using :context option

I tried simulating how Communications.makeWebRequest would perform when the device had no connection. The behavior seems inconsistent with documentation and also non-functional, since it calls the callback with a varying number of arguments.

Reproduction:

  1. Design a Communications.makeWebRequest flow that uses the optional :context option.
  2. Define a callback to accept it, like this:  public function onReply(responseCode as Lang.Number, data as Lang.Dictionary or Lang.String or Null, inContext as Lang.Object) 
  3. Toggle off connections: Settings>Connection Type>BLE>Not Connected and Settings>Connection Type>Wifi>Not Connected
  4. Cause a network call to happen

Outcome:

  • A runtime error occurs, indicating the line number of the callback function definition.  Error is: "Not Enough Arguments Error"

Expected outcome:

  • The number of arguments sent to the callback function should be the same, regardless of the connection state.  It's not possible to know before making the call how many arguments will come back, and monkey c doesn't have the option to mark arguments as optional.

CIQ 4.1.6

Epix (gen2)

Parents Comment Children
No Data