Auto Unlock leads to freezes under some circumstances

I can cause PanX to freeze by doing this:

Open shared DB. Autounlock in Database options set to 15 seconds.
Open form with TEO’s linked to database fields.
Click a TEO; focus ring shows the selected field.
Click on another application. Do something.
While the other other application is active, the Auto Unlock times out, and the record is committed (per the server log).
Server saved the database (per the server log)
Click back on the form with the TEOs. Click another TEO, and the beach ball appears.
The server log show these two lines repeated until a force quit of the client:

04/08/2021 11:42:57 am Automatic unlock of record 2053 in database: Worker (already locked by this user)
04/08/2021 11:42:57 am Session 166 (TGC M1 Mac Mini:Thomas Cooper) locked record 2053 of database: Worker

My conclusion: if an Auto Unlock is performed by the client after another application is activated, and then the user returns Panorama and clicks a TEO, which will attempt to lock the same record, the loop begins causing a freeze of the client.

Solution: so simple is it. Turn off Auto Unlock on the client. No freezes. This is a special day, when I have found a solution to a problem like this. They normally torment me indefinitely.

With the Auto Unlock turned off, the client sends keep lock alive to the server periodically even though Panorama is NOT the the front application. When you return to it, it continues to work normally.

Well that’s sort of a solution. But this should work.

Edit: April 24 - added to BitBucket.

Thomas, thank you for this excellent bug report, especially for figuring out that this happens when Panorama is in the background when the auto-unlock kicks in. The fix was not easy, but thanks to your detailed explanation I was able to immediately duplicate the problem, and eventually verify that it is definitely fixed. So once b17 is released, you’ll be able to turn Auto Unlock back on again.

Yipppeeee! I look forward to it.