Skip to content
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

Implement applyDiff Error Handling #291

Closed
3 tasks done
jleandroperez opened this issue Jun 9, 2014 · 1 comment
Closed
3 tasks done

Implement applyDiff Error Handling #291

jleandroperez opened this issue Jun 9, 2014 · 1 comment
Assignees
Milestone

Comments

@jleandroperez
Copy link
Contributor

We've received a report of an entity getting stuck, and not receiving changes from other devices.

Luckily, we got access to the internal .sqlite file. The internal ghostData is in sync with the backend, while the contents of the member are not.

  • Implement a Unit Test to recreate the scenario in which the entity has local changes, a remote diff gets received, and in the exact meantime new changes are introduced.
  • Make sure that SPChangeProcessor.processRemoteModifyWithKey method is not allowing for scenarios in which the local-changes-rebase code doesn't run, afterwards new changes get introduced, and applyDiff fails.
  • If applyDiff fails, we should:
1. Request the full entity
2. Calculate Delta: LocalGhost > LocalMembers
3. Load the full Remote Member Data
4. If the delta from step (2) is not empty, then let's attempt to rebase + apply localDiff
4.1. Calculate Delta: LocalGhost > RemoteMembers
4.2. Transform localDiff: LocalGhost >> RemoteMembers >> LocalDiff (equivalent to git rebase)
4.3. Attempt to apply the Local Transformed Diff
5. Update the ghost with the remote member data + version
@jleandroperez
Copy link
Contributor Author

This issue has been solved in this pull request

jleandroperez added a commit that referenced this issue Jun 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant