Skip to content

Commit

Permalink
0.25.1 Release (#1022)
Browse files Browse the repository at this point in the history
- Fixed issue with startup process when wallet_create returns 425 error on call.
- Wallet will no longer become a zombie object when the FFIWalletManager removes the reference to that object when the FFI is executing time-consuming async task.
- Removed retain cycle from EmojiIdView
- Updated FFI library to v.1.0.0-rc.5
  • Loading branch information
TruszczynskiA committed Feb 13, 2024
1 parent d320675 commit d17b3e1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
4 changes: 2 additions & 2 deletions MobileWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4005,7 +4005,7 @@
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 0.25.0;
MARKETING_VERSION = 0.25.1;
PRODUCT_BUNDLE_IDENTIFIER = com.tari.wallet;
PRODUCT_NAME = "Tari Aurora";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -4038,7 +4038,7 @@
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
MARKETING_VERSION = 0.25.0;
MARKETING_VERSION = 0.25.1;
PRODUCT_BUNDLE_IDENTIFIER = com.tari.wallet;
PRODUCT_NAME = "Tari Aurora";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
7 changes: 1 addition & 6 deletions MobileWallet/Common/Deep Links/DeeplinkHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ import UIKit

enum DeeplinkHandler {

private static var storedDeeplink: DeepLinkable?

static func deeplink(rawDeeplink: String) throws -> DeepLinkable? {

guard let deeplink = URL(string: rawDeeplink) else { return nil }
Expand Down Expand Up @@ -114,11 +112,8 @@ enum DeeplinkHandler {
}

private static func retryHandle(deeplink: DeepLinkable) {
storedDeeplink = deeplink
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
guard let storedDeeplink else { return }
self.storedDeeplink = nil
try? handle(deeplink: storedDeeplink, showDefaultDialogIfNeeded: true)
try? handle(deeplink: deeplink, showDefaultDialogIfNeeded: true)
}
}
}
4 changes: 2 additions & 2 deletions MobileWallet/Libraries/TariLib/Core/FFI/Wallet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ final class Wallet {

// MARK: - Deinitialiser

deinit {
Logger.log(message: "Wallet destoyed", domain: .general, level: .info)
func destroy() {
Logger.log(message: "Wallet destroyed", domain: .general, level: .info)
wallet_destroy(pointer)
}
}
15 changes: 13 additions & 2 deletions MobileWallet/Libraries/TariLib/Core/FFIWalletManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,36 @@ final class FFIWalletManager {
func connectWallet(commsConfig: CommsConfig, logFilePath: String, seedWords: SeedWords?, passphrase: String?, networkName: String, logVerbosity: Int32) throws {
do {
let beforeWalletCreationDate = Date()
Logger.log(message: "Wallet will be created", domain: .general, level: .info)
wallet = try Wallet(commsConfig: commsConfig, loggingFilePath: logFilePath, seedWords: seedWords, passphrase: passphrase, networkName: networkName, logVerbosity: logVerbosity)
Logger.log(message: "Wallet created after \(-beforeWalletCreationDate.timeIntervalSinceNow) seconds", domain: .general, level: .info)
} catch {
wallet = nil
Logger.log(message: "Wallet wasn't created: \(error)", domain: .general, level: .info)
destroyWallet()
throw error
}
}

func disconnectWallet() {
let taskID = UIApplication.shared.beginBackgroundTask()
Logger.log(message: "disconnectWallet Start: \(taskID)", domain: .general, level: .info)
wallet = nil
destroyWallet()
baseNodeConnectionStatus = .offline
DispatchQueue.main.asyncAfter(deadline: .now() + 20.0) {
Logger.log(message: "disconnectWallet: End: \(taskID)", domain: .general, level: .info)
UIApplication.shared.endBackgroundTask(taskID)
}
}

private func destroyWallet() {
guard let wallet else { return }
let beforeWalletDestroyDate = Date()
Logger.log(message: "Wallet will be destroyed", domain: .general, level: .info)
wallet.destroy()
Logger.log(message: "Wallet destroyed after \(-beforeWalletDestroyDate.timeIntervalSinceNow) seconds", domain: .general, level: .info)
self.wallet = nil
}

// MARK: - FFI Actions

func walletAddress() throws -> TariAddress {
Expand Down
4 changes: 3 additions & 1 deletion MobileWallet/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {

// If the user opens a deep link while the app is closed
if let url = connectionOptions.urlContexts.first?.url {
try? DeeplinkHandler.handle(rawDeeplink: url.absoluteString, showDefaultDialogIfNeeded: true)
DispatchQueue.main.async {
try? DeeplinkHandler.handle(rawDeeplink: url.absoluteString, showDefaultDialogIfNeeded: true)
}
}

// If the user opens a home screen shortcut while the app is closed
Expand Down
2 changes: 1 addition & 1 deletion MobileWallet/UIElements/EmojiIdView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ final class EmojiIdView: DynamicThemeView {
}
}

private var superVC: UIViewController?
private weak var superVC: UIViewController?

// MARK: - Updates

Expand Down
2 changes: 1 addition & 1 deletion dependencies.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FFI_VERSION="1.0.0-rc.3"
FFI_VERSION="1.0.0-rc.5"

0 comments on commit d17b3e1

Please sign in to comment.