arj03 / ssb-browser-demo

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

If viewing a Thread and we don't have the root, fetch it #284

Closed KyleMaas closed 3 years ago

KyleMaas commented 3 years ago

Related to #283, if you click on a thread where you don't have the root but you're looking at it in Thread view, it would be an awful lot more user friendly to just fetch the root message with getOOO so there's some context there rather than just starting the page out with an error message.

KyleMaas commented 3 years ago

Evidently this one is no longer a problem. When a thread tries to render, if the message is not in the database, this runs:

https://github.com/arj03/ssb-browser-demo/blob/1642c8fb12bbf119ac58aab91d3802de4c50a827/ui/thread.js#L214

Which calls this:

https://github.com/arj03/ssb-browser-demo/blob/1642c8fb12bbf119ac58aab91d3802de4c50a827/net.js#L65

Which means that when viewing a thread you don't have the root for, a tangle is replicated for it, and everything works exactly as you would expect.