Open enikao opened 5 months ago
This is not something we should say anything about in LionWeb, clients can internally do what they want. It is however interesting to look at the scenario's and see which ones can be (or do we want to be) supported by the (delta) protocol.
I feel the difference between B and C is anyway quite small, although C is probably closer to the CQRS way of thinking. (See also https://github.com/LionWeb-io/specification/issues/271#issuecomment-2120051220) In that vein: a client is probably making its own life easier if all changes are a result of an event, in which case correcting the state is a matter is replaying a sequence of events from a base state/snapshot.
Instead of a "correct" from the repo, the repo can also "reject" a change, as in optimistic locking.
Instead of a "correct" from the repo, the repo can also "reject" a change, as in optimistic locking.
I'd prefer to keep locking out of this discussion.
I'd prefer to keep locking out of this discussion.
Indeed! I should have said that the repo can reject a change, just like it can reject a bulk api change.
Indeed! I should have said that the repo can reject a change, just like it can reject a bulk api change.
It only does that to avoid inconsistent trees, correct?
Yes, that is the only valid reason I see.
(Preliminary) decision on 2024-06-21: E
Rationale: tbd
Assume an editor client changes property
x
of nodey
toz
, because the user initiated that change. When does the client apply this change to its internal model representation?A Directly on edit
The client considers
z
to be the real value ofy.x
immediately.Pro:
Con:
B Directly on edit, repo might correct
The client considers
z
to be the real value ofy.x
immediately, but should consider the repo sends corrections.Pro:
Con:
C Tentatively on edit, with confirmation/correction from repo
Client considers
z
to be the "dirty updated" value ofy.x
. Only after the repo replied the client knows the real new value.Pro:
Con:
D Only after repo confirmation/correction
Client only changes its internal representation after the repo replied.
Pro:
Con:
E Out of scope
Each client can decide on its own. LionWeb has no expectations.
Pro:
Con: