Skip to content

Commit 6088c8e

Browse files
johnxnguyengithub-actions[bot]zenkinsnetbe
authored
feat: improve network error alerts - WPB-20669 🍒 (#3684)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: zenkins <[email protected]> Co-authored-by: François Benaiteau <[email protected]>
1 parent 36c119b commit 6088c8e

File tree

30 files changed

+140
-32
lines changed

30 files changed

+140
-32
lines changed

WireAuthentication/Sources/WireAuthenticationUI/Resources/Localization/de.lproj/Localizable.strings

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
"login.sso.title" = "Anmelden";
3434
"login.sso.expiration_message" = "Ihre Session ist abgelaufen. Melden Sie sich mit Ihrem Unternehmenskonto an, um fortzufahren.";
3535
"login.sso.input_code.title" = "SSO Zugangscode";
36-
"login.sso.input_code.placeholder" = "SSO Zugangscode eingeben";
36+
"login.sso.input_code.placeholder" = "SSO-Code eingeben";
3737
"login.sso.submit" = "Anmeldung für Unternehmen";
3838

3939
"logout.button.title" = "Abmelden";
4040
"logout.alert.title" = "Abmelden";
41-
"logout.alert.message" = "Entscheiden Sie, ob Sie Ihre Gesprächshistorie behalten oder unwiderruflich von diesem Gerät löschen wollen.";
42-
"logout.alert.delete_data_button" = "Abmelden und Historie löschen";
43-
"logout.alert.keep_data_button" = "Abmelden und Historie behalten";
41+
"logout.alert.message" = "Entscheiden Sie, ob Sie Ihren Gesprächsverlauf behalten oder unwiderruflich von diesem Gerät löschen möchten.";
42+
"logout.alert.delete_data_button" = "Abmelden und Verlauf löschen";
43+
"logout.alert.keep_data_button" = "Abmelden und Verlauf behalten";
4444
"logout.alert.cancel" = "Abbrechen";
4545

4646
"create_account_or_team.title" = "Sie haben kein Benutzerkonto? ";

WireMessaging/Sources/WireMessagingUI/Resources/Localization/de.lproj/Accessibility.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// MARK: Conversation Files View
2323
"conversation.wireCells.files.close" = "Dateien schließen";
24-
"conversation.wireCells.files.loadMore.title" = "Load more";
24+
"conversation.wireCells.files.loadMore.title" = "Weitere Objekte laden";
2525
"conversation.wireCells.files.noData.title" = "Es gibt noch keine Dateien oder Ordner";
2626
"conversation.wireCells.files.noData.message" = "Hier finden Sie alle Dateien und Ordner, die in dieser Unterhaltung geteilt wurden.";
2727
"conversation.wireCells.files.pendingCells.title" = "Files are being prepared";

WireMessaging/Sources/WireMessagingUI/Resources/Localization/de.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
// MARK: Conversation Files View
104104
"conversation.wireCells.files.navigationTitle" = "Dokumente";
105105
"conversation.wireCells.files.item.subtitle" = "%@ von %@";
106-
"conversation.wireCells.files.loadMore.title" = "Load more";
106+
"conversation.wireCells.files.loadMore.title" = "Weitere Objekte laden";
107107
"conversation.wireCells.files.item.menu.open" = "Öffnen";
108108
"conversation.wireCells.files.item.menu.download" = "Herunterladen";
109109
"conversation.wireCells.files.item.menu.rename" = "Umbenennen";

wire-ios-sync-engine/Source/SessionManager/SessionManager.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,16 @@ public final class SessionManager: NSObject, SessionManagerType {
10941094
error: .clientIsObsolete
10951095
)
10961096
return nil
1097+
} catch let error as URLError {
1098+
WireLogger.sessionManager.error(
1099+
"failed to load user session due to url error code: \(error.errorCode)",
1100+
attributes: .safePublic
1101+
)
1102+
delegate?.sessionManagerDidFailToLoadSession(
1103+
for: account,
1104+
error: .networkError(code: error.errorCode)
1105+
)
1106+
return nil
10971107
} catch let error as SafeForLoggingStringConvertible {
10981108
WireLogger.sessionManager.error(
10991109
"failed to load user session: \(error.safeForLoggingDescription)",
@@ -2078,6 +2088,7 @@ public extension SessionManager {
20782088
case buildIsBlacklisted
20792089
case backendIsObsolete
20802090
case clientIsObsolete
2091+
case networkError(code: Int)
20812092
case genericError
20822093

20832094
}

wire-ios-sync-engine/Source/UserSession/BlacklistReason.swift

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import Foundation
2020

21-
public enum BlacklistReason {
21+
public enum BlacklistReason: Equatable {
2222
/// The app version is too old to be supported or has been explicitly blacklisted
2323
case appVersionBlacklisted
2424

@@ -28,7 +28,27 @@ public enum BlacklistReason {
2828
/// The API versions supported by the backend are too old in comparison to the ones supported by the client
2929
case backendAPIVersionObsolete
3030

31+
/// The session failed to load due to network issues.
32+
case networkError(code: Int)
33+
3134
/// Some reason that the session couldn't be loaded.
3235
case genericError
3336

37+
public static func == (lhs: BlacklistReason, rhs: BlacklistReason) -> Bool {
38+
switch (lhs, rhs) {
39+
case (.appVersionBlacklisted, .appVersionBlacklisted):
40+
true
41+
case (.clientAPIVersionObsolete, .clientAPIVersionObsolete):
42+
true
43+
case (.backendAPIVersionObsolete, .backendAPIVersionObsolete):
44+
true
45+
case let (.networkError(lhsCode), .networkError(rhsCode)):
46+
lhsCode == rhsCode
47+
case (.genericError, .genericError):
48+
true
49+
default:
50+
false
51+
}
52+
}
53+
3454
}

wire-ios/Wire-iOS Share Extension/Resources/Localization/de.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@
8484
"share_extension.error.update_required.obsolete_backend" = "Ihr Wire-Server muss aktualisiert werden. Bitte informieren Sie Ihren Systemadministrator.";
8585

8686
"share_extension.error.open_app.title" = "App öffnen";
87-
"share_extension.error.open_app.message" = "Öffnen Sie Ihr Benutzerkonto in Wire und versuchen Sie es erneut.";
87+
"share_extension.error.open_app.message" = "Öffnen Sie dieses Konto in der App und versuchen Sie es erneut.";

wire-ios/Wire-iOS/Generated/Strings+Generated.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,14 +1204,22 @@ internal enum L10n {
12041204
internal static let message = L10n.tr("Localizable", "account_blocked.generic_error.alert.message", fallback: "Please contact support if the error persists.")
12051205
/// Retry
12061206
internal static let retry = L10n.tr("Localizable", "account_blocked.generic_error.alert.retry", fallback: "Retry")
1207-
/// Send debug logs
1208-
internal static let sendLogs = L10n.tr("Localizable", "account_blocked.generic_error.alert.send_logs", fallback: "Send debug logs")
1207+
/// Send Debug Report
1208+
internal static let sendLogs = L10n.tr("Localizable", "account_blocked.generic_error.alert.send_logs", fallback: "Send Debug Report")
12091209
/// Switch accounts
12101210
internal static let switchAccounts = L10n.tr("Localizable", "account_blocked.generic_error.alert.switch_accounts", fallback: "Switch accounts")
12111211
/// Something went wrong
12121212
internal static let title = L10n.tr("Localizable", "account_blocked.generic_error.alert.title", fallback: "Something went wrong")
12131213
}
12141214
}
1215+
internal enum NetworkError {
1216+
internal enum Alert {
1217+
/// Please check your internet connection and try again.
1218+
internal static let message = L10n.tr("Localizable", "account_blocked.network_error.alert.message", fallback: "Please check your internet connection and try again.")
1219+
/// Network issue
1220+
internal static let title = L10n.tr("Localizable", "account_blocked.network_error.alert.title", fallback: "Network issue")
1221+
}
1222+
}
12151223
}
12161224
internal enum AccountDeletedMissingPasscodeAlert {
12171225
/// In order to use Wire, please set a passcode in your device settings.

wire-ios/Wire-iOS/Resources/Localization/Base.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2148,8 +2148,10 @@ to reset this device and log in again";
21482148
"device.details.certificate_details.title" = "Certificate Details";
21492149
"device.details.certificate_details.copy_to_clipboard" = "Copy to Clipboard";
21502150

2151+
"account_blocked.network_error.alert.title" = "Network issue";
2152+
"account_blocked.network_error.alert.message" = "Please check your internet connection and try again.";
21512153
"account_blocked.generic_error.alert.title" = "Something went wrong";
21522154
"account_blocked.generic_error.alert.message" = "Please contact support if the error persists.";
21532155
"account_blocked.generic_error.alert.switch_accounts" = "Switch accounts";
2154-
"account_blocked.generic_error.alert.send_logs" = "Send debug logs";
2156+
"account_blocked.generic_error.alert.send_logs" = "Send Debug Report";
21552157
"account_blocked.generic_error.alert.retry" = "Retry";

wire-ios/Wire-iOS/Resources/Localization/ar.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,8 +2146,10 @@
21462146
"device.details.certificate_details.title" = "Certificate Details";
21472147
"device.details.certificate_details.copy_to_clipboard" = "Copy to Clipboard";
21482148

2149+
"account_blocked.network_error.alert.title" = "Network issue";
2150+
"account_blocked.network_error.alert.message" = "Please check your internet connection and try again.";
21492151
"account_blocked.generic_error.alert.title" = "حدث خطأ";
21502152
"account_blocked.generic_error.alert.message" = "Please contact support if the error persists.";
21512153
"account_blocked.generic_error.alert.switch_accounts" = "Switch accounts";
2152-
"account_blocked.generic_error.alert.send_logs" = "Send debug logs";
2154+
"account_blocked.generic_error.alert.send_logs" = "Send Debug Report";
21532155
"account_blocked.generic_error.alert.retry" = "Retry";

wire-ios/Wire-iOS/Resources/Localization/da.lproj/Localizable.strings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,8 +2146,10 @@
21462146
"device.details.certificate_details.title" = "Certificate Details";
21472147
"device.details.certificate_details.copy_to_clipboard" = "Copy to Clipboard";
21482148

2149+
"account_blocked.network_error.alert.title" = "Network issue";
2150+
"account_blocked.network_error.alert.message" = "Please check your internet connection and try again.";
21492151
"account_blocked.generic_error.alert.title" = "Noget gik galt";
21502152
"account_blocked.generic_error.alert.message" = "Please contact support if the error persists.";
21512153
"account_blocked.generic_error.alert.switch_accounts" = "Switch accounts";
2152-
"account_blocked.generic_error.alert.send_logs" = "Send debug logs";
2154+
"account_blocked.generic_error.alert.send_logs" = "Send Debug Report";
21532155
"account_blocked.generic_error.alert.retry" = "Retry";

0 commit comments

Comments
 (0)