Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Import empty Auth backups

Manav Rathid9d42e5265d9
diff --git a/mobile/apps/auth/lib/ui/settings/data/import/plain_text_import_parser.dart b/mobile/apps/auth/lib/ui/settings/data/import/plain_text_import_parser.dart
index 590b414acc..9ff762f385 100644
--- a/mobile/apps/auth/lib/ui/settings/data/import/plain_text_import_parser.dart
+++ b/mobile/apps/auth/lib/ui/settings/data/import/plain_text_import_parser.dart
@@ -7,6 +7,9 @@ final _logger = Logger('PlainTextImportParser');
List<Code> parsePlainTextImport(String content) {
final trimmedContent = content.trim();
+ if (trimmedContent.isEmpty) {
+ return [];
+ }
if (trimmedContent.startsWith('otpauth://')) {
return _parseOTPAuthCodes(trimmedContent);
}
diff --git a/mobile/apps/auth/test/ui/settings/data/import/plain_text_import_parser_test.dart b/mobile/apps/auth/test/ui/settings/data/import/plain_text_import_parser_test.dart
index 3ff0035e2e..70b997ad75 100644
--- a/mobile/apps/auth/test/ui/settings/data/import/plain_text_import_parser_test.dart
+++ b/mobile/apps/auth/test/ui/settings/data/import/plain_text_import_parser_test.dart
@@ -41,6 +41,11 @@ void main() {
});
}
+ test('accepts empty content', () {
+ expect(parsePlainTextImport(''), isEmpty);
+ expect(parsePlainTextImport(' \n\t'), isEmpty);
+ });
+
test('parses the offline Maestro fixture', () async {
final content = await File(
'test/ui/settings/data/import/fixtures/plain_text_import.txt',
diff --git a/mobile/packages/ente_crypto_dart_adapter/pubspec.yaml b/mobile/packages/ente_crypto_dart_adapter/pubspec.yaml
index 16ec7d20de..a0f3e8857a 100644
--- a/mobile/packages/ente_crypto_dart_adapter/pubspec.yaml
+++ b/mobile/packages/ente_crypto_dart_adapter/pubspec.yaml
@@ -11,7 +11,7 @@ dependencies:
ente_crypto_dart:
git:
url: https://github.com/ente/ente_crypto_dart.git
- ref: 981a9e0f4a227023991af3332ef0e6ab6d14a1c2
+ ref: b3f17aac6973b630aff663e4d9f7c6ee92334a62
meta: 1.18.3
dev_dependencies:
diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock
index 03d002461d..08d3bf0a35 100644
--- a/mobile/pubspec.lock
+++ b/mobile/pubspec.lock
@@ -574,8 +574,8 @@ packages:
dependency: transitive
description:
path: "."
- ref: "981a9e0f4a227023991af3332ef0e6ab6d14a1c2"
- resolved-ref: "981a9e0f4a227023991af3332ef0e6ab6d14a1c2"
+ ref: b3f17aac6973b630aff663e4d9f7c6ee92334a62
+ resolved-ref: b3f17aac6973b630aff663e4d9f7c6ee92334a62
url: "https://github.com/ente/ente_crypto_dart.git"
source: git
version: "1.0.0"