Skip to content

Commit a55a246

Browse files
wesbillmanBrain
andcommitted
test(mobile): cover recovered identity binding without native sealing
Clarify unsupported-backup copy and resolve analyzer feedback. Co-authored-by: Brain <1a02c72794dcd0f07058a353bc3a81f4028b8c77c92c87fce6d5c8b85970a20b@buzz.block.builderlab.xyz> Signed-off-by: Wes <[email protected]>
1 parent 323cec6 commit a55a246

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎mobile/lib/shared/community/community_storage.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class CommunityStorage {
8383
scheme: ['https', 'wss'].contains(uri.scheme) ? 'https' : 'http',
8484
)
8585
.origin;
86-
return '${_pendingInvitePrefix}${sha256.convert(utf8.encode(jsonEncode([origin, code])))}';
86+
return '$_pendingInvitePrefix${sha256.convert(utf8.encode(jsonEncode([origin, code])))}';
8787
}
8888

8989
/// Retain the claim identity before sending a request with uncertain outcomes.

‎mobile/lib/shared/hosted/hosted_flow_problem_message.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ String hostedFlowProblemMessage(
2727
HostedFlowProblem.identityUnreadable =>
2828
'Your saved identity could not be read safely. Leave setup and recover access to this device’s secure storage before continuing.',
2929
HostedFlowProblem.unsupportedPlatform =>
30-
'Creating a secure backup requires iOS 17 or later. Update iOS to continue, or recover an identity that already has a backup. You can still use self-hosted communities.',
30+
'Creating a secure backup requires iOS 17 or later. Update iOS to continue. You can still use self-hosted communities.',
3131
HostedFlowProblem.backupUnavailable =>
3232
'Secure backup is not supported on this device yet. Your identity has been kept; joining requires a confirmed backup.',
3333
HostedFlowProblem.requestRejected =>

‎mobile/test/features/invites/invite_join_provider_test.dart‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import 'package:buzz/app.dart';
1313
import 'package:buzz/features/channels/channel.dart';
1414
import 'package:buzz/features/invites/invite_join_provider.dart';
1515
import 'package:buzz/shared/auth/auth.dart';
16-
import 'package:buzz/shared/community/community_provider.dart';
1716
import 'package:buzz/shared/deeplink/deep_link.dart';
1817

1918
import '../../shared/community/community_storage_test.dart';

‎mobile/test/features/onboarding/hosted_journeys_test.dart‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,14 @@ void main() {
779779
'new device recovers and preserves existing/unreadable profile ($unreadableProfile)',
780780
(tester, f) async {
781781
await f.initialize(localIdentity: false);
782-
f.cloudKeys.addAll([f.secondKeys, f.keys]);
782+
// Exercise both an already-bound recovery and recovery that must bind
783+
// its confirmed backup, without requiring native sealing in either case.
784+
if (unreadableProfile) {
785+
f.bound = null;
786+
f.cloudKeys.add(f.keys);
787+
} else {
788+
f.cloudKeys.addAll([f.secondKeys, f.keys]);
789+
}
783790
f.rows.addAll([f.row('one'), f.row('two')]);
784791
f.offerProfile = false;
785792
f.profileUnavailable = unreadableProfile;
@@ -826,7 +833,7 @@ void main() {
826833
expect(saved.pubkey, f.keys.public);
827834
expect((await f.store.read())!.pubkey, f.keys.public);
828835
expect(f.sent('/recovery'), hasLength(1));
829-
expect(f.sent('/challenge'), isEmpty);
836+
expect(f.sent('/challenge'), hasLength(unreadableProfile ? 1 : 0));
830837
expect(f.sent('/nsec-backups'), isEmpty);
831838
expect(f.sent('/enrollment'), isEmpty);
832839
expect(await f.storage.loadActiveId(), saved.id);

0 commit comments

Comments
 (0)