Hi fellow citizens!
Some time ago (I forgot where I posted that), a few of you very correctly complained that these forums were a pain to deal with when you left an un-sent message open and didn't save a draft — and then the browser crashed, the computer crashed, the cat walked over the keyboard, you pressed 'refresh' by mistake, etc. and so on... whatever the reason... your patiently crafted masterpiece was gone. Gone! And no (easy) way to retrieve it.
Worse than that, because the session expiry time was so short, even if you did everything correctly, when pressing Submit, the forum software would ask you to login again — losing everything you've written so far!
These days, we're too spoiled by all these clever tools out there which will do an auto-save every few seconds or so, and I tried to figure out if there is a module or extension or plugin for phpBB (the forum software we're using) to deal with these issues.
As it happens — there isn't
Why? Well, I really don't know why. All I can say is that this particular software has been around for two decades or so — that's why it's quite robust and has very few, if any, security issues — and is contemporary with, say, WordPress. Unlike WordPress, however, there is no multi-billion-dollar company behind it, just a huge community of developers, each with their own idea on how the software should work (and, naturally, disagreeing on almost everything...). Auto-saving is something that was never in their plans. They have included the load/save draft features — possibly as an afterthought — which, however, require you to remember to click on it (and it's not immediately obvious where the drafts get saved to...).
Anyway... as always, I digress... the point is that to deal with this specific issue, there was no other choice available but to develop my own plugin, since I couldn't find any. My first attempt is a bit naïve but it sort of works: every ten seconds or so, the content gets saved to the local browser (and not remotely on the database!). If the browser crashes, that content does not get wiped out; rather, it remains on permanent storage and survives a browser crash/shut down/whatever. How exactly that is done depends on the browser itself; each might have different strategies to deal with it. But... it works.
Unfortunately, I didn't know, but it seems that there were a lot of edge cases which weren't covered — and it's often during those that the content gets wiped out. For instance, if the session times out — for security reasons — the content got lost when you pressed Submit, because, well, that's what usually happens. The temporary solution was to extend the session timeout from "a few minutes" (I believe the default is set at 15) to "several hours", but this doesn't cover everything.
I'm now ready to test the "latest generation" A few extra tricks, which I hope will deal with all those edge cases. The goal is never to lose a post again due to whatever errors might happen, either on the server or on the browser. We'll see if it works!
P. S.: After taking a peek at the page where this plugin was uploaded (they have a sort of directory, or library, where all publicly available plugins get announced), it seems that 500+ people have downloaded this plugin since it was first developed, less than a year ago (!). I'm not really very surprised, since nobody likes to lose posts, I guess. Hopefully, this encourages the core developers to actually provide a permanent, built-in auto-saving feature. We can only hope