Re:Downsides of Offline First
by TeMPOraL on Friday October 01, 2021 @07:45PM
(#28724663)
I know nothing about CRDTs, but I feel the ultimate problem with your invoice example might be a representation issue.
> edit A sets an invoice status to paid, edit b changes the invoice amount from 100 to 120. The merge is a paid invoice with an incorrect amount.
There is no such thing as "paid status" of an invoice. That's a simplification. If you unroll it, what you get is accounts that must balance. The invoice starts with "accounts payable"[0] set to 100$, and no payment covering it. Edit A adds a transaction from company account to AP to the value of $100. Edit B changes the liability in AP to $120. The result of a merge should be a transaction record for $100 and liability of $120, meaning a partially-paid invoice.
--
[0] - Or whatever it is called, I keep getting confused by this terminology, as it's not something regular people use in my part of the world.
> edit A sets an invoice status to paid, edit b changes the invoice amount from 100 to 120. The merge is a paid invoice with an incorrect amount.
There is no such thing as "paid status" of an invoice. That's a simplification. If you unroll it, what you get is accounts that must balance. The invoice starts with "accounts payable"[0] set to 100$, and no payment covering it. Edit A adds a transaction from company account to AP to the value of $100. Edit B changes the liability in AP to $120. The result of a merge should be a transaction record for $100 and liability of $120, meaning a partially-paid invoice.
--
[0] - Or whatever it is called, I keep getting confused by this terminology, as it's not something regular people use in my part of the world.