This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

[APP] Better logic / Variable management

1568101125

Comments

  • PhuturistPhuturist Member
    edited April 2016
    Emile said:
    @Phuturist does this always happen? Can you maybe invite me to access your Homey?
    This seems to always happen after some time of uptime on the 0.8.27 firmware. I havent figured out what is triggering it. Just did a soft reboot but this is the first time that this didnt help either, my variables are still gone and the same error (timed out GET request) seems to be causing this. I will wait with more soft or hard reboots so it can be looked into.

    Invitation has been send.
  • aloftaloft Member
    edited April 2016
    After a power-cycle reboot this morning my variables were back (at least the ones I re-entered). Now, after an uptime of 2-3 hours, the variables are gone again. I have BL 0.9.3 (upgraded via apps.athom.com) && 0.8.27 

    I only see this statement in the console log

    socket.io.js:2108 WebSocket connection to 'wss://NNNN.homey.athom.com/socket.io/?token=cbcfde49c4NNNNNdcd47c4505b0f27&EIO=3&transport=websocket' failed: WebSocket is closed before the connection is established.

    And in the network log:

    https://NNNN.homey.athom.com/api/manager/settings/app/net.i-dev.betterlogic/variables?_=1459928332327 Failed to load resource: net::ERR_EMPTY_RESPONSE

    It might be worth noting that Z-wave was also unresponsive.  I restarted the Z-wave chip, but that didn't bring the variables in BetterLogic back.  So there might be a relation, but it might be completely separate issues
  • edited April 2016
    My variables were gone this morning as well. This is the screenshot from the Chrome console while on the Better Logic empty settings page:


    Edit: Crap, this time all my variables (30+) are gone. That's never happened before, a reboot would bring them back. So much for them being safe on the disk :)
  • Yeah, I seem to have lost all of them indefinitely as well. The update to 0.8.29 did not bring the back either. I guess I have to start re-adding them to see if they stick this time. Without them my Homey is useless unless I also edit all my flows.
  • Yeah same here - I think I'll wait until the root cause has been found, this is almost as much work as a hard reset.
  • I have an even bigger problem now. I cant add new variables. I already tried reinstalling the app but every time I add a variable and come back to the BetterLogic settings page it's not there anymore. So my list of variables stays empty. Hopefully either Emile or Uranday has a clue as to why this happens or preferably how to fix it.
  • Just tested - exactly the same here. Initially I couldn't even add a new variable (Add Variable button feels dead), I had to click on Delete All first.

    Added a test variable, navigated away from the page, came back - variable gone.

    Strange how it suddenly got so much worse.
  • Ok, that sounds like something u can reproduce. I'll see if I can get more info during debugging. 
  • I found a bug on my side. Ill fix that now and let you know when I updated that. Then we can see if the other bugs still are there.

  • Uranday said:
    I found a bug on my side. Ill fix that now and let you know when I updated that. Then we can see if the other bugs still are there.

    Nice Uranday, I'll be happy to test. I ran into the same scenario as Martijn where pushing the add button for a variable did not respond. Here is the console error that came with it. Perhaps it's of use.


  • After delete the array was made null. I missed a null check when I forcefully read the data from the storage instead of in memory. I fixed some other weird constructs and I hope this fixes all.

    It is submitted for approval in the appstore. If you want early access, you can get it from git.

    I'm very sorry for the troubles.
  • PhuturistPhuturist Member
    edited April 2016
    Uranday said:
    After delete the array was made null. I missed a null check when I forcefully read the data from the storage instead of in memory. I fixed some other weird constructs and I hope this fixes all.

    It is submitted for approval in the appstore. If you want early access, you can get it from git.

    I'm very sorry for the troubles.
    I installed it through GitHub and started adding variables but after reloading the BetterLogic settings page the variables where not stored. Does it need a reboot before this works?

    [EDIT] Using the Delete All button and then trying again seems to solve this.
  • no, please delete 1 time all variables..
  • Uranday said:
    no, please delete 1 time all variables..
    Yes, that works. And no need to say you are sorry for any troubles, you are putting a lot of effort into this which I much appreciate ... :+1: 

  • Hmm - it's still not entirely right, I installed 0.9.4, clicked on Delete All, added a variable, checked to see if it persisted - it did.

    Then added around ten more variables, noticed a slowdown in Homey (variable settings page open in 1 tab, clicking through the flows in another, copy/pasting variable names to avoid typos), enough for certain flows to appear empty.

    Refreshed the page, flows came back. All previously entered variables however are gone again.

    Variable settings page now doesn't load at all (spinning donut), F12 / console:

    i18n.js:1 Uncaught ReferenceError: getCookie is not defined
    i18n.js:1 Uncaught TypeError: Cannot read property 'push' of undefined

    I'll keep it like this in case you need me to test something. I can still ping the device and in another tab things work.

    freemem34127872
    homey_version0.8.29
    hostnameHomey
    loadavg[0.705078125,0.7490234375,0.73046875]
  • You said you pressed delete all. Then no old variables make sense. I'll add a lot of variables later... Unsure if that could cause a problem. Are you sure you did not create a variable loop? This would cause a performance issue. Trigger on any variable and in that flow setting a variable for example. 

  • 1. Delete All (list truly empty)
    2. Add testVariable, set to true
    3. Navigate away from page and back again, testVariable still there
    4. Add ~10 variables as used in my flows
    5. Notice slowdown, refresh page
    6. All variables gone (including testVariable)

    There is no variable loop.
  • Im unsure what this could cause. Could you check 1 thing for me... After adding the variable, can you save the flow? When not selecting a variable from the dropdown it seems to not save. So only typing is not enough... You have to actually pick it.

    I made a test setup.

    10 variables (number 1 to 10) and 1 bool variable.

    There are 10 flows

    If variable N changed
    Add 1 to variable N +1

    So that means that when variable 1 changes, 2 changes, 3 changes etc. And when the bool changes it increments 1.

    I checked it by hand and it seems stable. Now I upped the ante and made a timer every 5 minutes that changes the bool..... Keep you posted.

  • My flows haven't changed, you want me to create a new flow? I was merely re-creating the variables already mentioned in my flows, could that have something to do with it?

    I feel a complete reset coming up.
  • I can confirm the variables have gone missing again. A reboot has brought them back. I did not notice any performance issues but I dont have that much variables.
  • Maybe you could run it with - - run instead of install and see if there are any errors in the debug window? 
  • upped it now to 10 seconds to force errors if they are there...
  • It could take a while, the last time my variables went missing was days ago (if not a week). The performance thing may very well be unrelated, it just caused me to refresh a page which what made me notice the list being empty again.

    Phuturist, did you encounter any of this pre-0.8.27? I don't think I did, but I'm only 98.4% sure.
  • Repro still stands - I hit Delete All, create a variable, refresh -> gone.
  • Martijn, are you on the slack chat?
  • Nope, but I can be! Where do I click?
  • Thanks, got it :)
  • Got it to reproduce. Made the 10 number flow (trigger 1 -> update 2, trigger 2 -> update 3) etc. In debug mode it is running in release mode it is not. Made a video of it (in dutch). Hope @Emile can figure out what is going on.



  • Phuturist, did you encounter any of this pre-0.8.27? I don't think I did, but I'm only 98.4% sure.
    No, this started happening after 0.8.27. Before it was rock solid. As seen above Uranday can reproduce it but the actual cause is still a mystery. I know there was an API change in the 0.8.27 update that broke other apps as well but I still think something related to memory was changed as well causing the current issues with BetterLogic. But that's just guessing, unfortunately I lack the knowledge to help out further.

    (Emile, you still have a pending account on my Homey. Feel free to use it if it helps troubleshooting)
Sign In or Register to comment.