-
-
Notifications
You must be signed in to change notification settings - Fork 876
PFEventuallyQueue sync #1181
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
I use the Reachability framework so that the app can respond to the loss of network and return of network. If the reachability listener reports a network status change it can push a notification that other parts of the app can listen for and respond to. In your case when your reachability instance reports return of network connectivity you could force the necessary sync. |
@ayoze the PFEventuallyQueue is actually listening for reachability changes, if you look at the code you’ll see by yourself. What you describe is probably a bug. I’ll check it out. What version of the SDK are you running? |
Yes @flovilmart, I've seen that in the code, but not sure why it is not working. The SDK I am using, from cocoapods is: Parse (1.15.1) |
can you try the 1.15.2? |
@flovilmart same behavior. The app is now like in a "hold" state. If I disconnect from wifi, I can see the new object. If I connect, it disappear immediately. When I close (kill) the app and reopen, it syncs and everything works as expected. |
@flovilmart just trying to put some light here... in PFReachability.m:
any ideas? I think the |
So you’re using the local data store, with saveEventually right? |
I'm looking into it. |
@brianyyz it's already internally wired up for that. |
@ayoze can you try the branch that I just pushed, this should be all good now :) |
Thanks @flovilmart - I'm updating apps so I'll look at moving over to PFEventuallyQueue ! |
many thanks @flovilmart ! It seems to be fixed but if you don't mind, let me make some more testing, ok? I will open another issue with a different local datastore related problem :/ |
@flovilmart it seems the PFEventuallyQueue is terminated for any reason at start. I think the problem is in the method ParseManager::eventuallyQueue... the CommandCache queue is terminated at the application start so no other commands can be enqueued (I have not researched if the command queue is created again if needed, sorry). |
We terminate a queue that is useless and it prevents a retain cycle, as far as I know, the queue that gets terminated is not references outside the scope of eventuallyQueue, so there’s no way it can be useful. The only queue you should have in memory is the PinningEventuallyQueue AKAIK. |
I’ll still look into the lifecycle of the PFCommandCache. |
Another strange thing happening in the same object I talked before (HorarioFranja).
This method unpins the object from LDS and then do a delete (eventually if no internet access is recognized, delete directly otherwise). The point is that when I call this method (without internet connection), the object is removed from the database, but instanly after that is reinserted. I don't know how this happens but I can see the list without the object, and when I reload it, the object is again there. |
My pin-and-save method, if needed:
|
In your unpinAndDelete, is it the delete eventually that add to the store as deleted? |
Hmm I don't understand... what do need me yo test? Is the unpin method
needed or the deleteEventually also unpins if the object is in the LDS?
El El mié, 6 sept 2017 a las 16:50, Florent Vilmart <
notifications@github.com> escribió:
… In your unpinAndDelete, is it the delete eventually that add to the store
as deleted?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1181 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABYoj1-msGOlSHT1e3OfQmlyRuC3HlSkks5sfrFCgaJpZM4PM743>
.
|
I believe deleteEventually is re-pinning your object for some reason, can you try remove it? |
Hmmm even stranger: when I remove the deleteEventually, the object is not removed at all in the first load nor in the second. Like if the unpin is not working... |
Would you be able to write a test and open a PR with this failing test? |
Well, I'm not much into unit testing :( If I can provide more information... Does anybody know any way I can bypass this bug? I just want to pin+sync and unpin+sync objects! |
it's never too late to get started, the project has a high coverage of many use cases, and that would really help debunk the issue as I have trouble understanding your whole flow. writing a test would really help isolate the issue. |
Hello,
I am using Parse in some of my offline-online projects (apps which needs offline information storing and syncing when possible with the server. Local datastore works good here for me).
The only strange behavior is that the PFEventuallyQueue has no idea about the state of the network connection IMO. The scenario is:
Would be great to have the chance to force the sync to of this queue if the app can detect a working internet connection with Reachability or something.
Many thanks in advance.
The text was updated successfully, but these errors were encountered: