-
-
Notifications
You must be signed in to change notification settings - Fork 877
Hot fix for #1237 and #1202 #1256
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
Hot fix for #1237 and #1202 #1256
Conversation
…or. 2. If there is a new object in OfflineStore, should not send the exception when the saved object update its OfflineStore cache
@ananfang thanks for the PR, PFPreconditionFailOnError doesn’t exist I’m not even sure how it compiles, can you revert to PFPreconditionFailOnError? This seem unrelated to that PR. |
@flovilmart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try it, let's hope it doesn't yield any corruption issue.
@flovilmart This hotfix is just a workaround, the actual problem is SDK assigns twice (or more) objectId to newly saved object. The first time objectId is assigned, |
DO you have some code that reproduces the issue? |
Followings are my scenario:
It will not always crash, about 50/50. |
Are you saving/mutating the received messages from liveQuery?
…On Feb 8, 2018, 06:30 -0500, ananfang ***@***.***>, wrote:
Followings are my scenario:
1. A chat view with two users.
2. Use ParseLiveQuery to listen messages created.
3. User sends message as a PFObject, save it by saveInBackground() method.
It will not always crash, about 50/50.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
No, I don't mutate messages from LiveQuery |
Would you be able to share a demo project that reproduces the issue? I believe it’s related to liveQuery |
+1 |
Run and tap "Add Message" button, it will crash all the time by "Attempted to change an objectId to one that's already known to the Offline Store" |
I found a PFObject Equality bug comes from my "isNewlySaved" workaround. Following is scenario:
Thus, DO NOT use my "isNewlySaved" workaround. Instead, we should find out why Parse / LiveQuery assign the new objectId into two (or more) different objects. |
Ok so basically, creating and receiving an object through liveQuery will yield the issue. I need to either update LiveQuery or make sure the liveQUery received objects are treated the same as the ones fetched. |
Yes, you can try this Chat demo project |
@flovilmart I found you already fixed it in release 1.17.0, I'll check if there is any new issue. If there is, I'll open a new one, thanks for your effort. |
Thanks! Please use the |
1. Fix typo PFPreconditionFailOnError and PFPreconditionFailAndSetError.change the assert condition in function
- (void)updateObjectIdForObject:oldObjectId:newObjectId:
of PFOfflineStore.m