Port Number in Advanced Settings lost with 8.0.5 update

I have not confirmed this is because of the 8.0.5 update, but shortly after updating I found my port number in settings was reset to 0.

I’m not seeing this on any projects here. Is this for Global Location or Project Location?

Tools/Preferences/Advanced - I assume global. I was using 62000. Suddenly my PWA was going really stupid in chrome - not loading files correctly from Start in Desktop “server”. I closed everything, started again and noticed no local storage variables, then found random port number, as it was reset in IDE to zero. Have no idea why, but had done 8.0.5 a few hours before, but had not closed it since initial opening. Resetting the value solved the problems. I’ll keep an eye open.

This had not come up again until yesterday. It happened during the 8.2.1.1 update from 8.2.1.0. The port number in preferences advanced was reset to zero. Normally when I install an AppStudio update, I just apply it to the open AppStudio. This particular time, I first closed AppStudio and then applied the update. Windows 10.

Hmmm…

Try going into the Code Window. Has the font been reset as well?

Not sure what it was set to. But it is now Consolas, size 11, indent 2 But clicking default changes to courier new. Left it as Consolas, which doesn’t look out of place (I didn’t notice a font change, but …).

The update to 8.4.1.4 also deleted my port number setting again. It has been since Aug 13, 20 since the last time. Wondering if it’s connected to the CSP issue in any way. I did not check the registry before I fixed the issue this time to see if the key existed and/or contents. I’ll watch that next time.

Still Consolas in the registry.

Thanks. We’ll fix the CSP issue first, then see what happens.

CSP issue should be fixed in 8.4.1.5

I think I know how it happens. If you open AppStudio and run a project, it will use the preferences setting. If you open another instance of AppStudio (probably by mistake, as I did), and run the same project, it picks a random port number. If you close the original AS with the correct port number first, then close the second one, where AS picked a random port, AS changes the project properties on the 2nd close to port 0.

So what’s the solution? Disallow multiple AS instances? Probably not. Check to see if there is another AS instance before deploying? Sounds complicated. And even if you did check, what do you do? Tell the user they are about to destroy the port number?

I’m guessing AS specifies the port number in the call to the local server from the settings, but how is it changed to zero on the second instance, and why is it saved? I’m going to assume a “port is busy” signal was found and that the port number was changed. I think instead of changing the port number, why not say in a modal, Port is Busy - fix it, and not change the port number.

I think you may be onto something - but when I try this sequence (and a bunch of variations), I can’t get it to happen.

Are you able to reproduce this?

Windows 10 64 bit with NTFS disk.

Here’s what I see - basically the same as above, and yes, very reproducible.

  1. Open AS and check port number - 62000
  2. SIDB - chrome shows port 62000
  3. Open another AS instance and check port number - 0
  4. SIDB = chrome shows port random #
  5. Close 1st AS instance (I checked port number first and it was 62000)
  6. Close 2nd AS instance (I checked port number first and it was still 0)
  7. Reopen AS, port is 0

OK, this makes sense.

Changes to settings are not saved until AppStudio is closed. If you have more than one instance of AppStudio open, the settings from the last one to close will be what’s saved for next time you start.

As I said before, I’m not sure what makes sense to change as far as using 2 instances at once - probably nothing. However, the 2nd instance isn’t working correctly, as it doesn’t read the port number, and probably some other preference settings. If the 2nd instance read the port number, then this wouldn’t be a problem with the 2nd instance overwriting the settings.