perrycate / p2ping

Peer-to-peer latency tester.
https://p2ping.web.app/
GNU General Public License v3.0
3 stars 0 forks source link

Delete data in firestore when no longer needed #11

Closed perrycate closed 4 years ago

perrycate commented 4 years ago

A nice way to reduce db usage without having to do it manually.

perrycate commented 4 years ago

https://stackoverflow.com/questions/13443503/run-javascript-code-on-window-close-or-page-refresh is nice. If we delete it then (as opposed to when the connection is established) then the data would get cleaned up whether a connection was actually made or not.

I wouldn't be surprised if there are circumstances when said cleanup code doesn't run (browser crashes, internet disconnects, whatever), but if it usually runs, that's good enough for me. It's not like we're storing a ton of data, if I need to clean it up manually once every couple of months (until I get lazy and make some better solution), so be it.

perrycate commented 4 years ago

Fixed (for now) by 078c783bfc1779f3e5be91e20f4451712edcac4c