Upcoming forum hiccup alert! (nothing to worry about, really... I hope... lol)

Here you might discuss basically everything.

Moderator: SC Moderators

Post Reply
User avatar
Gwyneth Llewelyn
Forum Wizard
Forum Wizard
Posts: 1187
Joined: Thu May 25, 2006 8:00 am
Contact:

Upcoming forum hiccup alert! (nothing to worry about, really... I hope... lol)

Post by Gwyneth Llewelyn »

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 :)

"I'm not building a game. I'm building a new country."
  -- Philip "Linden" Rosedale, interview to Wired, 2004-05-08

PGP Fingerprint: CE8A 6006 B611 850F 1275 72BA D93E AA3D C4B3 E1CB

User avatar
Gwyneth Llewelyn
Forum Wizard
Forum Wizard
Posts: 1187
Joined: Thu May 25, 2006 8:00 am
Contact:

Re: Upcoming forum hiccup alert! (nothing to worry about, really... I hope... lol)

Post by Gwyneth Llewelyn »

.. all righty! No more hiccups, the work is done (I hope)!

"I'm not building a game. I'm building a new country."
  -- Philip "Linden" Rosedale, interview to Wired, 2004-05-08

PGP Fingerprint: CE8A 6006 B611 850F 1275 72BA D93E AA3D C4B3 E1CB

User avatar
Rosie Gray
Forum Wizard
Forum Wizard
Posts: 2055
Joined: Sun Jun 06, 2010 9:47 am

Re: Upcoming forum hiccup alert! (nothing to worry about, really... I hope... lol)

Post by Rosie Gray »

Thanks, Gwyneth! Oh, and nice new gif for your forum avatar :D

"Courage, my friend, it's not too late to make the world a better place."
~ Tommy Douglas
User avatar
Tori Landau
Casual contributor
Casual contributor
Posts: 21
Joined: Wed Jan 20, 2016 3:50 pm
Contact:

Re: Upcoming forum hiccup alert! (nothing to worry about, really... I hope... lol)

Post by Tori Landau »

Many thanks Gwyn! I too like you new avatar :)

User avatar
Gwyneth Llewelyn
Forum Wizard
Forum Wizard
Posts: 1187
Joined: Thu May 25, 2006 8:00 am
Contact:

Re: Upcoming forum hiccup alert! (nothing to worry about, really... I hope... lol)

Post by Gwyneth Llewelyn »

lol thanks I guess! You know, every few years or so I take some time off to do another winking animation... they take eternities to do!!

"I'm not building a game. I'm building a new country."
  -- Philip "Linden" Rosedale, interview to Wired, 2004-05-08

PGP Fingerprint: CE8A 6006 B611 850F 1275 72BA D93E AA3D C4B3 E1CB

Post Reply

Return to “General Discussion”