There was a big data-losing bug in Drummer, and last night I think I got it. #
Of course I was looking in the wrong place. Staring at code that wasn't working and not questioning whether or not it worked. One of the oldest programmer debugging mistakes. How long have I been programming? Too long. I still make this most obvious error. I suck!!!#
A change comes in for the instant outline. Since it is not frontmost, we stash the opmltext somewhere out of the way until the user activates the I/O by clicking in its tab. (I/O is the shorthand for instant outline.)#
Drummer then starts activating the I/O. If it finishes before it gets to the code where it installs the updated outline, everything is cool, nothing gets overwritten. This is what's called a "race condition" in programming.#
But if it's still doing the activation when it installs the opmltext, it will go into the other outline, which is now not visible.#
And it shows the I/O but the old version of it. Since you don't know what to expect, you don't notice it.#
Then when you switch back to the other outline, oh my god, it's got the I/O outline. #
If you then make a change, it will write it back out to the server. And you've lost your outline. #
The fix was simple. Don't install the new opmltext until the I/O is fully activated. #
As I've been writing this I've been switching back and forth over in Drummer on every line I type.#
Caching causes weird behavior for new users. This is a longish note because people will have to do something if and when their blog.opml outline gets large. The story follows...#
Previously, if you deleted a day from your blog.opml outline, the day would still be part of the home page of your blog. This clearly was not good behavior. Now when you delete a day in your blog, the day will not appear in the rendering. That's the change, simple enough. Almost like fixing a bug, but not really. If you're expecting to be using Drummer for blogging for a while, as it appears some of you are, please read the next parts carefully.#
This approach would not work for my blog, Scripting News, because I have to remove stuff from the outline to keep its size manageable. I do it every month, start with a clean slate. But when I do that there is no change in the home page of the blog. Tomorrow, on the first day of September there will still be 25 days on the home page. This is done using a cache that Old School maintains. #
Since prior to Drummer I was basically the only user of Old School, everything was cool. Now I can get the behavior I need by setting a config option called flOldSchoolUseCache and setting it true. Then (hopefully) Old School knows to use the cache (there could be a bug in the implementation). This will get a test on September 1 when I do the rollover. I will hold my breath when doing it. 😀#
Someday if you have too much in your outline and Drummer starts getting slow or you want to reduce clutter, just add the flOldSchoolUseCache head-level attribute to your blog.opml file, but not before then because you'll starting seeing days you deleted come back to life.#
A couple of general notes that may sound like scolding, so I have to say up front this is like Zen and the art of software testing. Lessons learned after decades of doing this stuff:#
You have to be careful in what you do. That's a basic rule of computer use, you won't get far if you just bang on the keyboard trying random stuff out. Drummer is like most software that way, and it's unfair to ask me to debug that kind of use. So please put thought into using the sofware. #
When blogging in Drummer, always use the + icon to create new posts. If you do it by hand don't ask for help. I don't want to document all the things the + icon does for you and I don't want to debug work that has incorrect attributes. It's there to make your work easier and more error-free. If you want to fly by the seat of your pants, go for it, but don't ask for help. 😀#
There was a big data-losing bug in Drummer, and last night I think I got it. #
Of course I was looking in the wrong place. Staring at code that wasn't working and not questioning whether or not it worked. One of the oldest programmer debugging mistakes. How long have I been programming? Too long. I still make this most obvious error. I suck!!!#
A change comes in for the instant outline. Since it is not frontmost, we stash the opmltext somewhere out of the way until the user activates the I/O by clicking in its tab. (I/O is the shorthand for instant outline.)#
Drummer then starts activating the I/O. If it finishes before it gets to the code where it installs the updated outline, everything is cool, nothing gets overwritten. This is what's called a "race condition" in programming.#
But if it's still doing the activation when it installs the opmltext, it will go into the other outline, which is now not visible.#
And it shows the I/O but the old version of it. Since you don't know what to expect, you don't notice it.#
Then when you switch back to the other outline, oh my god, it's got the I/O outline. #
If you then make a change, it will write it back out to the server. And you've lost your outline. #
The fix was simple. Don't install the new opmltext until the I/O is fully activated. #
As I've been writing this I've been switching back and forth over in Drummer on every line I type.#
Caching causes weird behavior for new users. This is a longish note because people will have to do something if and when their blog.opml outline gets large. The story follows...#
Previously, if you deleted a day from your blog.opml outline, the day would still be part of the home page of your blog. This clearly was not good behavior. Now when you delete a day in your blog, the day will not appear in the rendering. That's the change, simple enough. Almost like fixing a bug, but not really. If you're expecting to be using Drummer for blogging for a while, as it appears some of you are, please read the next parts carefully.#
This approach would not work for my blog, Scripting News, because I have to remove stuff from the outline to keep its size manageable. I do it every month, start with a clean slate. But when I do that there is no change in the home page of the blog. Tomorrow, on the first day of September there will still be 25 days on the home page. This is done using a cache that Old School maintains. #
Since prior to Drummer I was basically the only user of Old School, everything was cool. Now I can get the behavior I need by setting a config option called flOldSchoolUseCache and setting it true. Then (hopefully) Old School knows to use the cache (there could be a bug in the implementation). This will get a test on September 1 when I do the rollover. I will hold my breath when doing it. 😀#
Someday if you have too much in your outline and Drummer starts getting slow or you want to reduce clutter, just add the flOldSchoolUseCache head-level attribute to your blog.opml file, but not before then because you'll starting seeing days you deleted come back to life.#
A couple of general notes that may sound like scolding, so I have to say up front this is like Zen and the art of software testing. Lessons learned after decades of doing this stuff:#
You have to be careful in what you do. That's a basic rule of computer use, you won't get far if you just bang on the keyboard trying random stuff out. Drummer is like most software that way, and it's unfair to ask me to debug that kind of use. So please put thought into using the sofware. #
When blogging in Drummer, always use the + icon to create new posts. If you do it by hand don't ask for help. I don't want to document all the things the + icon does for you and I don't want to debug work that has incorrect attributes. It's there to make your work easier and more error-free. If you want to fly by the seat of your pants, go for it, but don't ask for help. 😀#
copyright 2021 Dave Winer.
Last update: Saturday September 4, 2021; 12:34 PM EDT.