Damus
Yusuf al-Texani · 2w
This client is really clean. I like how I only see posts/replies/likes once they've actually gone through to a relay, unlike other clients which will show them instantly client-side. I've had a couple...
alp profile picture
Thanks.

Yeah, that's called an optimistic UI update, sometimes also optimistic rendering or optimistic concurrency.

The pattern goes like this: The client assumes the operation's gonna succeed and shows the expected result right away, before any confirmation comes back from the server, like a zap receipt from the Lightning node or relay, for example. If the confirmation doesn't show up later or it fails, the UI state gets rolled back.

Basically, you assume everything's gonna go fine and show the user the result immediately. It works out in like 99% of cases anyway. But I only use this technique for zaps. Everything else is the real deal.
Karadenizli · 2w
I believe amethyst and many other clients actually just run a local relay. They hold a local database of posts, and all read requests are first synced to the local database. Then when you publish a note, it gets sent to the local relay like all the others, that's why it shows up in your feed immedia...