The way the edit lock works now, if you …
The way the edit lock works now, if you close your browser with the post open, the lock will stay in effect until it times out. Might it not be better if we shortened the edit lock time to something like 120 seconds and kept it locked via an XHR every 90 seconds that the edit screen for that post is open?
Denis de Bernardy 5:25 pm on July 22, 2009 Permalink
That would be nice, yeah.
Andrew Ozz 7:21 pm on July 22, 2009 Permalink
It’s currently renewed with the autosave XHR every 120 sec. Don’t think we need another AJAX specifically for the post lock, perhaps will be better to add something onbeforeunload that will remove it when the user navigates away or closes the browser (of course the “remove lock” XHR will not be sent when saving the post).
Mark Jaquith 7:36 pm on July 22, 2009 Permalink
Yeah, that could work. Are onunload XHRs fairly reliable?
Andrew Ozz 7:41 pm on July 22, 2009 Permalink
Will have to test that more but the browser waits until “true” is returned to proceed with the unload (it’s not a typical DOM event), so don’t think there will be a problem sending the request.
Aaron D. Campbell 8:44 pm on July 22, 2009 Permalink
If it’s already renewed every 120 seconds, couldn’t we just set the lock to expire in 150 or 180 seconds?
Mark Jaquith 9:49 pm on July 22, 2009 Permalink
Could do that in conjunction. I was going to suggest this as well, as a sole mechanism. But where this issue is a problem is on very active blogs with a lot of contributors. On such blogs, even with a maximum lockout of 2.5 minutes, they could run into it a lot.