Weird issues with VSCode and internal editors not saving data properly

I’ve been working on my dashboard and scripts this past week and a half without many issues in this regard. I’ve been working out of VSCode with my admin token, working on my script, updating, saving, seeing it reflected in the web browser, etc.

I first noticed this night before last when I took my laptop home from work (the same machine that I used all day at work). I am VPN’d in to the office, and I was actually working on my PSU server with vscode on that server, and I noticed content wasn’t being reflected in my scripts/dashboard when saving it in VS Code. The only difference I can think of is that it stopped working once I started working from home, but I was working on the server, so I wouldn’t think it would be any kind of connection issue.

When I came back into the office yesterday, everything seemed to be functioning normally again. Last night I took my laptop home and started working again and I started noticing the strange behavior again. My updates from VSCode on the PSU server weren’t being reflected through the web interface.

I started editing my files from the configurations screen and that’s when I noticed after saving one with Ctrl + S, a couple of my scripts were flipped, the content of one script was saved as another. I almost lost a bunch of code that I had been working on, but I was able to find a not too out of date copy somehow/somewhere.

Now this is the really weird thing, I just ended up browsing to C:\ProgramData\UniversalAutomation\Repository with VSCode and working on the files directly out of there. THOSE files weren’t being updated in the web. Isn’t that what the server is running off of?

So I’m trying to get stuff working this morning, rebooted the PSUServer, no change, created a whole new vscode token, I was able to make one save that showed up on the web, but now no subsequent changes are being reflected.

I’ve probably worked too much this week, and my mind isn’t right. I definitely feel tired. But I’m really confused now. I’m going to try to just close everything out, reboot my machine, and see what happens.

Product: PowerShell Universal
Version: 3.5.4

So, the issue still seems to persist, it’s been a busy day and I haven’t had much time to work on my dashboard/scripts today.

Earlier I showed a colleague how when I edit and save the script, it doesn’t update in the web editor. When I checked a bit later this afternoon, I saw it was actually updated.

I tried again just a little bit ago, edited and saved in VS Code, not updated in the web. I waited maybe a half an hour and it’s still not updated on the other end.

By what mechanism is that suppored to update to the server? I can see that the file that I’m working on is in my users Appdata. I don’t have the setting enabled for “Edit files locally rather than using the REST API”.

I just updated to 3.5.5 this morning and no change.

I know this is an old post but I’m seeing similar issues. For me, the code on pages will be randomly re-written with code from other pages. For example, in the app I’m working on I have a “Settings” page but I’ve come to it today and the code in it is from a completely different page from the app.

Not sure what causes it but luckily, on this occasion, I was able to trawl the local temp folder on my desktop and get an older version to copy the code back in. On previous occasions I’ve had to re-write the code which is no fun when you’re getting on for 300-500 lines :frowning:

So, in my case, I believe I was accidentally working on the scripts out of the “configuration” section in the vscode extension. I ended up submitting a ticket and Adam said it was a bug and I believe it got patched. But I always make sure I’m working on scripts out of the correct section now :smiley:

This is why I’m trying to get a workflow going with git/github at the core of my development. Also, I have someone else I’m writing code with now and it makes collaboration easier.