UIv4 Module Code Editor/IDE funkiness
- code reverting (reproducable): If I make changes to some powershell in the new code editor, then change tabs/windows. When I change back to the window with my editor, it has reverted to the previous save point. An Undo will bring back my changes... but it's scary after making a few changes after staring at your code for longer than expected working through logic in your head.
- property source error output: In UIv3, there was side by side output vs. error screens. We now just get the little info bar at the bottom that states "couldn't do"... but not where/why/what that could be troubleshot. I'm having to add in a ton of troubleshooting output to the property definition to be able to expose the data I need to fix the scripts. The one I just completed is nearly 30% error output handling to be able to figure out what is wrong with it.
Other than those two things, I'm pretty happy with the changes from the old.
Cole McDonald
Posted 1 year ago·Last reply 1 year ago
11 comments
Michael Rodrigues
·1 year agoLewis_Beard , Mike_Moniz, Cole_McDonald
I'm unable to reproduce this, but I'm concerned to see 3 reports. Could you please let me know which browsers and operating systems you're using. And how long it is between tabbing away and tabbing back, that the content reverrs?
I've tried on Firefox on Linux, and Google Chrome on OS X, but I can't reproduce it.
Does it usually happen immediately after tabbing away and back? Any other details you can remember that might help me reproduce it?
Mike Moniz
·1 year agoI haven't been coding as frequently as I have in the past, but from what I recall it would happen like described where I would be writing up code unsaved in the code box, switch over to another tab for likely several minutes (like 10+min) then go back and the code would revert. I didn't even realize you can undo to get it back. The last time I was coding was perhaps a month or two ago and I'm using Windows 11 with Firefox.
Actually at one point this forum was doing something pretty similar but I haven't seen it recently.
Lewis_Beard
·1 year agoI am using Chrome, Version 136.0.7103.114 (Official Build) (64-bit). I'm on Windows 11 Enterprise, and our IT keeps our versions and etc fairly up to date. Since you tested on non-Windows systems exclusively, maybe its Windows-specific? Not sure.
Anyway, for me, it happens in about 60 seconds, tops. It is constant for me. If I even so much as click on another tab, say the API reference or another tab that has something else open in LogicMonitor, and I poke around for just a few moments and come back .... my code is gone. I didn't know about Undo either, but I generally don't trust Undo type operations. Especially in situations like this.
So if I even so much as want to throw down a println to see a property coming back from a map response, and I cant remember the name for the property I want to snag, and I pop over to the API to see "oh yeah, its dataSourceId and not dataSourceTemplateId" or whatever .... wham. My code is gone if I'm over on another tab more than just a few seconds.
So I end up commenting and saving on every line or block of code if I need to tab over.
Lewis_Beard
·1 year agoWell of course now that I say it happens in 60 seconds tops, now it doesnt. I'll do some testing to see if I can pin anything down.
Michael Rodrigues
·1 year agoI appreciate the honest followup.
I spun up a Windows VM in AWS today, tried Edge, Firefox, and Chrome. Tabbed around, logged in and out (RDP session). Locked the screen and came back. Could not get it to blow any unpersisted changes away.
Lewis_Beard
·1 year agoI just had this happen to me again today. It never happens when testing, but always when I'm actually coding. I have an idea on why this may be happening. When I'm coding, I don't my changes to take effect in a way that would actually impact the devices, especially on a new datasource.
So I make the config source (in this case) with my AppliesTo set to be false() and I put in some basics for the config source. Then I save it. But as I develop, I will comment out the false() with /*false()/ and add other lines of code such as system.displayname == "myserver.whatever". But I DONT SAVE because I dont want the config source to actually get applied .... its not ready. I'm literally make it from scratch.
So then I'll add a few more lines of code, maybe I'm trying to get expect to work up to a certain point, or I want to crawl through a successful login with expect etc before I actually save the config source.
So I'm doing all my coding with my AppliesTo altered. BUT NOT SAVED. Sometimes I'll even have a little popup that says something about my appliesTo, and to make sure its right. The IDE is trying too hard. But it wont wipe it yet. But it seems to be the case that, if I've altered my AppliesTo so that the code can target a device, but I have NOT saved the config source because I dont want to save change, this seems to be the scenario I remember from the past.
And it definitely happened to me just now. I tabbed over to a text file to look at some related info, and tabbed back to the LM IDE or UI for editing my module maybe 10-20 seconds later and ..... both my CODE as well as my APPLIESTO had been reverted.
I will be coding quite a bit more today so if this seems to be the issue, the AppliesTo, I'll update. Because when I was failing to reproduce my own complaint previously, I was just editing code, I wasnt touching the AppliesTo. This time I was, and that seems to jog my memory on the other times I had this happen for real.
Lewis_Beard
·1 year agoJust FYI I definitely have been having this happen to me all day. And most of the time I notice some UI complaint about the AppliesTo when I'm using a temporary (unsaved) one.
Cole McDonald
OP1 year agoI'm in Edge for Business: Version 136.0.3240.64 (Official build) (64-bit)
Lewis_Beard
·1 year agoI can also confirm the first problem. I just developed a datasource to do something, and its frustrating having to remember to comment out the AppliesTo (replacing it with false()) and/or comment out new parts of the code over and over, so that I can hit save, so that I can dare tab out to look at the Swagger API docs or something. :)
Michael Rodrigues
·1 year agoHi Cole_McDonald , thanks for posting this.
I've sent this post to the LMX team and have asked them to take a look at the code reverting issue. My first guess is it is related to caching, but not sure.
As for the PropertySource error output, I've got an improvement written up for this but I can't provide a timeline on when it will be done and in product.
The idea was to basically show standard out and error for both Collection and AD "Test Script". It would be shown in a window or modal, not in some toast message that will disappear in 3 seconds.
Also, for "Test Active Discovery", I'm hoping to combine this with "Test (AD) Script" so that users can see both their output, and our interpretation of it for help debugging AD issues.
Mike Moniz
·1 year agoI've also see the code reverting issue.