[Location Plugin] Location Plugin error in WatchPosition

[Location Plugin] Location Plugin error in WatchPosition

  
Forge Component
(17)
Published on 2016-12-15 by OutSystems R&D
17 votes
Published on 2016-12-15 by OutSystems R&D

Ever since upgrading to 10.0.405.0 in the Location Plugin, I am getting Error #1 - "Cannot assign a Javascript undefined with value undefined to an output parameter of type Text Check the Javascript node 'WatchLocation' of the action 'WatchPosition'."

This is after calling the WatchPosition and checking the "Success" output variable.

Hello, Mike,

That issue sounds familiar...have you updated to the latest version of the plugin after the upgrade?

Best regards,

Carlos Simões

Thank you Carlos, I had thought I had upgraded in January, but apparently not.  After upgrading to the latest version, it appears to have solved it.  Thank you so much

Carlos, I spoke too soon.  It's not happening every time, but it still happens about 30% of the time.  The plugin is upgraded to the latest version, I get it to happen initializing on the OnReady event in my map screen.

So, usually when launching the app for the first time in a while, the first time going to the map, this error appears.  Does anybody have a solution for this?  Is it a bug in the Location Plugin code?  The initialization and usage of the plugin is fairly straight forward, so I believe I am using it properly.  The GPS on the device is working, and if I go out of the map, then back it, it works fine.

Hey, Mike,

I was just having a look at the plugin itself and, as the message suggests, it appears there's an error on the WatchLocation JS node, from the WatchPosition action.

Are you using the WatchPosition action directly (rather than the LocationTracker block)? If so, are you taking care to call ClearWatch on the screen's Destroy event?

Best regards,

Carlos Simões


Indeed I was not calling ClearWatch!  I will try that and report back.

Please do tell if it doesn't work, Mike. I'm not 100% sure that's it, but it's something I consider a good practice.

I would agree with you on best practice, however, it did not solve the problem.  It's also sporadic, so it's very difficult to pin down.

Solution

Sorry to hear that, Mike.   

I did some further digging and have another hunch, but since I am having trouble reproducing it, I'm going to need your help.

I suspect that somehow, the device is having trouble watching the location, fires the error callback, but since there are no safety checks in place for the error object, the exception you are seeing is triggered.

Could you publish the attached eSpace and see if the issue is resolved? If so, please let us know, so we can troubleshoot the issue further (namely try to find out why the error object is not being properly filled, if that's the case).

Thanks in advance, and best regards,

Carlos Simões

Solution

Carlos, I'm cautiously optimistic, but I have not receive that warning message in 24 hours.  I think this new version may have solved the problem!

That's great news, Mike! Please let us know if resurfaces.

I'll put an item on the backlog regarding this and you should be seeing a fix soon.

If you have any other questions regarding this issue, please let us know!

Thanks again for the help, and best regards,

Carlos Simões

Dear Carlos; I have not used it but working to use all plugin. It appears that I have the latest version, and it must work for me as designed.