Skip to content

armgit / ente

Public Imported from GitHub
0

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

Polish mobile comments

Manav Rathid0c737ec46d7
diff --git a/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart b/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart
index ac39899764..fb7c03764d 100644
--- a/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart
+++ b/mobile/apps/auth/lib/ui/settings/data/local_backup/local_backup_experience.dart
@@ -131,7 +131,7 @@ class _LocalBackupExperienceState extends State<LocalBackupExperience> {
Future<bool> _startEnableFlow() async {
final hasPassword = await _ensurePasswordConfigured(disableOnCancel: true);
- // Re-enabling needs an existing password but does not prompt for it again.
+ // Re-enabling skips password re-entry when one is already stored.
if (!hasPassword) {
return false;
}
diff --git a/mobile/apps/auth/lib/utils/dialog_util.dart b/mobile/apps/auth/lib/utils/dialog_util.dart
index 0b22b2d28b..2ee02fc204 100644
--- a/mobile/apps/auth/lib/utils/dialog_util.dart
+++ b/mobile/apps/auth/lib/utils/dialog_util.dart
@@ -390,6 +390,7 @@ Future<ButtonResult?> showConfettiDialog<T>({
);
}
+// Returns null after submit, ButtonResult on cancel, and Exception on failure.
Future<dynamic> showTextInputDialog(
BuildContext context, {
required String title,
diff --git a/mobile/apps/locker/lib/ui/pages/base_info_page.dart b/mobile/apps/locker/lib/ui/pages/base_info_page.dart
index eac5592d38..ff07df48f5 100644
--- a/mobile/apps/locker/lib/ui/pages/base_info_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/base_info_page.dart
@@ -300,6 +300,7 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>
Future<void> _updateExistingFile(InfoItem infoItem) async {
if (widget.existingFile == null) return;
+ // updateInfoFile syncs internally.
final success = await InfoFileService.instance.updateInfoFile(
existingFile: widget.existingFile!,
updatedInfoItem: infoItem,
diff --git a/mobile/apps/photos/lib/models/metadata/collection_magic.dart b/mobile/apps/photos/lib/models/metadata/collection_magic.dart
index 96274d2ced..5969f01124 100644
--- a/mobile/apps/photos/lib/models/metadata/collection_magic.dart
+++ b/mobile/apps/photos/lib/models/metadata/collection_magic.dart
@@ -18,6 +18,7 @@ class CollectionMagicMetadata {
// 0 = visible, 1 = archived, 2 = hidden.
int visibility;
+ // null/0 = none; other values use the subType constants above.
int? subType;
// Higher values give a collection higher display priority.
diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_model.dart b/mobile/apps/photos/lib/services/machine_learning/ml_model.dart
index cf3a536a44..1e83663d44 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_model.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_model.dart
@@ -15,7 +15,7 @@ abstract class MlModelAsset {
final _downloadModelLock = Lock();
- // Downloads over high bandwidth if downloadModel was not called first.
+ // May download the model without checking canUseHighBandwidth.
Future<String> getModelPath() async {
return _downloadModelLock.synchronized(() async {
return RemoteAssetsService.instance.getAssetPath(
diff --git a/mobile/apps/photos/lib/ui/account/password_reentry_page.dart b/mobile/apps/photos/lib/ui/account/password_reentry_page.dart
index e12448bf21..3658844aac 100644
--- a/mobile/apps/photos/lib/ui/account/password_reentry_page.dart
+++ b/mobile/apps/photos/lib/ui/account/password_reentry_page.dart
@@ -198,7 +198,7 @@ class _PasswordReentryPageState extends State<PasswordReentryPage> {
children: [
const SizedBox(height: 12),
Visibility(
- // A hidden password field prompts autofill to save the password.
+ // Give autofill the account email to pair with the password.
visible: false,
child: TextFormField(
autofillHints: const [AutofillHints.email],
diff --git a/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart b/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart
index 0da818193a..74a9ca87b6 100644
--- a/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart
+++ b/mobile/apps/photos/lib/ui/common/backup_flow_helper.dart
@@ -85,7 +85,7 @@ Future<bool?> _handleFirstImportFlow(BuildContext context) async {
return null;
}
- // Start local import directly; SyncService can race it by also calling syncAll.
+ // Start only the local import; SyncService also runs syncAll.
_logger.info("Triggering local sync for first import from backup flow");
unawaited(LocalSyncService.instance.sync());
diff --git a/mobile/apps/photos/lib/utils/dialog_util.dart b/mobile/apps/photos/lib/utils/dialog_util.dart
index 0df54126cd..8f43cbd8cc 100644
--- a/mobile/apps/photos/lib/utils/dialog_util.dart
+++ b/mobile/apps/photos/lib/utils/dialog_util.dart
@@ -19,7 +19,6 @@ import 'package:photos/ui/components/dialog_widget.dart';
import 'package:photos/ui/components/models/button_type.dart';
import "package:photos/utils/email_util.dart";
-// Legacy wrapper around showDialogWidget.
Future<ButtonResult?> showInfoDialog(
BuildContext context, {
String title = "",
@@ -44,7 +43,6 @@ Future<ButtonResult?> showInfoDialog(
);
}
-// Legacy wrapper around showDialogWidget.
Future<ButtonResult?> showErrorDialog(
BuildContext context,
String title,
@@ -69,7 +67,6 @@ Future<ButtonResult?> showErrorDialog(
);
}
-// Legacy wrapper around showDialogWidget.
Future<ButtonResult?> showErrorDialogForException({
required BuildContext context,
required Exception exception,
@@ -169,7 +166,6 @@ String parseErrorForUI(
return genericError;
}
-// Legacy wrapper around showDialogWidget.
Future<ButtonResult?> showGenericErrorDialog({
required BuildContext context,
bool isDismissible = true,
@@ -243,7 +239,6 @@ Future<void> showGenericErrorBottomSheet({
);
}
-// Legacy wrapper around showDialogWidget.
Future<ButtonResult?> showChoiceDialog(
BuildContext context, {
required String title,
diff --git a/mobile/apps/photos/lib/utils/share_util.dart b/mobile/apps/photos/lib/utils/share_util.dart
index da38bc761d..46c7a84814 100644
--- a/mobile/apps/photos/lib/utils/share_util.dart
+++ b/mobile/apps/photos/lib/utils/share_util.dart
@@ -229,8 +229,10 @@ Future<List<EnteFile>> convertPicketAssets(
DateTime? parseDateFromFileNam1e(String fileName) {
if (fileName.startsWith('IMG-') || fileName.startsWith('VID-')) {
+ // Whatsapp media files
return DateTime.tryParse(fileName.split('-')[1]);
} else if (fileName.startsWith("Screenshot_")) {
+ // Screenshots on droid
return DateTime.tryParse(
(fileName).replaceAll('Screenshot_', '').replaceAll('-', 'T'),
);
diff --git a/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart b/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
index 2645752f91..96193338eb 100644
--- a/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
+++ b/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
@@ -84,6 +84,10 @@ EncryptionResult chachaEncryptData(Map<String, dynamic> args) {
);
}
+// chachaEncryptFileV2 does chucked encryption similar to chachaEncryptFile.
+// This implementation is refactored to simplify the logic to make it easier to
+// maintain and reason about.
+// Rolling out this version 2 in phases to ensure stability
Future<FileEncryptResult> chachaEncryptFileV2(Map<String, dynamic> args) async {
final encryptionStartTime = DateTime.now().millisecondsSinceEpoch;
final logger = Logger("chachaEncryptFileV2");
@@ -865,8 +869,7 @@ class CryptoUtil {
throw UnsupportedError("Cannot perform this operation on this device");
}
- // Used only for shared-link passwords, after the access token and collection
- // key.
+ // Shared-link passwords add a layer over the access token and collection key.
static Future<DerivedKeyResult> deriveInteractiveKey(
Uint8List password,
Uint8List salt,