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

Add error codes to site breakage reports #2413

Merged
merged 23 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
803f827
broken site model removed
federicocappelli Jan 10, 2024
91ebbc8
Merge branch 'main' into fcappelli/prev_sub_breakage
federicocappelli Jan 10, 2024
b7ad7d1
Report broken site unit tests fixed
federicocappelli Jan 10, 2024
eea0468
os detection improved
federicocappelli Jan 11, 2024
3751920
Merge branch 'main' into fcappelli/prev_sub_breakage
federicocappelli Jan 11, 2024
f1c7e56
add xcargs: -skipPackagePluginValidation arg to build_app
mallexxx Jan 11, 2024
924da96
bsk updated
federicocappelli Jan 11, 2024
357e216
Merge branch 'main' into fcappelli/prev_sub_breakage
federicocappelli Jan 11, 2024
aed465e
Merge branch 'main' into fcappelli/prev_sub_breakage
federicocappelli Jan 11, 2024
3ef4689
Merge branch 'alex/fix-fastlane-builds' into fcappelli/prev_sub_breakage
federicocappelli Jan 11, 2024
f08738f
pkg fix
federicocappelli Jan 11, 2024
fdefae4
Merge branch 'main' into fcappelli/prev_sub_breakage
federicocappelli Jan 11, 2024
098e80a
Merge branch 'main' into fcappelli/prev_sub_breakage
federicocappelli Jan 11, 2024
f5442a4
commented out code removed
federicocappelli Jan 12, 2024
c569629
Merge branch 'main' into fcappelli/prev_sub_breakage
federicocappelli Jan 24, 2024
f3aee19
Add error reporting
jaceklyp Jan 25, 2024
0c60461
Change BSK ref
jaceklyp Jan 29, 2024
6a986c7
Merge branch 'main' into jacek/error-codes
jaceklyp Jan 29, 2024
6d19dc7
Merge branch 'main' into jacek/error-codes
jaceklyp Jan 30, 2024
5a7095d
Update BSK
jaceklyp Jan 30, 2024
df3d741
Fix issues
jaceklyp Jan 30, 2024
ef54550
Update BSK ref
jaceklyp Jan 30, 2024
11a8a9d
Update BSK ref
jaceklyp Jan 30, 2024
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 DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9976,8 +9976,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 104.0.0;
branch = "jacek/error-codes";
kind = branch;
};
};
C14882EB27F211A000D59F0C /* XCRemoteSwiftPackageReference "SwiftSoup" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "872090e651ad8e26ca9903a95f3d094b21d48e23",
"version" : "104.0.0"
"branch" : "jacek/error-codes",
"revision" : "742fa13699ef669ebb3567b9fcd7331761d3bc93"
}
},
{
Expand Down Expand Up @@ -156,7 +156,7 @@
{
"identity" : "trackerradarkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/TrackerRadarKit",
"location" : "https://github.com/duckduckgo/TrackerRadarKit.git",
"state" : {
"revision" : "a6b7ba151d9dc6684484f3785293875ec01cc1ff",
"version" : "1.2.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ extension PrivacyDashboardViewController {
let ampURLString: String
let urlParametersRemoved: Bool
let isDesktop: Bool
let error: Error?
let httpStatusCode: Int?
}

enum WebsiteBreakageError: Error {
Expand Down Expand Up @@ -252,7 +254,8 @@ extension PrivacyDashboardViewController {
reportFlow: source,
siteType: breakageAdditionalInfo.isDesktop ? .desktop : .mobile,
atb: StatisticsUserDefaults().atb ?? "",
model: UIDevice.current.model)

model: UIDevice.current.model,
error: breakageAdditionalInfo.error,
httpStatusCode: breakageAdditionalInfo.httpStatusCode)
}
}
16 changes: 10 additions & 6 deletions DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class TabViewController: UIViewController {
private var httpsForced: Bool = false
private var lastUpgradedURL: URL?
private var lastError: Error?
private var lastHttpStatusCode: Int?
private var shouldReloadOnError = false
private var failingUrls = Set<String>()
private var urlProvidedBasicAuthCredential: (credential: URLCredential, url: URL)?
Expand Down Expand Up @@ -919,15 +920,17 @@ class TabViewController: UIViewController {
return nil
}
return PrivacyDashboardViewController.BreakageAdditionalInfo(currentURL: currentURL,
httpsForced: httpsForced,
ampURLString: linkProtection.lastAMPURLString ?? "",
urlParametersRemoved: linkProtection.urlParametersRemoved,
isDesktop: tabModel.isDesktop)
httpsForced: httpsForced,
ampURLString: linkProtection.lastAMPURLString ?? "",
urlParametersRemoved: linkProtection.urlParametersRemoved,
isDesktop: tabModel.isDesktop,
error: lastError,
httpStatusCode: lastHttpStatusCode)
}

public func print() {
let printFormatter = webView.viewPrintFormatter()

let printInfo = UIPrintInfo(dictionary: nil)
printInfo.jobName = Bundle.main.infoDictionary!["CFBundleName"] as? String ?? "DuckDuckGo"
printInfo.outputType = .general
Expand Down Expand Up @@ -1062,6 +1065,7 @@ extension TabViewController: WKNavigationDelegate {

let httpResponse = navigationResponse.response as? HTTPURLResponse
let isSuccessfulResponse = httpResponse?.isSuccessfulResponse ?? false
lastHttpStatusCode = httpResponse?.statusCode

let didMarkAsInternal = internalUserDecider.markUserAsInternalIfNeeded(forUrl: webView.url, response: httpResponse)
if didMarkAsInternal {
Expand Down
Loading