Skip to content

Commit 1d80bc6

Browse files
authored
Merge pull request #1777 from SatoshiPortal/develop
6.5.4
2 parents 064e855 + abbc2c1 commit 1d80bc6

4 files changed

Lines changed: 70 additions & 23 deletions

File tree

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,11 @@
488488
buildSettings = {
489489
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
490490
CLANG_ENABLE_MODULES = YES;
491-
CURRENT_PROJECT_VERSION = 138;
491+
CURRENT_PROJECT_VERSION = 139;
492492
DEVELOPMENT_TEAM = BX99T32YGS;
493493
ENABLE_BITCODE = NO;
494-
FLUTTER_BUILD_NAME = 6.5.3;
495-
FLUTTER_BUILD_NUMBER = 138;
494+
FLUTTER_BUILD_NAME = 6.5.4;
495+
FLUTTER_BUILD_NUMBER = 139;
496496
INFOPLIST_FILE = Runner/Info.plist;
497497
INFOPLIST_KEY_CFBundleDisplayName = BULL;
498498
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
@@ -501,7 +501,7 @@
501501
"$(inherited)",
502502
"@executable_path/Frameworks",
503503
);
504-
MARKETING_VERSION = 6.5.3;
504+
MARKETING_VERSION = 6.5.4;
505505
PRODUCT_BUNDLE_IDENTIFIER = com.bullbitcoin.app;
506506
PRODUCT_NAME = "$(TARGET_NAME)";
507507
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -679,11 +679,11 @@
679679
buildSettings = {
680680
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
681681
CLANG_ENABLE_MODULES = YES;
682-
CURRENT_PROJECT_VERSION = 138;
682+
CURRENT_PROJECT_VERSION = 139;
683683
DEVELOPMENT_TEAM = BX99T32YGS;
684684
ENABLE_BITCODE = NO;
685-
FLUTTER_BUILD_NAME = 6.5.3;
686-
FLUTTER_BUILD_NUMBER = 138;
685+
FLUTTER_BUILD_NAME = 6.5.4;
686+
FLUTTER_BUILD_NUMBER = 139;
687687
INFOPLIST_FILE = Runner/Info.plist;
688688
INFOPLIST_KEY_CFBundleDisplayName = BULL;
689689
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
@@ -692,7 +692,7 @@
692692
"$(inherited)",
693693
"@executable_path/Frameworks",
694694
);
695-
MARKETING_VERSION = 6.5.3;
695+
MARKETING_VERSION = 6.5.4;
696696
PRODUCT_BUNDLE_IDENTIFIER = com.bullbitcoin.app;
697697
PRODUCT_NAME = "$(TARGET_NAME)";
698698
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@@ -708,11 +708,11 @@
708708
buildSettings = {
709709
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
710710
CLANG_ENABLE_MODULES = YES;
711-
CURRENT_PROJECT_VERSION = 138;
711+
CURRENT_PROJECT_VERSION = 139;
712712
DEVELOPMENT_TEAM = BX99T32YGS;
713713
ENABLE_BITCODE = NO;
714-
FLUTTER_BUILD_NAME = 6.5.3;
715-
FLUTTER_BUILD_NUMBER = 138;
714+
FLUTTER_BUILD_NAME = 6.5.4;
715+
FLUTTER_BUILD_NUMBER = 139;
716716
INFOPLIST_FILE = Runner/Info.plist;
717717
INFOPLIST_KEY_CFBundleDisplayName = BULL;
718718
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
@@ -721,7 +721,7 @@
721721
"$(inherited)",
722722
"@executable_path/Frameworks",
723723
);
724-
MARKETING_VERSION = 6.5.3;
724+
MARKETING_VERSION = 6.5.4;
725725
PRODUCT_BUNDLE_IDENTIFIER = com.bullbitcoin.app;
726726
PRODUCT_NAME = "$(TARGET_NAME)";
727727
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

lib/core/core_locator.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class CoreLocator {
3333
await MempoolLocator.registerDatasources(locator);
3434
PayjoinLocator.registerDatasources(locator);
3535
await RecoverbullLocator.registerDatasources(locator);
36-
SeedLocator.registerDatasources(locator);
3736
await StorageLocator.registerDatasources(locator);
37+
SeedLocator.registerDatasources(locator);
3838
await SwapsLocator.registerDatasources(locator);
3939
await WalletLocator.registerDatasources(locator);
4040
await SettingsLocator.registerDatasources(locator);

lib/core/seed/data/datasources/seed_datasource.dart

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:bb_mobile/core/errors/bull_exception.dart';
44
import 'package:bb_mobile/core/seed/data/models/seed_model.dart';
55
import 'package:bb_mobile/core/storage/data/datasources/key_value_storage/key_value_storage_datasource.dart';
66
import 'package:bb_mobile/core/utils/constants.dart';
7+
import 'package:bb_mobile/core/utils/logger.dart';
78
import 'package:flutter/foundation.dart';
89

910
class SeedDatasource {
@@ -20,18 +21,64 @@ class SeedDatasource {
2021
}
2122

2223
Future<SeedModel> get(String fingerprint) async {
24+
const maxRetries = 5;
25+
const initialDelay = Duration(milliseconds: 300);
2326
final key = composeSeedStorageKey(fingerprint);
24-
final value = await _secureStorage.getValue(key);
25-
if (value == null) {
26-
throw SeedNotFoundException(
27-
'Seed not found for fingerprint: $fingerprint',
28-
);
29-
}
3027

31-
final json = jsonDecode(value) as Map<String, dynamic>;
32-
final seed = SeedModel.fromJson(json);
28+
for (int attempt = 0; attempt < maxRetries; attempt++) {
29+
try {
30+
final value = await _secureStorage.getValue(key);
31+
if (value != null) {
32+
final json = jsonDecode(value) as Map<String, dynamic>;
33+
final seed = SeedModel.fromJson(json);
34+
if (attempt > 0) {
35+
log.fine(
36+
'Seed found for fingerprint $fingerprint on attempt ${attempt + 1}',
37+
);
38+
}
39+
return seed;
40+
}
41+
42+
if (attempt < maxRetries - 1) {
43+
final delay = Duration(
44+
milliseconds: initialDelay.inMilliseconds * (1 << attempt),
45+
);
46+
log.fine(
47+
'Seed read returned null for fingerprint $fingerprint on attempt ${attempt + 1}, retrying in ${delay.inMilliseconds}ms',
48+
);
49+
await Future.delayed(delay);
50+
continue;
51+
}
52+
53+
throw SeedNotFoundException(
54+
'Seed not found for fingerprint: $fingerprint',
55+
);
56+
} catch (e) {
57+
if (e is SeedNotFoundException) {
58+
rethrow;
59+
}
60+
61+
if (attempt < maxRetries - 1) {
62+
final delay = Duration(
63+
milliseconds: initialDelay.inMilliseconds * (1 << attempt),
64+
);
65+
log.fine(
66+
'Exception reading seed for fingerprint $fingerprint on attempt ${attempt + 1}: $e, retrying in ${delay.inMilliseconds}ms',
67+
);
68+
await Future.delayed(delay);
69+
continue;
70+
}
71+
72+
log.severe(
73+
'Failed to read seed for fingerprint $fingerprint after $maxRetries attempts: $e',
74+
);
75+
throw SeedNotFoundException(
76+
'Seed not found for fingerprint: $fingerprint',
77+
);
78+
}
79+
}
3380

34-
return seed;
81+
throw SeedNotFoundException('Seed not found for fingerprint: $fingerprint');
3582
}
3683

3784
Future<bool> exists(String fingerprint) {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: bb_mobile
22
description: Bull Bitcoin Mobile Wallet
33
publish_to: "none"
4-
version: 6.5.3+138
4+
version: 6.5.4+139
55

66
environment:
77
sdk: ">=3.10.0 <4.0.0"

0 commit comments

Comments
 (0)