-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server-side JSON-Patch OT #453
Comments
Unfortunately only Christian is/was fully familiar with how this stuff works and is supposed to work. So it is not entirely trivial answering questions about it. Not sure if Joachim was involved in this as well but if so it was a while ago. He also started up a rewrite of it is but he didn't get very far. (if you lack access to it is a little disabled code riddled with TODOs, so it is probably not all that useful). So it is probably quite a large project cleaning this up. And for me it is not entirely clear on how to approach this. Up to @erikvk though. Let me know if and how I can help. |
As far as I remember from discussions with Christian, this feature was never implemented, and it's lack was hitting us every now and then. |
Christian also told me that there is a way to setup server side JSON Patch applicator to ignore patches to non-existing objects instead of crashing, but now I was not able to find how to use that feature, maybe it's only available internally in Level1/XSON. |
The roadmap https://github.com/Starcounter/CompanyTrack/blob/master/Roadmap/Roadmap.md considers long and short-term solution to the lack of this feature. @dan31, @eriohl do you remember what is the short-term solution that is meant there? I think the only way to fix this is to implement the actual transformations. It should not be super hard, given that we aleady have a reference implementation in JS: https://github.com/Palindrom/JSON-Patch-OT-agent |
I don't remember discussing that part nor do I understand how to short term fix it given that there isn't any OT there to fix. But maybe it is possible just to use the existing implementation given that is is possible to embed Node.js in .NET? It requires no input other the patches right? |
Just patches (with/and version numbers), JSON tree is not needed. |
On Thursday 11th April @eriohl @erikvk @dan31 and me had a meeting to gather common understanding of current implementations and plan the architecture and the way to go with the new server-side implementations. I'd like to write down some highlights from the meeting.
Please correct me, if I wrote something wrong or missed something. |
@tomalec Thanks for the writeup! |
Archiving. |
Starcounter version: 2.4.999.191
Issue type
Issue description
During investigation of HeadsOne issue (fast clicking on create button) https://github.com/Starcounter/HeadsOmni/issues/665#issuecomment-440784899
from reading the Starcounter.XSON code I figured out (I'm not a pro in C#, so please, tell me that I'm wrong) that we do not transform JSON Patches against JSON Patches on server-side - meaning we do not have JSON Patch Operational Transformation (OT).
Handle
- when we apply patch to the JSON tree,OT - Operational Transformation - is about transforming operations not the object. That's what makes it fast and simple.
Reproduction code snippet
Send two, separate but consecutive Web Socket messages from client(browser), that changes a property in JSON view-model.
Server-side of an app should remove the modified object in response to the first message:
Expected behaviour
Server-side JSON Patch OT, should transform
C2' = C2 ∘ S1
regardless of JSON tree.Actual behaviour - Exception stack trace
Related issues:
//cc @warpech @eriohl @erikvk @alshakero
The text was updated successfully, but these errors were encountered: