Skip to content
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

Don't report CancellationError from BookmarksFaviconsFetcher #634

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "bb027f14bec7fbb1a85d308139e7a66686da160e",
"version" : "4.59.0"
"revision" : "0b68b0d404d8d4f32296cd84fa160b18b0aeaf44",
"version" : "4.59.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public final class BookmarksFaviconsFetcher {
self?.fetchingDidFinishSubject.send(.failure(error))
if let fetcherError = error as? BookmarksFaviconsFetcherError {
self?.errorEvents?.fire(fetcherError)
} else {
} else if !(error is CancellationError) {
self?.errorEvents?.fire(.other(error))
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,12 @@ final class BookmarksFaviconsFetcherTests: XCTestCase {

await runAfterOperationsFinished {
XCTAssertEqual(results.count, 1)
guard case .failure = results.first else {
XCTFail("Expected failure")
return
}
XCTAssertEqual(MockBookmarksFaviconsFetcherEventMapper.errors.count, 1)
guard MockBookmarksFaviconsFetcherEventMapper.errors[0].underlyingError is CancellationError else {
guard case .failure(let error) = results.first, error is CancellationError else {
XCTFail("Expected CancellationError")
return
}
// Cancellation errors are not reported
XCTAssertTrue(MockBookmarksFaviconsFetcherEventMapper.errors.isEmpty)
}
cancellable.cancel()
}
Expand Down
Loading