Things That Keep Me Up at Night — Application Scripting and the Red Queen's Race

This is the first in a series [hopefully, it's only occasional] on Things That Keep Me Up At Night (TTKMU@N). An image that's stayed with me since childhood is that of the Red Queen and Alice from Lewis Carroll's "Through the Looking-Glass" — running as fast as they can and getting nowhere. I was reminded of the story recently when someone complained that we, i.e., xTuple, refuse to use the latest and greatest version of various technologies.

Let's get real here... PostgreSQL delivers a significant new version about once a year. Same with Qt, various Linux distributions, Xcode, and macos. Every time we change any one of those, we introduce instability in the product. Every time we don't change one of those, we risk falling behind and causing instability. The faster we run, the less progress we make.

One example of how upgrading existing infrastructure causes problems: The timing of events when opening windows changed. This led to innumerable problems with check box memory, window position and size memory, and list selection criteria in our 4.10 and 4.11 releases.

On the other hand, not upgrading infrastructure itself causes problems: Two new developers started to work here in the past month. The first followed the standard instructions for setting up his development environment. The second, only 2 weeks later, could not. The Qt folks had changed their downloads pages, and the version of the toolkit we've been using for the past few years isn't even listed. That's easy to work around, but the point is that we need to upgrade so others outside the company can stay involved.

The TTKMU@N: This could affect every script ever written to modify the xTuple ERP desktop client. Why? Because the underlying script engine may change. This in turn affects every xTuple user.

Starting with version 5.0.0 of xTuple ERP, we'll be using Qt 5.10. We don't yet know all of the script changes that will be required.

We have started building tools to help you (and us) find scripts that need to be changed. Version 4.11.3 adds a small change to the User Account Preferences window (either System > Preferences or xTuple > Preferences, depending on platform). You can choose how noisy the desktop client will be about detected incompatibilities. As we learn more, we will expand the list of issues detected and reported this way.

Script deprecation detection

The values have the following effects:

Nothing special is done
Debug, Info, Warning
A message is written to the Database Log window
A message dialog appears which you must acknowledge
A message dialog appears and then the application exits

Some xTuple code needs to be fixed. This will warn you about those instances as well as your own customizations. Here is an example of the output just starting up the application with my test database and opening the Database Log window:

Fri Mar 9 11:16:41 2018 Debug: "en_us"
Fri Mar 9 11:16:45 2018 Debug: "Enterprise"
Fri Mar 9 11:16:48 2018 Warning: "Use QMenu::insertSeparator instead of toolbox.menuInsertSeparator()"
Fri Mar 9 11:16:48 2018 Warning: "Use QMenu::addAction instead of toolbox.menuAddAction()"
Fri Mar 9 11:16:48 2018 Warning: "Use QMenu::insertSeparator instead of toolbox.menuInsertSeparator()"
Fri Mar 9 11:16:53 2018 Debug: Looking for scripts ("QObject", "QWidget", "XWidget", "errorLog")

One or more scripts are adding to the menus the old way and will need to be fixed. Following the trail of scripts loaded will help narrow down the problems.

As the Red Queen said, "Now, here, you see, it takes all the running you can do, to keep in the same place. If you want to get somewhere else, you must run at least twice as fast as that!"

Gil Moskowitz

Director Software Development

Gil joined xTuple in 2005 to develop the first version of multi-currency support in our products. He helped xTuple transition from its original closed source OpenMFG product to the commercial open source company we are today. Before coming to xTuple, Gil worked for several large and small software companies in a variety of roles, including Informix Software, where he managed the database backup/restore utility group. He always advocates for, and delivers, high-quality products through improvements to the software development process. Ask about his other jobs next time you see him — ! He has a B.A. in Biology from Reed College and an M.S. in Computer Science from Old Dominion University.