Publ: Development Blog

News and updates about Publ

The silliest Publ bug so far

Posted Wednesday, April 11 at 9:22 PM (6 years ago)

So I was trying to figure out why new entries weren’t appearing in indexes until things restarted. I thought it might be a caching thing, but editing entries caused them to update instantly. So then I thought it might be an index thing, like maybe something silly with how SQLite handles timezone-aware DateTimes, so I overhauled the date handling so that it separated out display_date from entry_date, but that didn’t help either. Then I looked closely at the database before and after restarting the process, and that didn’t help. And then I made sure my queries were using the right timezone, and that didn’t help.

Then I had one of those moments where I realized what I’d done wrong with such sudden clarity that I couldn’t help but yell at myself a little.

Let’s talk about entry IDs

Posted Wednesday, April 11 at 5:00 PM (6 years ago)

So, previously I was just letting the database generate entry IDs on its own. In SQLite this means it would always generate the next entry ID as the highest one plus one. This is fine in a circumstance where entries always get assigned their IDs in the same place, but in Publ’s model that might not be the case.

One particularly fun circumstance: A site’s maximum ID is 406. You’ve written an entry on your own machine, and someone else has written an entry on their own machine (or you wrote two entries, each on a separate branch), and when testing the rendering they both end up getting entry ID 407. Which one’s right?

Pagination corrected

Posted Wednesday, April 11 at 12:06 AM (6 years ago)

There was a silly bug with how I was generating paginated views which I noticed as soon as I did my commit/merge last night but I figured I’d wait until today to fix it (because the fix was obvious and I was already up way too late). And I fixed it.

So.

There is only one feature left before I can start making a real site with this thing: Image renditions.

This is the single most important feature (at least for the initial phase of Publ), and in fact about 95% of the reason why I decided to write a new CMS to handle my site content; this is the one thing that every CMS I’ve seen does a poor job of handling, and which is very difficult to hack around. (I hacked around it in Movable Type, as I mentioned previously, and it is one of the most irritating things about running my site as it is.)