-
-
Notifications
You must be signed in to change notification settings - Fork 878
Pinning PFObject with pointer corrupts local datastore #535
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
Comments
digging a little deeper, it appears that first pin is not even done correctly, and that the bug is in pinning objects with pointers. After just saving a single Comment pointing to a Post, the sqlite database contains this data:
The second pin (7A2C3F1F...) appears to include the Comment (8F91E10D...) in it's list of objects, but not the Post it points to (9DD18DC7...). Although maybe I'm not fulling understanding how pinning is implemented. In the documentation it states: "Pinning a PFObject is recursive, just like saving, so any objects that are pointed to by the one you are pinning will also be pinned. " |
This seems related to #239, though I don't have the slightest clue what could be causing this. LocalDataStore is a very complex beast. and it's very possible there exists a pointer encoding bug there. I'll look into it. And - thank you for the super clear repro case, it makes investigating this super easy. |
OK, thanks. It looks like explicitly pinning referenced objects is a good workaround for now. |
Hi, |
I have this problem too and I am already pinning with specific names. My object contains pointers that have pointers to other objects. When I initially pin them, they save correctly. But if I pin another object of the same type, they are all removed, and querying the local datastore returns nothing. |
Hi, |
Same issue here. |
same issue here, really need a solution for that |
Any update on this issue? |
+1 |
1 similar comment
+1 |
I'm sad with Parse local store. I need to finish an App ASAP and its very danger to persist my objects to sync later. Now I'm trying to implement my offline storage with IBM Cloudant or RealmSwift constructing a bridge on models to sync with Parse when data is committed. Please, could someone have another idea or its a good start? |
Can you at least give us some info? |
+1 |
This is killing me |
I rember what fixed this for me! The problem was that I was pinning an object where some of the data hadn't been fetched. That resulted in a completely null object. So try fetching every referenced object first, and fetch the object itself, and then pin. Print out the data first to check its all there. If any object or pointed object doesn't contain data, the pin will result in a null ref. |
Thanks for the suggestion, in the end it was me doing it wrong - I was including some objects in a query and not pinning all of them. |
This fixed it for me, which is maddening as the documentations says...
– https://www.parse.com/docs/ios/guide#local-datastore-pinning Is a Pointer not considered "pointed to"? Strangely pinning an object with a property that is an Array of Pointers seems to be working fine. I guess I should check the documentation for the OSS codebase as well. |
any news on this? I'm getting the same error... I have includeKeys on both server and offline queries. The local queries work fine on the beginning, but then when I pin or unpin some objects "withName", and redo local query, I get this error. "This object is not available in the offline cache." |
Same issue here. It's a terrible experience when user's data is gone. |
I've put some more work into this... I'm not sure if I found a replicable pattern, but it seems like every time I pin objects back to the database, local queries work again... in my specific case, this happens:
Well, I'm still waiting for a solution. :) |
@ferrinho @wimbledon @rob5408 @Zwerge Are any of you still experiencing this issue? |
Anyone still dealing with this? |
Me , Horrible freaking experience , This object is not available in the offline cache is my error. |
I am having similar issues with pin to local store. In one case, I read records (with pointers) from DB, and then put them into a local set. When two distinct records bear the same logical (in business) IDs, they would count equal in the data set, and one would be discarded. This discard would ruin the local store, and subsequent query would report error saying "not available in offline cache". I removed this duplicate record (in business, not data sense), then local query starts working. This shouldn't be this fragile. Another case I am debugging is pinned data (with pointers, if that matters) missing from data store, even do query immediately after pin. This doesn't always happen, but sure frustrating when it does. BTW, I am using parse-ios-sdk 1.17.3. It looks I need to find a replacement for local storage, to not lose customer data. Any suggestion would be appreciated. |
Had the same issue. Before get any field from the pointer call: I pinned before do that. Not know directly with network. |
Tested on version 1.9.1. If an object C1 pointing to P1 is pinned (and not saved), then an object C2 pointing to P2 is pinned, P1 is corrupted in the datastore. This seems to be the minimum condition to reproduce:
The query fails with this error:
Looking at the sqlite database, it is apparent that the data has been corrupted (nulled out), which results in queries on the corrupted data always failing.
The text was updated successfully, but these errors were encountered: