-
-
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
fix: don't use cache for fetching objects and files by default #272
Conversation
Thanks for opening this pull request!
|
Codecov Report
@@ Coverage Diff @@
## main #272 +/- ##
==========================================
- Coverage 82.34% 82.25% -0.10%
==========================================
Files 102 102
Lines 10525 10575 +50
==========================================
+ Hits 8667 8698 +31
- Misses 1858 1877 +19
Continue to review full report at Codecov.
|
@vdkdamian can you try out this branch? Note that it will only fix your problem if was related to the caching I mentioned in #226 (comment) and #226 (comment). If this doesn't fix your issue, then you will have to look in other places in your code and SDK. |
@cbaker6 This solves my issue! I tested it multiple times on iOS, then multiple times on macOS. Everything is working fine for me now. |
New Pull Request Checklist
Issue Description
When objects or files are being “fetched”, they sometimes leverage the OS level cache and pull from cache if there was a cache hit. This can lead to unintended behavior as when a “fetch” is used, it implies fresh data from the server.
In addition, when caching a file that was downloaded via the SDK, the temporary file location is cached instead the new location the file was moved to. This results in a cache hit, but points to a file location that’s no longer valid.
Related issue: #226
Approach
For "fetching", the default cache policy is set for all
ParseObject
's andParseFile
's to not use cache. If the developer wants to use cache, they should pass the respective cache policy intooptions
when calling the respective fetch method. The default cache policy for the SDK can be changed by the developer if needed:Parse-Swift/Sources/ParseSwift/Parse.swift
Lines 33 to 37 in a64726f
When fetching
ParseFile
, cache the final location the file was moved to instead of the temporary locationTODOs before merging