You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user creates a Commit and sends this to the server, the server might confirm this and send that same commit back through websockets. This could cause a previous state to overwrite the current state.
Ideally, commits are ignored by the client if they are already applied. I think we could store in Resources which commit has been applied.
Store a Set of applied signatures
A simple solution, which should work just fine for the issue mentioned here, but there is a more elegant approach.
Always check 'previous commit' signatures in Commits before applying
Resources can store their previousCommit, which is the last applied signature. We should also include these in every Commit, so it's clear what the state was of a resource before committing.
If the client receives a commit with a signature that is the same as the previousCommit found in the local Resource, we can ignore it. If the received Commit's previousCommit matches the previousCommit, we can apply it. If they differ, the Client should check whether the commit has been applied before (if it exists in the set). If it does not, and the previousCommit does not match, the client has come out of sync, and needs to re-fetch the Resource. This resource should then contain a previousCommit.
The text was updated successfully, but these errors were encountered:
When a user creates a Commit and sends this to the server, the server might confirm this and send that same commit back through websockets. This could cause a previous state to overwrite the current state.
Ideally, commits are ignored by the client if they are already applied. I think we could store in Resources which commit has been applied.
Store a Set of applied signatures
A simple solution, which should work just fine for the issue mentioned here, but there is a more elegant approach.
Always check 'previous commit' signatures in Commits before applying
Resources can store their
previousCommit
, which is the last applied signature. We should also include these in every Commit, so it's clear what the state was of a resource before committing.If the client receives a commit with a
signature
that is the same as thepreviousCommit
found in the local Resource, we can ignore it. If the received Commit'spreviousCommit
matches thepreviousCommit
, we can apply it. If they differ, the Client should check whether the commit has been applied before (if it exists in the set). If it does not, and the previousCommit does not match, the client has come out of sync, and needs to re-fetch the Resource. This resource should then contain apreviousCommit
.The text was updated successfully, but these errors were encountered: