Message Rotator Tile Device - A bug has appeared

Hey @thebearmay - I've discovered a bug with 'Message Rotator Tile Device' which is strange as I didn't notice what I describe when you first created it. I've made sure I have the latest version and I'm not sure if any platform update could have caused the problem. The below is repeatable directly from the device page.

  1. Add first Message ID & Message. The ID & Message appears in State Variables. Current States 'html' displays the Message

  2. Add a second Message ID & Message. With a page refresh, State Variables is updated to show both ID's & Messages. Current States 'html' switches every 3 seconds between the two messages

  3. Remove either Message ID. With a page refresh, State Variables is updated correctly to show the one remaining message. However 'html' has changed to 'null' and nothing is shown on the tile.

When the remaining Message ID is removed, the 'html' returns to 'No Current Messages'

Edit: It appears to depend on what is in the "html' at the time the message is removed. If Message ID 1 is removed while the html is showing Message 1, all is good and the html will switch to show the remaining Message 2 as expected. However, if Message ID 1 is removed while the html is showing Message 2, the html switches to 'null' as described in 1 to 3 above. I tried to capture it with logs, but with debug logging enabled I don't see anything in the logs at all. I wouldn't know, if there was some way of modding the code, so that when a 'Remove ID' is received, the driver waits until the corresponding Message for that ID is in 'html'/displayed before removing itself.

1 Like

I remember seeing that in one of the iterations. Let me take a look and see if I can catch it.

1 Like

Think I have it fixed, v0.0.4 is out.

1 Like

Great. I'll update now. Thanks :smiley:

Damn - same but different.

Previously:
Create ID 1 & Message
Create ID 2 & Message
Remove ID 1 while Message 2 is displayed in html
Null displayed in html

Now it seems to have reversed:
Create Message ID 1 & Message
Create Message ID 2 & Message
Remove ID 1 while Message 1 is displayed in html (or remove ID 2 while Message 2 is displayed)
Null displayed in html

It seems to be a timing thing and depends on when the remove ID is input. As that will be the result of a rule action it's impossible to avoid.

I'll try and video it and post a link

Helps if you put the If statement in the right place… try v0.0.5

2 Likes

Thanks. After I first updated I could still get it to fail in the same way and thought for a moment the bug was still there.

Without making any changes, I did a 'Save Preferences' and now it works perfectly. I've tried my best to break it by timing when I do the remMessage but it works every time :+1:

1 Like

Aargh! I broke it again. It has been running normally for several weeks. Tonight one alert was showing, a second message popped up that I acted on 12 seconds later (which cleared that second message) and it went straight to 'null' at that point. No logs unfortunately, just the events from the device:

I've not a clue what has changed but previously I couldn't get it to fail.

Could have sworn every loophole had been closed, but guess not. :sunglasses: I should be able to take a look at it today.

1 Like

Thanks @thebearmay - it’s nothing critical as it fixes itself the next time an ID is added or removed.

After the last update I messed around, timing the removal of each ID at different intervals to try and get it to fail with ‘null’ but I couldn’t. Yesterday it just happened out of the blue in a similar manner to previous. I’ve switched debug logging on, in the event it happens again and can provide any information useful for diagnosis.

May have found a loophole. Closed in v0.0.7

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.