another XTdb beta that MIGHT solve the problem of not updating

James Sentman james at sentman.com
Wed Feb 16 10:33:54 EST 2022


Hello folks!

This has been quite an adventure trying to figure out what was going on. I believe I understand what was happening and I believe I have fixed it, but duplicating the issue was never 100% for me anyway so it’s possible I h=just haven’t seen it again now.

On this beta I have enabled the Debug menu so you can collect some more info for me if you do find that it still happens. If you have a misbehaving graph open the window in the App and pull down the Debug menu. The last item on the menu is to “Debug Adding Datapoints” and if you select that it will turn on a whole lot of extra logging for just the one graph that is showing the problem. Collect some of that output from the XTension log for me, enough time that it has had a couple of updates from the units that are not updating the graph is enough. I don’t need hours and hours. Then you can turn the logging off again. This makes no changes to the database structure or anything so if you turn out to have more problems rather than fewer you can just put back the release, or the previous beta or whatever. I wouldn’t recommend playing with other things in the debug menu except perhaps the “Invalidate Local Cache” option. if you have a misbehaving graph and you have already turned on the debug adding datapoints and collected that data for me, you can select this for the graph which will log a whole lot more as it clears out the memory cache of the data and reloads from disk. 

In addition to the above fix I’ve added a few other things since the last release that may or may not be helpful. 

The mouseover and other value displays should be able to show negative values properly now.
There is now a default font popup in the preferences dialog, and a font popup in the setup for each graph so you can customize the display either globally or for individual graphs. This is not yet supported for gauges. 
You can now change the unit that is in a graph without deleting and re-adding the new one, so you can keep all the other settings. When clicking on a unit in the list of units in a graph there is now a little triangle to the right that indicates there is a menu there. If you click on the triangle it will popup the unit list and you can select a new unit for that display line. This is also not yet added to the gauges.
Going forward if a unit is deleted that is included in a graph it will now remember the name of the unit that was in the graph. So instead of the current logging which just says that a unit in the graph can’t be found it will actually tell you what the last name of the unit was that can’t be found. This will only work for units that are lost going forward from the first time you run this or a newer version, it won’t be able to figure out what the name of units that already missing when you first run this.
I fixed a couple of other minor logical errors that might have caused some weirdness in certain unusual situations and have also done some minor optimization of a few other sections of the drawing code. Nothing that will make a lot of difference or that could introduce any new problems, but you never know…

For the morbidly curious the problem with updating actually stems from changes Apple has made to the file system over the last few years. It used to be that file system actions were “atomic” meaning they completed before your call to do them returned. That is no longer the case. There were places where I was writing to the disk and closing the database file. Then I immediately expected the new file size reading to reflect the new data that I had written. It often did not update until some time later which caused the queries to report that the reading had reached the end of the file before it had actually reached the end of the file. I have changed to a different method of getting the file size for knowing when I’ve reached the end of the file or the memory cache block and that appears to have solved the problem. It may not be the entire problem of course ;) But it was definitely a problem that could cause the problem that I was able to duplicate here.

Download the latest beta from here: https://MacHomeAutomation.com/files/xtdb/xtdb_3_6_2_b2.dmg

Please give that a try and let me know what happens. If it still shows the issue then please collect some log output for me as that will help a great deal to figure out what is still happening. If this does fix it I’ll finally be able to turn some attention to all the other irons in the fire ;)


Thanks,
 James


James Sentman                       http://www.PlanetaryGear.org		http://MacHomeAutomation.com






More information about the XTensionList mailing list