Launching Panorama by double clicking on a shared database may not consistently connect to the server (update: this should be ok)

I want to alert Panorama X Server users to an issue I just became aware of. This will only affect users that are running Panorama X Clients and Server on the same local network, so that Bonjour is being used to allow the connection. Since so many are working remotely during the pandemic, this doesn’t come as frequently as it would have pre-pandemic.

When Panorama is launched, it uses Apple’s Bonjour system to scan the local network and find any Panorama X Servers that are available. This can take from 1 to 3 seconds.

The problem occurs if you launched Panorama by double clicking on a shared database. When you do that, Panorama will attempt to connect to the server right away. It’s quite likely the attempt to connect will happen before Bonjour has finished its initial scan of the local network, in which case the connection attempt will fail.

The proper solution for this issue is that Panorama X needs to allow a bit of extra time when first launching before it decides that a server is not available – enough time to allow Bonjour to finish the scan of the local network.

Until a new release with this proper solution is available, I would recommend not launching Panorama by double clicking on a shared database. Make sure to launch Panorama by double clicking on the Application icon itself, or by double clicking on a single user database. After a couple of seconds, it will be safe to open shared databases either by double clicking on them (since the Bonjour scan will have already been finished this is ok), or using the File menu options Open File, Open Recent or Open Favorite. I think using this technique will clear up the scattered reports I’ve seen here about problems connecting to the server.

You may be wondering why I didn’t notice this earlier – as it turns out, I virtually never launch Panorama by double clicking on a database. First of all, I have dozens of copies of Panorama on my system, so who knows what version of the app would actually get launched (when I need to test this I drag the database onto the Panorama icon). Secondly, 99.9% of the time I launch Panorama using Xcode to launch into the Xcode debugger, then use Open Recent or Open Favorite. I think early beta testers didn’t find this because they were working remotely due to the pandemic. So this evaded detection until now.

Fortunately, though I don’t think the proper fix will be trivial, I don’t think it will be a huge project either.

You may wonder why Panorama 6 did not have this problem - ironically it is because the old programming system used by Panorama 6 did not properly support Bonjour, so I had to “hack” it on. Panorama X scans the network via Bonjour continuously, as intended by Apple. Panorama 6 would only scan once on launch, with a 1-3 second delay (as specified by the Bonjour threshold). A Panorama 6 client had to be launched after the server or it wouldn’t recognize the server (if the server was launched later, the Panorama 6 client would have to be quit and relaunched). Panorama X clients will properly discover a Panorama X server launched at any time, without having to relaunch the client. But the one detail missing is the possible need for a slight delay on launch if opening a shared database immediately.

Today I investigated this issue further. It turns out that code to fix this issue was implemented in August 2020. I’m not sure if it was ever tested, but I have exhaustively tested it today, and it works as designed. In other words, it turns out that there is no problem when launching Panorama X by double clicking on a shared database – it works just fine, with a slight additional delay as needed for Bonjour to scan the network (it took about 1 second on my network, but the code allows up to a 5 second delay). @JeffK reported a problem with a shared database that had an .Initialize procedure that opened another shared database, so I tried that as well. Everything worked perfectly every time – the database opened, connected to the server after a slight delay, then opened the additional databases, which also connected.

So now that reverts the original bug report back to a mystery. In April I suggested launching the Panorama X app first and then opening shared databases – did anyone find that solved a problem for them? If so then perhaps there is some other problem involving initial launch of Panorama. But as far as I can tell, my suspicion that there was a problem involving Bonjour when Panorama first starts up turns out to be incorrect.