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

Out of sync when following specific workflow #272

Closed
jphribovsek opened this issue May 21, 2014 · 3 comments
Closed

Out of sync when following specific workflow #272

jphribovsek opened this issue May 21, 2014 · 3 comments
Assignees
Labels
Milestone

Comments

@jphribovsek
Copy link

This problem can be replicated 90% of the time with our app:

  • Two devices: one iPad and one iPhone
  • We use our own simperiumKey for the objects we create to prevent duplicates
  • Both devices online, we open the app on both devices
  • We then place the iPhone in airplane mode
  • On iPad, we insert an object to the sync bucket (insert on core data)
  • On iPhone, while offline, we insert the same object (same simperiumKey as one inserted on iPad), we then delete that object, still while offline
  • We bring the iPhone back online

=> Expected: based on the flow, we expect both devices to have that object deleted. At the very least, we expect the same state on both devices

=> Actual: object is deleted from iPad when iPhone comes back online, but inserted back on the iPhone. Both devices are then out of sync. Killing the app and restart does not fix the out of sync state

I am sending you the logs

@jleandroperez
Copy link
Contributor

@jphribovsek hi there!. May i ask you to please verify if this is still happening on your end?.

I've added a couple integration tests to replicate, and everything looks good now.

For future reference, full scenario below:

1. iPad sends Object X Add  (Object X has a custom simperiumKey)
 2. iPad receives Object X Add-Ack
then...
3. iPhone Adds + Deletes, while offline, Object X (which has the same key as (1)
4. iPhone goes live. Before posting the pendings (just the DEL), it receives the insert from the iPad
5. iPhone effectively inserts the iPad object, and sends the deletion
6. iPad receives Object X Deletion change
7. iPhone receives Del-Ack, but the object doesn't get re-nuked.

I've updated step (7) so the logic doesn't just check if it's an ack, and instead, uses the actual CoreData status.

jleandroperez added a commit that referenced this issue May 23, 2014
@jphribovsek
Copy link
Author

verified to be working, thanks!!

@jleandroperez
Copy link
Contributor

Thanks for the feedback @jphribovsek, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants