Post

This feature seems to be a bit buggy. When I opened the page -> npmx.dev/package/svelte a few minutes ago it showed 20 likes. Then I logged in and liked it -> 21 likes. Then I checked with another browser (no login) -> 17 likes. Then I hard reload all pages in all browsers -> 14 likes. 🤔

Thinking about this, I also wonder how spam resistant this feature is. E.g. a rogue PDS (or fleet of PDS) sending a few hundred/thousand fake accounts with like records/events out. Of course this is also possible and happening in e.g. GitHub, but maybe at a different scale (relative).

If done right this spam attack will be way below what rate limits enforce and probably also below other automated spam detection mechanisms, as it takes only a comparable very small amount of likes to majorly skew this metric.

Also small update to OG problem: There is a bit of a lag/cache issue. Liking and removing a like seems to work as advertised at least from the PDS point of view (records get created/removed). But the website "jumps" back and forth showing those likes, e.g. a fresh like gets reset and vice versa.

The red indicator if the like is present on the PDS works correctly, this "jitter" only affects the shown like count. I know it's alpha and just a day old etc :)

This may be a hard problem. Even GitHub has solved this only partially. Their like count always drift from what is shown in the header line of repository (likely heavily cached) compared to the like count shown in the right side bar (able to change when the like count with a like).

Update to the update: It seems this problem got fixed 🎉, I see not "jitter" anymore. Though there was the intermittent problem that my likes did not work anymore (no record written to my PDS). Only after I logged out and logged in again liking/disliking worked again.

0 reposts1 like

Other services often hard logout when they detect an error (e.g. write failed), as from that point on the internal state of the browser thinking it is logged in and can write is not valid anymore. Maybe this is a (bit annoying sometimes) compromise?

Such hard logout behavior may also make it easier to detect problems and bugs, as this should not happen often, obviously.

Glad to hear like it fixed itself! It’s pre alpha so going to be some bugs 🫠. I had a pr that merged about the time they got fixed and the old cache probably expired. Still hammering out our oauth and refresh’s are iffy sometimes