-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #853 from bfahey/feature/fix-persistent-container-…
…loading Stopping Core Data Crashes When Disk is Full
- Loading branch information
Showing
10 changed files
with
129 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,42 +81,45 @@ class OfflineModeEndpointTests: XCTestCase { | |
"messageId": "msg_1", | ||
], | ||
] | ||
api.trackPushOpen(pushPayload, | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
}) { reason, _ in | ||
api.trackPushOpen( | ||
pushPayload, | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
} | ||
) { reason, _ in | ||
XCTFail(reason ?? "failed") | ||
} | ||
|
||
wait(for: [expectation1], timeout: 15) | ||
} | ||
|
||
func test04TrackEvent() throws { | ||
let expectation1 = expectation(description: #function) | ||
let localStorage = MockLocalStorage() | ||
localStorage.offlineMode = true | ||
let api = InternalIterableAPI.initializeForE2E(apiKey: Self.apiKey, | ||
localStorage: localStorage) | ||
let api = InternalIterableAPI.initializeForE2E( | ||
apiKey: Self.apiKey, | ||
localStorage: localStorage | ||
) | ||
api.email = "[email protected]" | ||
|
||
api.track("event1", | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
}) { reason, _ in | ||
|
||
api.track( | ||
"event1", | ||
dataFields: ["data_field1": "value1"], | ||
onSuccess: { _ in | ||
expectation1.fulfill() | ||
} | ||
) { reason, _ in | ||
XCTFail(reason ?? "failed") | ||
} | ||
|
||
wait(for: [expectation1], timeout: 15) | ||
} | ||
|
||
private static let apiKey = Environment.apiKey! | ||
private static let pushCampaignId = Environment.pushCampaignId! | ||
private static let pushTemplateId = Environment.pushTemplateId! | ||
private static let inAppCampaignId = Environment.inAppCampaignId! | ||
private lazy var persistenceContextProvider: IterablePersistenceContextProvider = { | ||
let provider = CoreDataPersistenceContextProvider()! | ||
return provider | ||
}() | ||
private lazy var persistenceContextProvider: IterablePersistenceContextProvider = CoreDataPersistenceContextProvider() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.