https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    brainy-machine-50829

    11/10/2019, 11:17 AM
    Yes, that's the simple part of it.
  • b

    brainy-machine-50829

    11/10/2019, 11:18 AM
    Complex were things like you changing a row, then someone deleting it, then both you and him undoing it.
  • b

    brainy-machine-50829

    11/10/2019, 11:18 AM
    Honestly, I've spent over a month just designing how it should work. And since then I've thought back as to why it ended up being so difficult, and I don't know.
  • b

    brainy-machine-50829

    11/10/2019, 11:20 AM
    The main issue came from requirement that editing needs to affect local copy immediately.
  • b

    brainy-machine-50829

    11/10/2019, 11:20 AM
    So the client waited on confirmation for changes, but meanwhile there might come other changes.
  • b

    bright-gpu-74537

    11/10/2019, 11:21 AM
    yeah, defo sounds like alot of edge cases there for sure
  • b

    brainy-machine-50829

    11/10/2019, 11:21 AM
    So you have local copy X -> A_X. Some other user has local copy X -> B_X. Server receives both, and doesn't have an issue with it, last edit holds. But the clients are problematic.
  • b

    brainy-machine-50829

    11/10/2019, 11:22 AM
    Say B was last. A will receive confirmation, then B_X value. Alright. For B it's the opposite order.
  • b

    brainy-machine-50829

    11/10/2019, 11:22 AM
    Now if B, or A press undo, different things need to happen. Namely B needs to revert to A_X, not X. Even though it didn't know about A_X when it did the change.
  • b

    brainy-machine-50829

    11/10/2019, 11:23 AM
    And the undoes and stuff are also instant "client local", so I can't just let server deal with it.
  • b

    brainy-machine-50829

    11/10/2019, 11:23 AM
    I need to know that if a change came in, and before confirmation, I need to edit my undo-redo queue.
  • b

    bright-gpu-74537

    11/10/2019, 11:24 AM
    yeah, the undo is defo problematic there
  • b

    brainy-machine-50829

    11/10/2019, 11:24 AM
    And iirc this was a simple problem to solve. There were some pretty complex edge cases where clients ended up with different local state. But for the life of me I can't remember what they were. Even though I have like 20 pages of design notes. 😄
  • b

    brainy-machine-50829

    11/10/2019, 11:25 AM
    I think I could do a much better job at it now. Would probably rather do a deep dive into Operational Transformation algorithm.
  • b

    brainy-machine-50829

    11/10/2019, 11:26 AM
    But mainly currently backups are pretty hacked in. DB is SQLite, I'm replicating it via SymmetricDB, which is a pain in itself.
  • b

    brainy-machine-50829

    11/10/2019, 11:26 AM
    Setup and installation was a bit ugly. And now they have some security concerns and would like a few changes, none of which are easy with how it is now.
  • b

    brainy-machine-50829

    11/10/2019, 11:27 AM
    Changing to some web based UI (with possibility of native clients being super sweet), DB being proper one with better realtime backup system. Stuff like that...
  • b

    bright-gpu-74537

    11/10/2019, 11:29 AM
    well, all sounds pretty interesting - and complex - im esp. interested in the client sync issue - love stuff like that 😄
  • b

    brainy-machine-50829

    11/10/2019, 11:29 AM
    I have notes about 3 different approaches, but I never marked down what edge cases they were.
  • b

    brainy-machine-50829

    11/10/2019, 11:30 AM
    I just know it was all super simple "last edit stays", until I started thinking about undo.
  • b

    brainy-machine-50829

    11/10/2019, 11:30 AM
    Server was simple enough, no concurrency there. But clients, meh...
  • b

    bright-gpu-74537

    11/10/2019, 11:30 AM
    it sounds like its the undo that screws things... if A undoes their changes, what do you undo to? B's change? Or the data before A made a change?
  • b

    brainy-machine-50829

    11/10/2019, 11:30 AM
    Exactly. It all depended on local state, which was unknown to other clients.
  • b

    bright-gpu-74537

    11/10/2019, 11:30 AM
    arguably the correct thing to do is to undo to B's change... but that will look strange to A
  • b

    brainy-machine-50829

    11/10/2019, 11:31 AM
    Which is the core issue, doing something that depends on something only you have, in a way that results in the same result for everyone.
  • b

    brainy-machine-50829

    11/10/2019, 11:31 AM
    A adds a row. B edits it. A removes it, then undoes that.
  • b

    bright-gpu-74537

    11/10/2019, 11:31 AM
    yeah... can of worms there
  • b

    brainy-machine-50829

    11/10/2019, 11:32 AM
    That's what server receives, but think of all the possible states the local clients can be, depending on the ordering of messages coming from server. Any client might lag for a while, can't depend on the order at all.
  • b

    bright-gpu-74537

    11/10/2019, 11:32 AM
    indeed
  • b

    brainy-machine-50829

    11/10/2019, 11:33 AM
    I remember I ended up writing test suite that did some basic operations and then tested all permutations of confirmation message order.
1...136137138...1687Latest