arj03 / ssb-browser-demo

A secure scuttlebutt client interface running in the browser
Other
58 stars 11 forks source link

Add last updated information to connections #246

Closed KyleMaas closed 3 years ago

KyleMaas commented 3 years ago

Adds information to the connections list to show when a connection last received an update.

Interestingly, this also allows you to see how long it takes for the receive queue to flush to the database and be indexed, since if you pull a large batch of data (follow someone with a lot of followers you don't already replicate), you can see the last updated change quickly and then watch the profiles fill in on the progress bar as they complete indexing.

Fixes #141.

KyleMaas commented 3 years ago

I should note that this should work without the latest change to ssb-browser-core, but for better results, it should be used with a version of ssb-browser-core which includes https://github.com/arj03/ssb-browser-core/pull/30

arj03 commented 3 years ago

One question, does the timestamp also update even if no data is coming through, I'm guessing the default ping/pong will update this ts as well?

KyleMaas commented 3 years ago

The ts value from EBT is only updated when a message is received. I have no idea where the peer hubUpdated and stateChange timestamps come from. But that's why I set the text as "Last update received" rather than "Last synced" or "Last talked to the server". It's a reflection of when we actually received updated information from that peer.

arj03 commented 3 years ago

Thanks, created a new version of core that I will be pushing up now.

KyleMaas commented 3 years ago

Perfect. Thanks!