Description
Hi there,
I am in high demand for a realtime locking solution so I went on giving ably a try. I've been using channels previously, which works ok as long as I don't rely on events but continuously run certain checks (e.g. with requestAnimationFrame or requestIdleCallback). I also moved away from using the react integration because error handling is really badly implemented!
I thought I'd give spaces a chance but already after a few nights playing with it, I'm facing inconsistent situations with a probability of at least 10 to 20%. After I simulate connection issues, locks are not properly being released on all clients and I can even kind of reproducibly trigger situations where more than one client holds a lock for the same id.
The internals of the SDK reflect an inconsistent state. Even though, my clients reconnect and I'm not maintaining state information about locks but instead always call the getAll
, getOthers
and getSelf
methods as described in the docs, the SDK instances seem to hold outdated and invalid data. They don't update unless I re-acquire and release the within a client that carries the correct state or disconnect a client so that certain updates seem to be triggered.
Am I doing something wrong? Or is version 0.4 (internally) known to be unreliable?
Ably could be such a great product for far more than 500 customers, if only developer experience would be improved.
I attached a screenshot. You would certainly need the sources to understand what's going on. But it's the exact same application, running in two different tabs, using the public api key, a client id generated with crypto.randomUUID() and nothing fancy but a few react components and a singleton class handling ably realtime with members and locks and a store that can be used in combination with react's useSyncExternalStore
. And it shows that each client holds a lock for id dummy1
. Members shows self and others and the Lockable Item's purpose is to provide two buttons for lock/unlock.