Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some systems lock records while users are viewing them, so it can be helpful to send a request that unlocks the record when the user leaves the page.



What if they just close their laptop lid, or the browser crashes? You can't reliably detect when a user leaves with this method, so you _cant_ use it for anything critical


sure you can, if you combine it with a timeout and/or a way for users to break a lock (and then of course, blocking the original user's session if he comes back anyway)

at least you don't have to wait for the timeout to expire if the user properly closed the application/website, which happens most of the time


Doing resource-locking client-side authoritative sounds like a security issue.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: