Prechádzať zdrojové kódy

show the max. progress value, might help to get a grip on some weird errors

B. Petersen 5 rokov pred
rodič
commit
0119ca7bcd

+ 2 - 0
DcCore/DcCore/DC/Wrapper.swift

@@ -10,6 +10,7 @@ public class DcContext {
     public var logger: Logger?
     let contextPointer: OpaquePointer
     public var lastErrorString: String?
+    public var maxConfigureProgress: Int = 0 // temporary thing to get a grip on some weird errors
 
     private init() {
         var version = ""
@@ -292,6 +293,7 @@ public class DcContext {
     }
 
     public func configure() {
+        maxConfigureProgress = 0
         dc_configure(contextPointer)
     }
 

+ 1 - 0
DcCore/DcCore/DC/events.swift

@@ -32,6 +32,7 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon
         DcContext.shared.logger?.warning("event: \(s)")
 
     case DC_EVENT_CONFIGURE_PROGRESS:
+        DcContext.shared.maxConfigureProgress = max(DcContext.shared.maxConfigureProgress, Int(data1))
         DcContext.shared.logger?.info("configure progress: \(Int(data1)) \(Int(data2))")
         let nc = NotificationCenter.default
         DispatchQueue.main.async {

+ 2 - 0
deltachat-ios/Controller/AccountSetupController.swift

@@ -661,6 +661,8 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
                     var errorMessage = ui["errorMessage"] as? String
                     if let appDelegate = UIApplication.shared.delegate as? AppDelegate, appDelegate.reachability.connection == .none {
                         errorMessage = String.localized("login_error_no_internet_connection")
+                    } else {
+                        errorMessage = "\(errorMessage ?? "no message") (progress=\(DcContext.shared.maxConfigureProgress))"
                     }
                     self.updateProgressAlert(error: errorMessage)
                 } else if ui["done"] as! Bool {