[–] 1 point 2 weeks ago (1 child)

My understanding is that CRDT is for the offline scenario and doesn’t have conflicts with the way it resolves. It is also a completely decentralized algorithm.

If you need real time, I think you can use (slightly) simpler algorithms like operational transform (OT) where the server can synchronize state. OT might be viable for offline as well… I am not an expert.

Optimistic locking, pessimistic locking and last-in-wins would be the more näive strategies and maybe ok acceptable for real time, but would be terrible for offline.

  • source
  • parent
  • context
  • [–] 1 point 2 weeks ago (1 child)

    On the collision aspect of the multiplayer setup, if the collision is within 1/2s of each other as an example, have you considered undoing both players moves with the same message, collision detected? That might make it a bit more fair.

  • source
  • parent
  • context
  • [–] 5 points 2 weeks ago (2 children)

    Same conclusion here from the other side, I have a small multiplayer browser game where everyone paints cells on one shared grid (node, postgres, SSE), the client applies the paint right away and the server either confirms it or answers with a 409/429 and the client puts the old cell back. the rejection part is the one that took me longest honestly, a mutation that is valid locally but the server says no (out of charges, same color already there, world paused) and you need a different message for each, otherwise people think it's lag. conflicts are just last write wins per cell, but that works because every write is a row in an append only events table, so nothing is really lost and you can replay or undo. and on reconnect I don't try to merge anything, the client asks for the whole state again, at that size it's cheaper than being clever.

  • source
  • [–] 5 points 2 weeks ago (2 children)

    If you need real-time, you can read about CRDT (Conflict-free Replicated Data Type). But for offline, you cannot ignore conflict so one way or another, you would need to ask user which data to keep or warn ahead of time that the latest write win while maintaining an audit log on the server. That's what I do for my in-house ERP. The client has a local copy of the data and is free to edit anytime.

  • source
  • [–] 1 point 3 weeks ago

    leaderboards are a good example: each row has a primary action (open it) and maybe a secondary one, and rows reorder live. Today it's either listbox, with selection semantics you don't want, or a list of buttons with nested buttons. focusgroup="list" sounds like the right shape. Does anyone know how it would handle live reordering: does focus follow the item or stay on the position?

  • source
  • [–] 1 point 3 weeks ago

    For me the evidence was the server logs, filtering by user agent. my main page is basically a canvas game, so the html has almost nothing for a crawler, and I was surprised to see googlebot not only rendering it but opening the SSE stream like a real player (I noticed because bots were showing up as online players lol). what actually got indexed were the plain server rendered pages I made for each thing worth sharing, with title, og image and json-ld, listed in the sitemap. so I didn't change the app rendering, I just gave crawlers simpler pages to read.

  • source
  • [–] 1 point 3 weeks ago

    We are moving to shorter certificate lifetimes because this reduces the risk of key compromise and mis-issuance. As a nonprofit we see it as part of our mission to make this change to advance security for everyone using the Web globally.

  • source
  • parent
  • context
  • [–] 2 points 3 weeks ago

    As a beginning web application dev (I know django and some js, am little baby dev), would it be worth looking into preact instead of industry standard tools like react? Am I asking the wrong question?

  • source
  • [–] 2 points 3 weeks ago*

    Interesting read. Many web applications today rely on client-side rendering, which can perform poorly. Why should users wait several seconds for a page to download, only to wait several more while it renders? In my case, I often have to enable JavaScript and reload the page because I block unknown JavaScript by default.

    Another problem is when a web app aggressively probes for information such as installed extensions, as LinkedIn does. That can make the site laggy and practically unusable. But I suppose we could consider that malware anyway.

  • source
  • [–] 4 points 3 weeks ago

    Ugh, I must not be the only one who finds maps with clustered pins hard and disorienting to use. I understand the data savings, but I'd rather like being able to see at a glance if there is anything in the area of interest without zooming in 20 times.

  • source
  • [–] 3 points 4 weeks ago

    I still like bootstrap so I'm happy it's being modernized.

    The main issue with Bootstrap was that a lot of sites used it with the default theme, but it's highly customizable so you can apply your own styling and brand colours to it to make it unique.

    Shadcn has the same issue today - a lot of people just use its default styling, so often you can instantly tell a site is using it.

  • source
  • view more: ‹ prev next ›