-
-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
type:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse Swift SDK.
Issue Description
If file is fetched two times (only with real URL), the actual file is replaced by a broken one.
That's the case even across multiple app launches, it puts some URL string inside the actual file. Probably some cache issue.
Steps to reproduce
func testFetchFile() throws {
guard let parseFileURL = URL(string: "https://artworkout-parse.nyc3.cdn.digitaloceanspaces.com/116112879a51dfe3ce5e34105a26aae9_autumn.pumpkin.svg") else {
XCTFail("Should create URL")
return
}
var parseFile = ParseFile(name: "d3a37aed0672a024595b766f97133615_logo.svg", cloudURL: parseFileURL)
parseFile.url = parseFileURL
let firstFile = try parseFile.fetch()
let firstStr = try! String(contentsOf: firstFile.localURL!)
let secondFile = try parseFile.fetch()
let secondStr = try! String(contentsOf: secondFile.localURL!)
XCTAssertEqual(firstStr, secondStr)
}Actual Outcome
</g>
</svg>
") is not equal to (""file:\/\/\/Users\/xxx\/Library\/Developer\/CoreSimulator\/Devices\/XXXX\/data\/Library\/Private%20Documents\/parse\/Downloads\/d3a37aed0672a024595b766f97133615_logo.svg"")
Test Case '-[ParseSwiftTests.ParseFileTests testFetchFile]' failed (1.831 seconds).
Test Suite 'ParseFileTests' failed at 2022-09-13 21:33:10.256.
Expected Outcome
Test passing
Environment
Version 4.13.0
Logs
n/a
Workaround
Force fetch without cache
let secondFile = try parseFile.fetch(options: [.cachePolicy(.reloadIgnoringLocalCacheData)])Metadata
Metadata
Assignees
Labels
type:bugImpaired feature or lacking behavior that is likely assumedImpaired feature or lacking behavior that is likely assumed