-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add offline object saving #429
Comments
Thanks for opening this issue!
|
Yes, I recently started working on a project that needs to be offline first and realized that this is a gaping hole vs Parse ObjC |
Did you read through the forum discussion to see whether you can implement a custom solution until this feature is added out-of-the-box to the SDK? |
Unfortunately my time has been rather limited, is there a way I can up the bounty to help out financially? |
I have offline usage working for my own project. I could modify it to make it more generic, but I would need to take some days off and I don't know if I find it worth to put in the time and effort for 100$. Also want to mention that I needed to enable custom objectId's on the server in order for it to work. Because of this, I don't know if it is suitable for this to publish it. |
@vdkdamian we could bump the bounty label, how much would you see appropriate for you to add the feature? |
Difficult question, I would need to see how much work it would take. I've done it using a observable object but I would need to change that in a more general way. I also think I can drop the fact that custom object id's are required because I only use that for objects that are created locally to be saved when offline. This would mean that existing objects in the database can be used offline with no problem. |
Sounds good! So let me know when you get to an estimate, you can also reach me via Slack to discuss in more detail |
How do I reach you on Slack? |
I am willing to contribute $250 towards the bounty I just need to know how. |
I'm still working on it. If finished I'll see what's willing to give as reward. |
@hajjD If you would like to donate to our open collective, we'll raise the bounty for this issue here by the amount that you donate. Whoever provides this feature then gets the bounty, or if multiple people work on this feature, they can easily split up the bounty among them, according to the Parse Bounty Program. |
I contributed $300 via my company, please increase the bounty as such. |
@hajjD Thanks for your contribution! I increased the bounty amount as requested. |
@hajjD Could you test this branch? |
Will do, thank you! |
I finally had sometime for in depth testing. There appears to be two major issues:
Another potential issue is when saving etc it will error out if offline, when ideally it should still count as a save if it gets locally stored. This will prevent a bunch of extra boilerplate code to check if online or not. All in all we are almost there, thank you to everyone involved. |
First of all, did you enable custom objectId? (Also make sure that you set an
Do I understand it correctly that nothing is working?
That's true. I'll check it and see why it's throwing the issue if not connected to the internet.
Glad I can help. |
No, so right now if I save an object and reconnect to the internet it will sync it up as long as the app doesn't close.
I am not, ill get back to you on this as today I also have extra time |
I attempted to use fetchLocal (I could be way off here) as such Here is the struct
Then saving the data
Then loading the data
Unfortunately it is returning nil when trying to fetch via localStore |
Forgot to answer this, yes my config has the following:
|
This is fine.
I need to point out some things. Getting your objects should still be the same function as you always did. Only thing you need to set is "
You have set this up correctly, but for now, you will need to set this on your init() or something. This way you can test if everything is working. This is just a manual way of fetching your local objects. I'll try to add this functionality standard on appLaunch and maybe when internet reconnects. Also, if you look at the description, it states that this will only return results if your objects on the database was more recent then the local. This way you can choose what you do with it. |
How's this issue coming? Can I help? |
I was waiting for his answer, but you could help by testing and providing me some feedback. |
@vdkdamian I would be happy to help you test this, and help support finishing this feature if needed. @mtrezza Also happy to contribute to the Bounty. Where can I slack you? |
Hey @gregyoung14 you can join our Slack at https://chat.parseplatform.org. Maybe you could also take a look at @vdkdamian's previous comment, test this PR and provide feedback, to get the PR rolling. |
New Feature / Enhancement Checklist
Current Limitation
According to the migration guide, the Parse Swift SDK is missing the feature of offline object saving, which the Parse ObjC supports. This can make it difficult for people to migrate from the Parse ObjC SDK to the Parse Swift SDK. From a forum discussion it seems to require a custom solution and quite some investigation and experimentation to add such a feature.
Offline object saving is currently supported out-of-the-box by all other major Parse SDKs (ObjC, Android, JS).
Feature / Enhancement Description
The Parse Swift SDK should provide offline saving functionality out-of-the-box.
Example Use Case
n/a
Alternatives / Workarounds
Implement a custom solution.
References
The text was updated successfully, but these errors were encountered: