We have moved at community.getvera.com

Author Topic: UI7 Serious Design Bugs for Plugin Developers and 3rd Party Clients  (Read 1426 times)

Offline RichardTSchaefer

  • Community Beta
  • Master Member
  • ******
  • Posts: 10091
  • Karma: +764/-143
Folks, I have been struggling with weird behavior on UI7.
A lot of things are now clearer.

In UI7 it appears the the LuaUPnP program will only process requests to port 3480 sequentially.
What does that mean ?
Well the Browser (AND most 3rd party remote apps) sit in a loop making requests for user_data.
The UI7 web client has a timeout of 60 seconds, I am not sure what 3rd party clients may use.

Problem 1:
If you make a request, and your Vera is relatively idle and you have a timeout shorter than the longest poll interval in the user_data request of all the 3rd party clients ... your request could time out.

Problem 2:
If you use JavaScript in your plugin ... it often gets loaded AFTER Vera tries to execute it. So on a new browser session or after a refresh your code fails.

Problem 3:
Related to problem 2, In UI7 every JS button or tab will cause your JavaScript to reload, you may have already realized this.
What you may NOT have realized is that your code may be running from the previously loaded request. And a FEW seconds later the actual code may be loaded again. If you have any code that runs as a result of the code being loaded, it will have run long AFTER Vera has called  your function, which ran based on the previously loaded code. If you assumed that this code will only run before Vera calls your functions, you will have a problem!