So, I’m just tidying up the publication semantics by adding a
published_at field to Content, and adding a Trigger class, which fires
off events at specified times in the future (or as soon after the
specified time as possible).
The workings are slightly ugly at the moment, but the upshot of this
is that articles.published is only true for articles which are both
marked as published and have a ‘published_at’ time in the
past. Pending articles are have a future published_at attribute, a
false ‘published’ flag and an entry in the triggers table set to fire
on the first request after the published_at time.
The idea is that notification, remote pings and cache invalidation all
get pulled out of Content and into appropriate observers (Notifier,
Pinger and the current CacheSweeper spring to mind as decent names),
which only fire at the point when an article is actually published
(using a ‘just_published?’ flag). Which means we also get to DRY up
the various places which trigger notifications/pings (they’re
currently triggered in Admin::ContentController and various of
webservice implementations, and they sometimes trigger at the wrong
So, with that in mind, I’m canvassing opinions on what people expect
If you post an article and don’t mark it as published, but do set a
‘Publish At’ time, do you expect it to get published at the requested
time? I’m assuming ‘yes’ for the time being.
NB: For the “Can’t we just have a stable release?” crowd. The stable
release is currently blocked on Scott’s work on making Typo
installation rather more friendly and is independent of the work I’m
doing on publishing semantics. The publication semantics work is
because, at present, the notification/remote ping system is broken in
the face of future publication times – notifications get sent before
the article is visible on the blog, which is flat wrong. It’s also to
do with code quality; by adding various observers we can get rid of a
fair amount of code duplication and ‘structural’ code
- Structural code is code which treats an object as a data
structure – never a good sign.