Skip to content

armgit / ente

Public Imported from GitHub
0

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

Prune mobile comments

Manav Rathi57368e7dbdfa
diff --git a/mobile/apps/auth/lib/ente_theme_data.dart b/mobile/apps/auth/lib/ente_theme_data.dart
index fcad92286a..e130332975 100644
--- a/mobile/apps/auth/lib/ente_theme_data.dart
+++ b/mobile/apps/auth/lib/ente_theme_data.dart
@@ -40,7 +40,7 @@ final lightThemeData = ThemeData(
),
cardColor: const Color.fromRGBO(250, 250, 250, 1.0),
dialogTheme: const DialogThemeData().copyWith(
- backgroundColor: const Color.fromRGBO(250, 250, 250, 1.0), //
+ backgroundColor: const Color.fromRGBO(250, 250, 250, 1.0),
titleTextStyle: const TextStyle(
color: Colors.black,
fontSize: 24,
@@ -472,9 +472,9 @@ OutlinedButtonThemeData buildOutlinedButtonThemeData({
}
ElevatedButtonThemeData buildElevatedButtonThemeData({
- required Color onPrimary, // text button color
+ required Color onPrimary,
required Color primary,
- double elevation = 2, // background color of button
+ double elevation = 2,
}) {
return ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
diff --git a/mobile/apps/auth/lib/models/code.dart b/mobile/apps/auth/lib/models/code.dart
index c5c30ab0b7..632800fc0c 100644
--- a/mobile/apps/auth/lib/models/code.dart
+++ b/mobile/apps/auth/lib/models/code.dart
@@ -181,9 +181,7 @@ class Code {
if (path.startsWith('$issuer:')) {
return path.substring(issuer.length + 1);
}
- return path.substring(
- path.indexOf(':') + 1,
- ); // return data after first colon
+ return path.substring(path.indexOf(':') + 1);
} catch (e, s) {
Logger('_getAccount').severe('Error while parsing account', e, s);
return "";
@@ -266,7 +264,9 @@ class Code {
} else if (algorithm == "sha512" || "algorithm.sha512" == algorithm) {
return Algorithm.sha512;
}
- } catch (e) {}
+ } catch (e) {
+ // nothing
+ }
return Algorithm.sha1;
}
diff --git a/mobile/apps/auth/lib/ui/code_timer_progress.dart b/mobile/apps/auth/lib/ui/code_timer_progress.dart
index 6e2809c66a..1c5f3f5346 100644
--- a/mobile/apps/auth/lib/ui/code_timer_progress.dart
+++ b/mobile/apps/auth/lib/ui/code_timer_progress.dart
@@ -26,7 +26,7 @@ class _CodeTimerProgressState extends State<CodeTimerProgress> {
final int _updateIntervalMs = (Platform.isAndroid || Platform.isIOS)
? 16
- : 500; // approximately 60 FPS
+ : 500;
@override
void initState() {
@@ -74,7 +74,7 @@ class _CodeTimerProgressState extends State<CodeTimerProgress> {
valueListenable: _progress,
builder: (context, progress, _) {
return CustomPaint(
- key: Key(progress.toString()), // Add key here
+ key: Key(progress.toString()),
painter: _ProgressPainter(
progress: progress,
color: progress > 0.4
diff --git a/mobile/apps/auth/lib/ui/components/code_selection_actions_widget.dart b/mobile/apps/auth/lib/ui/components/code_selection_actions_widget.dart
index 90bdb7e869..0f133358b6 100644
--- a/mobile/apps/auth/lib/ui/components/code_selection_actions_widget.dart
+++ b/mobile/apps/auth/lib/ui/components/code_selection_actions_widget.dart
@@ -36,7 +36,6 @@ class _CodeSelectionActionsWidgetState
extends State<CodeSelectionActionsWidget> {
late final scrollController = ScrollController();
-
@override
void dispose() {
scrollController.dispose();
diff --git a/mobile/apps/auth/lib/ui/share/code_share.dart b/mobile/apps/auth/lib/ui/share/code_share.dart
index b6e4f809b6..aa8b82535e 100644
--- a/mobile/apps/auth/lib/ui/share/code_share.dart
+++ b/mobile/apps/auth/lib/ui/share/code_share.dart
@@ -129,11 +129,9 @@ class _ShareCodeDialogState extends State<ShareCodeDialog> {
Uint8List _generate256BitKey() {
final random = Random.secure();
- final bytes = Uint8List(32); // 32 bytes = 32 * 8 bits = 256 bits
+ final bytes = Uint8List(32);
for (int i = 0; i < bytes.length; i++) {
- bytes[i] = random.nextInt(
- 256,
- ); // Generates a random number between 0 and 255 (1 byte)
+ bytes[i] = random.nextInt(256);
}
return bytes;
}
diff --git a/mobile/apps/auth/lib/utils/email_util.dart b/mobile/apps/auth/lib/utils/email_util.dart
index eaa305de2d..41890ff3b8 100644
--- a/mobile/apps/auth/lib/utils/email_util.dart
+++ b/mobile/apps/auth/lib/utils/email_util.dart
@@ -209,7 +209,7 @@ Future<void> exportLogs(
final Size size = MediaQuery.of(context).size;
if (!isSharing) {
final DateTime now = DateTime.now().toUtc();
- final String shortMonthName = DateFormat('MMM').format(now); // Short month
+ final String shortMonthName = DateFormat('MMM').format(now);
final String logFileName =
'ente-logs-${now.year}-$shortMonthName-${now.day}-${now.hour}-${now.minute}';
diff --git a/mobile/apps/auth/lib/utils/navigation_util.dart b/mobile/apps/auth/lib/utils/navigation_util.dart
index cc980668d2..566396f716 100644
--- a/mobile/apps/auth/lib/utils/navigation_util.dart
+++ b/mobile/apps/auth/lib/utils/navigation_util.dart
@@ -52,8 +52,9 @@ PageRouteBuilder<T> _buildPageRoute<T extends Object>(Widget page) {
class SwipeableRouteBuilder<T> extends PageRoute<T> {
final RoutePageBuilder pageBuilder;
+ // Preserves the iOS back-swipe gesture.
final PageTransitionsBuilder matchingBuilder =
- const CupertinoPageTransitionsBuilder(); // Default iOS/macOS (to get the swipe right to go back gesture)
+ const CupertinoPageTransitionsBuilder();
SwipeableRouteBuilder({required this.pageBuilder});
@@ -76,7 +77,7 @@ class SwipeableRouteBuilder<T> extends PageRoute<T> {
bool get maintainState => true;
@override
- Duration get transitionDuration => const Duration(milliseconds: 300); // Can give custom Duration, unlike in MaterialPageRoute
+ Duration get transitionDuration => const Duration(milliseconds: 300);
@override
Widget buildTransitions(
diff --git a/mobile/apps/auth/pubspec.yaml b/mobile/apps/auth/pubspec.yaml
index db05955214..863d1395d8 100644
--- a/mobile/apps/auth/pubspec.yaml
+++ b/mobile/apps/auth/pubspec.yaml
@@ -78,12 +78,9 @@ dependencies:
flutter_localizations:
sdk: flutter
flutter_native_splash: 2.4.7
- # Do not upgrade this package unless this issue is resolved:
- # https://github.com/juliansteenbakker/flutter_secure_storage/issues/870
- # On v9.2.4, keys related to lockscreen persist even after reintsall. For context see:
+ # Version 9.2.4 leaves lock-screen keys behind after an app reinstall.
+ # Upgrade only after this is fixed or with a migration.
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/870#issuecomment-2777447937
- # Let's wait till the issue is resolved by the package maintainer.
- # If not resolved and we need to upgrade, write a migration script.
flutter_secure_storage: 9.0.0
flutter_speed_dial: 7.0.0
flutter_staggered_grid_view: 0.7.0
diff --git a/mobile/apps/locker/lib/models/file_type.dart b/mobile/apps/locker/lib/models/file_type.dart
index ec8c5e3281..5979b649e1 100644
--- a/mobile/apps/locker/lib/models/file_type.dart
+++ b/mobile/apps/locker/lib/models/file_type.dart
@@ -1,10 +1,4 @@
-enum FileType {
- image,
- video,
- livePhoto,
- other,
- info, // New type for information files
-}
+enum FileType { image, video, livePhoto, other, info }
int getInt(FileType fileType) {
switch (fileType) {
diff --git a/mobile/apps/locker/lib/services/files/offline/offline_file_storage.dart b/mobile/apps/locker/lib/services/files/offline/offline_file_storage.dart
index 5b627ecaff..bcae82d52c 100644
--- a/mobile/apps/locker/lib/services/files/offline/offline_file_storage.dart
+++ b/mobile/apps/locker/lib/services/files/offline/offline_file_storage.dart
@@ -170,7 +170,7 @@ Future<void> _deleteCachedFileCopies(
Set<int>? ids, {
Duration olderThan = Duration.zero,
}) async {
- // The cache directory is shared; only Locker's ID-keyed working files belong here.
+ // The cache is shared; only Locker's ID-keyed working files belong here.
final cacheDirectory = Directory(Configuration.instance.getCacheDirectory());
await _deleteMatchingFiles(
cacheDirectory,
diff --git a/mobile/apps/locker/lib/ui/mixins/search_mixin.dart b/mobile/apps/locker/lib/ui/mixins/search_mixin.dart
index 2d1bf5467d..795b083259 100644
--- a/mobile/apps/locker/lib/ui/mixins/search_mixin.dart
+++ b/mobile/apps/locker/lib/ui/mixins/search_mixin.dart
@@ -221,8 +221,7 @@ mixin SearchMixin<T extends StatefulWidget> on State<T> {
}
return true;
}
- }
- else if (event.logicalKey == LogicalKeyboardKey.keyF &&
+ } else if (event.logicalKey == LogicalKeyboardKey.keyF &&
(HardwareKeyboard.instance.isMetaPressed ||
HardwareKeyboard.instance.isControlPressed)) {
if (!_isSearchActive) {
diff --git a/mobile/apps/photos/ios/EnteAlbumWidget/EnteAlbumWidget.swift b/mobile/apps/photos/ios/EnteAlbumWidget/EnteAlbumWidget.swift
index e376237006..2564be089d 100644
--- a/mobile/apps/photos/ios/EnteAlbumWidget/EnteAlbumWidget.swift
+++ b/mobile/apps/photos/ios/EnteAlbumWidget/EnteAlbumWidget.swift
@@ -126,7 +126,7 @@ struct EnteAlbumWidgetEntryView: View {
VStack(alignment: .leading, spacing: 2) {
Text(entry.title ?? "").font(
.custom("Inter", size: 14, relativeTo: .caption)
- ) // Custom with fallback
+ )
.bold()
.foregroundStyle(.white)
.shadow(radius: 20)
@@ -170,7 +170,7 @@ struct EnteAlbumWidgetEntryView: View {
VStack(alignment: .leading, spacing: 2) {
Text(entry.title ?? "").font(
.custom("Inter", size: 14, relativeTo: .caption)
- ) // Custom with fallback
+ )
.bold()
.foregroundStyle(.white)
.shadow(radius: 20)
@@ -207,7 +207,7 @@ struct EnteAlbumWidgetEntryView: View {
Text("Click to customise")
.font(.custom("Inter", size: 12, relativeTo: .caption2))
- .foregroundStyle(.white) // Tint-aware color
+ .foregroundStyle(.white)
.multilineTextAlignment(.center)
.padding(.bottom, 12)
.padding(.horizontal, 8)
diff --git a/mobile/apps/photos/ios/EnteMemoryWidget/EnteMemoryWidget.swift b/mobile/apps/photos/ios/EnteMemoryWidget/EnteMemoryWidget.swift
index fbfb7fada5..06d6ca09ac 100644
--- a/mobile/apps/photos/ios/EnteMemoryWidget/EnteMemoryWidget.swift
+++ b/mobile/apps/photos/ios/EnteMemoryWidget/EnteMemoryWidget.swift
@@ -123,7 +123,7 @@ struct EnteMemoryWidgetEntryView: View {
VStack(alignment: .leading, spacing: 2) {
Text(entry.title ?? "").font(
.custom("Inter", size: 14, relativeTo: .caption)
- ) // Custom with fallback
+ )
.bold()
.foregroundStyle(.white)
.shadow(radius: 20)
@@ -167,7 +167,7 @@ struct EnteMemoryWidgetEntryView: View {
VStack(alignment: .leading, spacing: 2) {
Text(entry.title ?? "").font(
.custom("Inter", size: 14, relativeTo: .caption)
- ) // Custom with fallback
+ )
.bold()
.foregroundStyle(.white)
.shadow(radius: 20)
@@ -204,7 +204,7 @@ struct EnteMemoryWidgetEntryView: View {
Text("Click to customise")
.font(.custom("Inter", size: 12, relativeTo: .caption2))
- .foregroundStyle(.white) // Tint-aware color
+ .foregroundStyle(.white)
.multilineTextAlignment(.center)
.padding(.bottom, 12)
.padding(.horizontal, 8)
diff --git a/mobile/apps/photos/ios/EntePeopleWidget/EntePeopleWidget.swift b/mobile/apps/photos/ios/EntePeopleWidget/EntePeopleWidget.swift
index a9281277af..1580bab66c 100644
--- a/mobile/apps/photos/ios/EntePeopleWidget/EntePeopleWidget.swift
+++ b/mobile/apps/photos/ios/EntePeopleWidget/EntePeopleWidget.swift
@@ -126,7 +126,7 @@ struct EntePeopleWidgetEntryView: View {
VStack(alignment: .leading, spacing: 2) {
Text(entry.title ?? "").font(
.custom("Inter", size: 14, relativeTo: .caption)
- ) // Custom with fallback
+ )
.bold()
.foregroundStyle(.white)
.shadow(radius: 20)
@@ -170,7 +170,7 @@ struct EntePeopleWidgetEntryView: View {
VStack(alignment: .leading, spacing: 2) {
Text(entry.title ?? "").font(
.custom("Inter", size: 14, relativeTo: .caption)
- ) // Custom with fallback
+ )
.bold()
.foregroundStyle(.white)
.shadow(radius: 20)
@@ -207,7 +207,7 @@ struct EntePeopleWidgetEntryView: View {
Text("Click to customise")
.font(.custom("Inter", size: 12, relativeTo: .caption2))
- .foregroundStyle(.white) // Tint-aware color
+ .foregroundStyle(.white)
.multilineTextAlignment(.center)
.padding(.bottom, 12)
.padding(.horizontal, 8)
diff --git a/mobile/apps/photos/lib/extensions/ml_linalg_extensions.dart b/mobile/apps/photos/lib/extensions/ml_linalg_extensions.dart
index 71387a3afd..8249ba595d 100644
--- a/mobile/apps/photos/lib/extensions/ml_linalg_extensions.dart
+++ b/mobile/apps/photos/lib/extensions/ml_linalg_extensions.dart
@@ -43,8 +43,8 @@ extension SetMatrixValues on Matrix {
endColumn > columnCount) {
throw Exception('Range must be within matrix');
}
- final tempList = asFlattenedList
- .toList(); // You need `.toList()` here to make sure the list is growable, otherwise `replaceRange` will throw an error
+ // replaceRange requires a growable list.
+ final tempList = asFlattenedList.toList();
for (var i = startRow; i < endRow; i++) {
tempList.replaceRange(
i * columnCount + startColumn,
@@ -72,8 +72,8 @@ extension SetMatrixValues on Matrix {
throw Exception('Range must be within matrix');
}
- final tempList = asFlattenedList
- .toList(); // You need `.toList()` here to make sure the list is growable, otherwise `replaceRange` will throw an error
+ // replaceRange requires a growable list.
+ final tempList = asFlattenedList.toList();
var index = 0;
for (var i = startRow; i < endRow; i++) {
for (var j = startColumn; j < endColumn; j++) {
diff --git a/mobile/apps/photos/lib/locale.dart b/mobile/apps/photos/lib/locale.dart
index e5e434b795..e16c4b978d 100644
--- a/mobile/apps/photos/lib/locale.dart
+++ b/mobile/apps/photos/lib/locale.dart
@@ -51,11 +51,7 @@ Locale localResolutionCallBack(
return autoDetectedLocale ?? const Locale('en');
}
-// This is used to get locale that should be used for various formatting
-// operations like date, time, number etc. For common languages like english, different
-// locale might have different formats. For example, en_US and en_GB have different
-// formats for date and time. Use this method to find the best locale for formatting
-// operations. This is not used for displaying text in the app.
+// Preserve the device region for dates, times, and numbers.
Future<Locale> getFormatLocale() async {
final Locale locale = (await getLocale())!;
Locale? firstLanguageMatch;
diff --git a/mobile/apps/photos/lib/models/collection/collection.dart b/mobile/apps/photos/lib/models/collection/collection.dart
index ea03f2cd57..7227c1b5e3 100644
--- a/mobile/apps/photos/lib/models/collection/collection.dart
+++ b/mobile/apps/photos/lib/models/collection/collection.dart
@@ -17,7 +17,7 @@ class Collection {
// Deprecated but required for old accounts. Use collectionName.
String? name;
- // Legacy collections may have only the plaintext name.
+ // Collections created before public launch may have only the plaintext name.
final String? encryptedName;
final String? nameDecryptionNonce;
final CollectionType type;
@@ -28,7 +28,7 @@ class Collection {
final int? sharedAt;
final bool isDeleted;
- // Falls back to the legacy plaintext name.
+ // Falls back to name for those pre-launch collections.
String? decryptedName;
// Links a user-owned remote collection to its on-device album.
diff --git a/mobile/apps/photos/lib/models/ffmpeg/ffprobe_props.dart b/mobile/apps/photos/lib/models/ffmpeg/ffprobe_props.dart
index c5f17c9531..157cb8856b 100644
--- a/mobile/apps/photos/lib/models/ffmpeg/ffprobe_props.dart
+++ b/mobile/apps/photos/lib/models/ffmpeg/ffprobe_props.dart
@@ -340,7 +340,8 @@ class FFProbeProps {
static final _durationSmPattern = RegExp(r'(\d+)(.\d+)');
static final _locationPattern = RegExp(r'([+-][.0-9]+)');
- // format ISO 6709 input, e.g. '+37.5090+127.0243/' (Samsung), '+51.3328-000.7053+113.474/' (Apple)
+ // ISO 6709 examples: '+37.5090+127.0243/' (Samsung) and
+ // '+51.3328-000.7053+113.474/' (Apple).
static Location? _formatLocation(String? value) {
if (value == null) return null;
final matches = _locationPattern.allMatches(value);
diff --git a/mobile/apps/photos/lib/models/ffmpeg/language.dart b/mobile/apps/photos/lib/models/ffmpeg/language.dart
index fd23d38caa..49f74836a8 100644
--- a/mobile/apps/photos/lib/models/ffmpeg/language.dart
+++ b/mobile/apps/photos/lib/models/ffmpeg/language.dart
@@ -6,9 +6,9 @@ class Language {
const Language({required this.iso639_2, required this.name, this.native});
- // subset of ISO 639-2 codes for living languages (including macrolanguages, excluding constructed and collective ones)
- // synonyms for terminology and bibliographic applications (ISO 639-2/T and ISO 639-2/B) are separate entries
- // some entries have been simplified to keep only one name for one code
+ // ISO 639-2 living languages, including macrolanguages but excluding
+ // constructed and collective codes. Terminological and bibliographic aliases
+ // are separate entries; some names are simplified.
static const living639_2 = [
Language(
iso639_2: 'aar',
diff --git a/mobile/apps/photos/lib/models/file/trash_file.dart b/mobile/apps/photos/lib/models/file/trash_file.dart
index f62ecbfccc..adbca99b9f 100644
--- a/mobile/apps/photos/lib/models/file/trash_file.dart
+++ b/mobile/apps/photos/lib/models/file/trash_file.dart
@@ -5,6 +5,7 @@ sealed class TrashFile extends EnteFile {
TrashFile.from(super.file, {required this.deleteBy}) : super.from();
+ // Time when deletion frees the user's storage.
late int deleteBy;
}
@@ -18,8 +19,10 @@ class EnteTrashFile extends TrashFile {
required this.updateAt,
}) : super.from();
+ // Time first moved to Trash.
late int createdAt;
+ // Most recent move to Trash for active entries.
late int updateAt;
}
diff --git a/mobile/apps/photos/lib/models/preview/preview_item_status.dart b/mobile/apps/photos/lib/models/preview/preview_item_status.dart
index f4b5ea4905..055e1cc7dd 100644
--- a/mobile/apps/photos/lib/models/preview/preview_item_status.dart
+++ b/mobile/apps/photos/lib/models/preview/preview_item_status.dart
@@ -5,6 +5,5 @@ enum PreviewItemStatus {
inQueue,
retry,
uploaded,
- // paused (e.g., due to uploads in progress)
paused,
}
diff --git a/mobile/apps/photos/lib/models/upload_strategy.dart b/mobile/apps/photos/lib/models/upload_strategy.dart
index 958ff27238..4f3c5c20e6 100644
--- a/mobile/apps/photos/lib/models/upload_strategy.dart
+++ b/mobile/apps/photos/lib/models/upload_strategy.dart
@@ -1,8 +1,4 @@
-enum UploadStrategy {
- ifMissing,
- always,
- other,
-}
+enum UploadStrategy { ifMissing, always, other }
int getInt(UploadStrategy uploadType) {
switch (uploadType) {
diff --git a/mobile/apps/photos/lib/module/download/thumbnail.dart b/mobile/apps/photos/lib/module/download/thumbnail.dart
index a31367d50a..1cc0f445f2 100644
--- a/mobile/apps/photos/lib/module/download/thumbnail.dart
+++ b/mobile/apps/photos/lib/module/download/thumbnail.dart
@@ -36,7 +36,7 @@ class _ThumbnailDownload {
final EnteFile file;
final Completer<Uint8List> completer;
final CancelToken cancelToken;
- int counter = 0; // number of times file download was requested
+ int counter = 0;
_ThumbnailDownload(this.file, this.completer, this.cancelToken, this.counter);
}
@@ -378,7 +378,7 @@ Future<void> _downloadAndDecryptThumbnail(_ThumbnailDownload item) async {
}
ThumbnailInMemoryLruCache.put(item.file, data);
final cachedThumbnail = cachedThumbnailPath(item.file);
- // The in-memory cache makes the disk write non-blocking.
+ // Readers can use the in-memory copy while this is written to disk.
unawaited(_writeCachedThumbnail(cachedThumbnail, data));
if (!item.completer.isCompleted) {
item.completer.complete(data);
diff --git a/mobile/apps/photos/lib/services/magic_cache_service.dart b/mobile/apps/photos/lib/services/magic_cache_service.dart
index eecd325d8d..22c9d61294 100644
--- a/mobile/apps/photos/lib/services/magic_cache_service.dart
+++ b/mobile/apps/photos/lib/services/magic_cache_service.dart
@@ -115,7 +115,7 @@ String getLocalizedTitleForL10n(StringsLocalizations l10n, String title) {
case 'Greenery':
return l10n.discover_greenery;
default:
- return title; // If no match, return the original string
+ return title;
}
}
diff --git a/mobile/apps/photos/lib/services/rituals/rituals_service.dart b/mobile/apps/photos/lib/services/rituals/rituals_service.dart
index 938ea4279a..c16a9bcca8 100644
--- a/mobile/apps/photos/lib/services/rituals/rituals_service.dart
+++ b/mobile/apps/photos/lib/services/rituals/rituals_service.dart
@@ -445,7 +445,6 @@ class RitualsService {
if (isNew || albumChanged) {
await refresh();
} else {
- // No ritual completion data changes; just update rituals in state.
stateNotifier.value = stateNotifier.value.copyWith(
rituals: rituals,
loading: false,
diff --git a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
index e3f57191fd..2095f8137e 100644
--- a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
@@ -854,13 +854,10 @@ class RemoteSyncService {
.map((e) => e.modificationTime ?? 0)
.reduce(max);
- /* Note: In case of iOS, we will miss any asset modification in
- between of two installation. This is done to avoid fetching assets
- from iCloud when modification time could have changed for number of
- reasons. To fix this, we need to identify a way to store version
- for the adjustments or just if the asset has been modified ever.
- https://stackoverflow.com/a/50093266/546896
- */
+ // Do not use modification time to detect iOS edits. It can change for
+ // other reasons, and detecting adjustments can fetch the asset from
+ // iCloud. Edits made between installs can therefore be missed.
+ // https://stackoverflow.com/a/50093266/546896
if (maxModificationTime > remoteFile.modificationTime! &&
Platform.isAndroid) {
localButUpdatedOnDevice++;
diff --git a/mobile/apps/photos/lib/ui/actions/collection/collection_sharing_actions.dart b/mobile/apps/photos/lib/ui/actions/collection/collection_sharing_actions.dart
index 323216af53..69caf47f56 100644
--- a/mobile/apps/photos/lib/ui/actions/collection/collection_sharing_actions.dart
+++ b/mobile/apps/photos/lib/ui/actions/collection/collection_sharing_actions.dart
@@ -553,23 +553,9 @@ class CollectionActions {
actionResult!.action == ButtonAction.first;
}
- /*
- _moveFilesFromCurrentCollection removes the file from the current
- collection. Based on the file and collection ownership, files will be
- either moved to different collection (Case A). or will just get removed
- from current collection (Case B).
- -------------------------------
- Case A: Files and collection belong to the same user. Such files
- will be moved to a collection which belongs to the user and removed from
- the current collection as part of move operation.
- Note: Even files are present in the
- destination collection, we need to make move API call on the server
- so that the files are removed from current collection and are actually
- moved to a collection owned by the user.
- -------------------------------
- Case B: Owner of files and collections are different. In such cases,
- we will just remove (not move) the files from the given collection.
- */
+ // Moving an owned file must call the move API even if it is already in
+ // another owned collection, because move also removes it from this one.
+ // Files owned by someone else can only be removed from this collection.
Future<void> moveFilesFromCurrentCollection(
BuildContext? context,
Collection collection,
@@ -605,8 +591,6 @@ class CollectionActions {
split.ownedByOtherUsers,
);
} else if (!isCollectionOwner && split.ownedByCurrentUser.isNotEmpty) {
- // collection is not owned by the user, just remove files owned
- // by current user and return
await collectionsService.removeFromCollection(
collection.id,
split.ownedByCurrentUser,
diff --git a/mobile/apps/photos/lib/ui/common/popup_item.dart b/mobile/apps/photos/lib/ui/common/popup_item.dart
index d6aeace28b..df9daedb61 100644
--- a/mobile/apps/photos/lib/ui/common/popup_item.dart
+++ b/mobile/apps/photos/lib/ui/common/popup_item.dart
@@ -33,6 +33,6 @@ class EntePopupMenuItem<T> extends PopupMenuItem<T> {
const Padding(padding: EdgeInsets.all(8)),
Text(label, style: TextStyle(color: labelColor)),
],
- ), // Initially empty, will be populated in build
+ ),
);
}
diff --git a/mobile/apps/photos/lib/ui/common/popup_item_async.dart b/mobile/apps/photos/lib/ui/common/popup_item_async.dart
index 26b4787ef8..4d51a5db18 100644
--- a/mobile/apps/photos/lib/ui/common/popup_item_async.dart
+++ b/mobile/apps/photos/lib/ui/common/popup_item_async.dart
@@ -43,6 +43,6 @@ class EntePopupMenuItemAsync<T, U> extends PopupMenuItem<T> {
],
);
},
- ), // Initially empty, will be populated in build
+ ),
);
}
diff --git a/mobile/apps/photos/lib/ui/common/web_page.dart b/mobile/apps/photos/lib/ui/common/web_page.dart
index a5a8840bfd..c5ccc038a6 100644
--- a/mobile/apps/photos/lib/ui/common/web_page.dart
+++ b/mobile/apps/photos/lib/ui/common/web_page.dart
@@ -29,7 +29,7 @@ class _WebPageState extends State<WebPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
- // force dark theme for appBar till website/family plans add supports for light theme
+ // Keep the app bar dark until the website supports a light theme.
backgroundColor: const Color.fromRGBO(10, 20, 20, 1.0),
foregroundColor: Colors.white,
iconTheme: const IconThemeData(color: Colors.white),
diff --git a/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart b/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
index 7336a2746a..adde9e8f29 100644
--- a/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
+++ b/mobile/apps/photos/lib/ui/sharing/more_count_badge.dart
@@ -60,10 +60,7 @@ class MoreCountWidget extends StatelessWidget {
backgroundColor: decorationColor,
child: Transform.scale(
scale: 0.85,
- child: Text(
- displayChar.toUpperCase(),
- style: textStyle,
- ),
+ child: Text(displayChar.toUpperCase(), style: textStyle),
),
),
),
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index b5382fec1a..1c1b3e61f8 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -447,7 +447,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
if (_scrollTargetCommentID != null &&
_scrollTargetCommentID != parentCommentID) {
- return; // Abort, another scroll is in progress
+ return;
}
index = _comments.indexWhere((c) => c.id == parentCommentID);
diff --git a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
index 5b3cd62b74..0dd21bfa14 100644
--- a/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
+++ b/mobile/apps/photos/lib/ui/tools/editor/image_editor/image_editor_page.dart
@@ -151,8 +151,6 @@ class _ImageEditorPageState extends State<ImageEditorPage> {
_logger.info("Saved edits to file " + newFile.toString());
final files = List<ente.EnteFile>.of(widget.detailPageConfig.files);
- // the index could be -1 if the files fetched doesn't contain the newly
- // edited files
int selectionIndex = files.indexWhere(
(file) => file.generatedID == newFile.generatedID,
);
diff --git a/mobile/apps/photos/lib/ui/tools/similar_images_page.dart b/mobile/apps/photos/lib/ui/tools/similar_images_page.dart
index 4b513d9aff..f2268d363b 100644
--- a/mobile/apps/photos/lib/ui/tools/similar_images_page.dart
+++ b/mobile/apps/photos/lib/ui/tools/similar_images_page.dart
@@ -776,8 +776,7 @@ class _SimilarImagesPageState extends State<SimilarImagesPage> {
return Wrap(
spacing: crossAxisSpacing,
- runSpacing:
- 0, // No additional vertical spacing - items have internal bottom padding
+ runSpacing: 0,
children: similarFiles.files.asMap().entries.map((entry) {
return SizedBox(
width: itemWidth,
diff --git a/mobile/apps/photos/lib/ui/viewer/file/ocr/inline_text_detection.dart b/mobile/apps/photos/lib/ui/viewer/file/ocr/inline_text_detection.dart
index 6d42bd9d79..cf582bbc3c 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/ocr/inline_text_detection.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/ocr/inline_text_detection.dart
@@ -376,7 +376,7 @@ class _InlineTextDetectionState extends State<InlineTextDetection> {
void _handleLongPressAt(Offset globalPosition) {
if (!_isEligible) return;
- if (_overlayActive) return; // Already active, let overlay handle it
+ if (_overlayActive) return;
if (!_isGlobalPointEligibleForOcrGesture(globalPosition)) return;
if (_isPreparingOnDemand) return;
setState(() {
diff --git a/mobile/apps/photos/lib/utils/cache_util.dart b/mobile/apps/photos/lib/utils/cache_util.dart
index d21c1d881c..99d8c62653 100644
--- a/mobile/apps/photos/lib/utils/cache_util.dart
+++ b/mobile/apps/photos/lib/utils/cache_util.dart
@@ -75,9 +75,7 @@ Future<P?> _decodeJsonFile<P>(Map<String, dynamic> args) async {
log("Successfully decoded JSON file as UTF-8");
} catch (e, s) {
log("Failed to decode bytes as UTF-8, trying UTF-16 $e \n $s");
- final jsonString = String.fromCharCodes(
- bytes,
- ); // Fallback to UTF-16 decoding
+ final jsonString = String.fromCharCodes(bytes);
decodedData = jsonDecodeMethod(jsonString);
log("Successfully decoded JSON file as UTF-16");
}
diff --git a/mobile/apps/photos/lib/utils/delete_file_util.dart b/mobile/apps/photos/lib/utils/delete_file_util.dart
index 9f42df8cd9..3b56db1d8a 100644
--- a/mobile/apps/photos/lib/utils/delete_file_util.dart
+++ b/mobile/apps/photos/lib/utils/delete_file_util.dart
@@ -308,28 +308,25 @@ Future<bool> deleteFromTrash(BuildContext context, List<EnteFile> files) async {
ButtonComponent(
label: l10n.yesDelete,
variant: ButtonComponentVariant.critical,
- onTap: () => _runDeleteAction(
- sheetContext,
- ButtonAction.first,
- () async {
- try {
- didDeletionStart = true;
- await trashSyncService.deleteFromTrash(trashFiles);
- Bus.instance.fire(
- FilesUpdatedEvent(
- trashFiles,
- type: EventType.deletedFromEverywhere,
- source: "deleteFromTrash",
- ),
- );
- // FilesUpdatedEvent does not reload Trash here.
- Bus.instance.fire(ForceReloadTrashPageEvent());
- } catch (e, s) {
- _logger.info("failed to delete from trash", e, s);
- rethrow;
- }
- },
- ),
+ onTap: () =>
+ _runDeleteAction(sheetContext, ButtonAction.first, () async {
+ try {
+ didDeletionStart = true;
+ await trashSyncService.deleteFromTrash(trashFiles);
+ Bus.instance.fire(
+ FilesUpdatedEvent(
+ trashFiles,
+ type: EventType.deletedFromEverywhere,
+ source: "deleteFromTrash",
+ ),
+ );
+ // FilesUpdatedEvent does not reload Trash here.
+ Bus.instance.fire(ForceReloadTrashPageEvent());
+ } catch (e, s) {
+ _logger.info("failed to delete from trash", e, s);
+ rethrow;
+ }
+ }),
),
],
),
@@ -1265,8 +1262,7 @@ class DeleteConfirmationSheetState extends State<DeleteConfirmationSheet> {
),
],
)
- :
- ButtonComponent(
+ : ButtonComponent(
label: switch (deletePreference) {
DeletePreference.DeleteFromRemoteOnly =>
l10n.deleteFromEnte,
diff --git a/mobile/apps/photos/lib/utils/face/face_thumbnail_cache.dart b/mobile/apps/photos/lib/utils/face/face_thumbnail_cache.dart
index 377435abdf..010a666add 100644
--- a/mobile/apps/photos/lib/utils/face/face_thumbnail_cache.dart
+++ b/mobile/apps/photos/lib/utils/face/face_thumbnail_cache.dart
@@ -408,10 +408,7 @@ Future<Map<String, Uint8List>?> _getFaceCrops(
faceBoxes.add(e.value);
}
final List<Uint8List> faceCrop = await FaceThumbnailGenerator.instance
- .generateFaceThumbnails(
- imagePath,
- faceBoxes,
- );
+ .generateFaceThumbnails(imagePath, faceBoxes);
final Map<String, Uint8List> result = {};
for (int i = 0; i < faceCrop.length; i++) {
result[faceIds[i]] = faceCrop[i];
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 8dfd04f9f8..2645752f91 100644
--- a/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
+++ b/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
@@ -114,7 +114,7 @@ Future<FileEncryptResult> chachaEncryptFileV2(Map<String, dynamic> args) async {
while (buffer.length < chunkSize) {
final remainingBytes = chunkSize - buffer.length;
final readBytes = await inputFile.read(remainingBytes);
- if (readBytes.isEmpty) break; // EOF reached unexpectedly
+ if (readBytes.isEmpty) break;
buffer.add(readBytes);
}
@@ -531,9 +531,7 @@ Future<void> chachaVerifyFile(Map<String, dynamic> args) async {
final int chunkLimit = args["chunkLimit"] ?? 1;
final bool verifyEntireFile = chunkLimit == -1;
- final chunksToVerify = verifyEntireFile
- ? 999999999
- : chunkLimit;
+ final chunksToVerify = verifyEntireFile ? 999999999 : chunkLimit;
var bytesRead = 0;
var chunksVerified = 0;
diff --git a/mobile/apps/photos/pubspec.yaml b/mobile/apps/photos/pubspec.yaml
index b4598243fd..93c4ab5047 100644
--- a/mobile/apps/photos/pubspec.yaml
+++ b/mobile/apps/photos/pubspec.yaml
@@ -110,12 +110,9 @@ dependencies:
flutter_map: 7.0.2
flutter_map_marker_cluster: 1.4.0
flutter_rust_bridge: 2.12.0
- # Do not upgrade this package unless this issue is resolved:
- # https://github.com/juliansteenbakker/flutter_secure_storage/issues/870
- # On v9.2.4, keys related to lockscreen persist even after reintsall. For context see:
+ # Version 9.2.4 leaves lock-screen keys behind after an app reinstall.
+ # Upgrade only after this is fixed or with a migration.
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/870#issuecomment-2777447937
- # Let's wait till the issue is resolved by the package maintainer.
- # If not resolved and we need to upgrade, write a migration script.
flutter_secure_storage: 9.0.0
flutter_sodium:
git:
diff --git a/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec b/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec
index 1c2ad957f7..a12db0ac29 100644
--- a/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec
+++ b/mobile/apps/photos/rust_builder/ios/ente_photos_rust.podspec
@@ -1,7 +1,3 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint ente_photos_rust.podspec` to validate before publishing.
-#
Pod::Spec.new do |s|
s.name = 'ente_photos_rust'
s.version = '0.0.1'
diff --git a/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec b/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec
index bc0f230008..44ed1c8235 100644
--- a/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec
+++ b/mobile/apps/photos/rust_builder/macos/ente_photos_rust.podspec
@@ -1,7 +1,3 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint ente_photos_rust.podspec` to validate before publishing.
-#
Pod::Spec.new do |s|
s.name = 'ente_photos_rust'
s.version = '0.0.1'
diff --git a/mobile/apps/photos/test/services/memories/photo_selector_test.dart b/mobile/apps/photos/test/services/memories/photo_selector_test.dart
index 8726efc265..050208a5f5 100644
--- a/mobile/apps/photos/test/services/memories/photo_selector_test.dart
+++ b/mobile/apps/photos/test/services/memories/photo_selector_test.dart
@@ -106,20 +106,18 @@ void main() {
test('isTooCloseInTime detects gap < 10 minutes', () {
expect(
- PhotoSelector.isTooCloseInTime(
- _baseTime,
- [_baseTime + 5 * 60 * 1000000], // 5 minutes apart
- ),
+ PhotoSelector.isTooCloseInTime(_baseTime, [
+ _baseTime + 5 * 60 * 1000000,
+ ]),
isTrue,
);
});
test('isTooCloseInTime allows gap >= 10 minutes', () {
expect(
- PhotoSelector.isTooCloseInTime(
- _baseTime,
- [_baseTime + 15 * 60 * 1000000], // 15 minutes apart
- ),
+ PhotoSelector.isTooCloseInTime(_baseTime, [
+ _baseTime + 15 * 60 * 1000000,
+ ]),
isFalse,
);
});
@@ -160,7 +158,7 @@ void main() {
final ids = result.map((m) => m.file.uploadedFileID).toList();
expect(ids, contains(1));
expect(ids, contains(3));
- expect(ids, isNot(contains(2))); // near-duplicate of 1
+ expect(ids, isNot(contains(2)));
});
test('filterByTimeSpacing removes memories too close in time', () {
@@ -168,7 +166,7 @@ void main() {
_mem(_file(uploadedFileID: 1, creationTime: _baseTime)),
_mem(
_file(uploadedFileID: 2, creationTime: _baseTime + 5 * 60 * 1000000),
- ), // 5 min later
+ ),
_mem(_file(uploadedFileID: 3, creationTime: _baseTime + _hour)),
];
final result = PhotoSelector.filterByTimeSpacing(memories);
diff --git a/mobile/apps/photos/test/services/video_preview_service_test.dart b/mobile/apps/photos/test/services/video_preview_service_test.dart
index 4e2c8cf2d0..1c3305fa59 100644
--- a/mobile/apps/photos/test/services/video_preview_service_test.dart
+++ b/mobile/apps/photos/test/services/video_preview_service_test.dart
@@ -46,10 +46,7 @@ void main() {
];
final previewIds = <int, PreviewInfo>{
- 2: PreviewInfo(
- objectId: 'obj2',
- objectSize: 1000,
- ), // Only file 2 is processed
+ 2: PreviewInfo(objectId: 'obj2', objectSize: 1000),
};
final status = await videoPreviewService.calcStatus(files, previewIds);
@@ -91,7 +88,7 @@ void main() {
..pubMagicMetadata = PubMagicMetadata(),
];
- final previewIds = <int, PreviewInfo>{}; // No files processed
+ final previewIds = <int, PreviewInfo>{};
final status = await videoPreviewService.calcStatus(files, previewIds);
@@ -107,14 +104,14 @@ void main() {
EnteFile()
..uploadedFileID = 2
..fileType = FileType.video
- ..pubMagicMetadata = PubMagicMetadata(sv: 1), // Should be skipped
+ ..pubMagicMetadata = PubMagicMetadata(sv: 1),
EnteFile()
..uploadedFileID = 3
..fileType = FileType.video
..pubMagicMetadata = PubMagicMetadata(),
];
- final previewIds = <int, PreviewInfo>{}; // No files processed
+ final previewIds = <int, PreviewInfo>{};
final status = await videoPreviewService.calcStatus(files, previewIds);
@@ -130,9 +127,7 @@ void main() {
EnteFile()
..uploadedFileID = 2
..fileType = FileType.video
- ..pubMagicMetadata = PubMagicMetadata(
- sv: 1,
- ), // Processed but with sv=1
+ ..pubMagicMetadata = PubMagicMetadata(sv: 1),
EnteFile()
..uploadedFileID = 3
..fileType = FileType.video
@@ -140,10 +135,7 @@ void main() {
];
final previewIds = <int, PreviewInfo>{
- 2: PreviewInfo(
- objectId: 'obj2',
- objectSize: 1000,
- ), // File 2 is processed
+ 2: PreviewInfo(objectId: 'obj2', objectSize: 1000),
};
final status = await videoPreviewService.calcStatus(files, previewIds);
@@ -165,36 +157,29 @@ void main() {
EnteFile()
..uploadedFileID = 1
..fileType = FileType.video
- ..pubMagicMetadata = PubMagicMetadata(), // Regular file
+ ..pubMagicMetadata = PubMagicMetadata(),
EnteFile()
..uploadedFileID = 2
..fileType = FileType.video
- ..pubMagicMetadata = PubMagicMetadata(
- sv: 1,
- ), // Skip from total (sv=1)
+ ..pubMagicMetadata = PubMagicMetadata(sv: 1),
EnteFile()
..uploadedFileID = 3
..fileType = FileType.video
- ..pubMagicMetadata = PubMagicMetadata(), // Regular file
+ ..pubMagicMetadata = PubMagicMetadata(),
EnteFile()
..uploadedFileID = 4
..fileType = FileType.video
- ..pubMagicMetadata = PubMagicMetadata(), // Regular file
+ ..pubMagicMetadata = PubMagicMetadata(),
EnteFile()
..uploadedFileID = 5
..fileType = FileType.video
- ..pubMagicMetadata = PubMagicMetadata(
- sv: 1,
- ), // Skip from total (sv=1)
+ ..pubMagicMetadata = PubMagicMetadata(sv: 1),
];
final previewIds = <int, PreviewInfo>{
- 1: PreviewInfo(objectId: 'obj1', objectSize: 1000), // File 1 processed
- 3: PreviewInfo(objectId: 'obj3', objectSize: 1000), // File 3 processed
- 5: PreviewInfo(
- objectId: 'obj5',
- objectSize: 1000,
- ), // File 5 processed (but has sv=1)
+ 1: PreviewInfo(objectId: 'obj1', objectSize: 1000),
+ 3: PreviewInfo(objectId: 'obj3', objectSize: 1000),
+ 5: PreviewInfo(objectId: 'obj5', objectSize: 1000),
};
final status = await videoPreviewService.calcStatus(files, previewIds);
@@ -207,7 +192,7 @@ void main() {
EnteFile()
..uploadedFileID = 1
..fileType = FileType.video
- ..pubMagicMetadata = null, // null metadata
+ ..pubMagicMetadata = null,
EnteFile()
..uploadedFileID = 2
..fileType = FileType.video
diff --git a/mobile/apps/photos/test/ui/viewer/file/panorama_viewer_screen_test.dart b/mobile/apps/photos/test/ui/viewer/file/panorama_viewer_screen_test.dart
index 939ac47765..dfddeed900 100644
--- a/mobile/apps/photos/test/ui/viewer/file/panorama_viewer_screen_test.dart
+++ b/mobile/apps/photos/test/ui/viewer/file/panorama_viewer_screen_test.dart
@@ -154,7 +154,6 @@ void main() {
expect(pano.initialView!.longitude, closeTo(125.81, 0.01));
expect(pano.initialView!.latitude, closeTo(13.09, 0.01));
- // Let the auto-hide timer fire and dispose the screen.
await tester.pump(const Duration(seconds: 6));
await tester.pumpWidget(const SizedBox());
},
diff --git a/mobile/apps/photos/test/utils/date_query_parsing_test.dart b/mobile/apps/photos/test/utils/date_query_parsing_test.dart
index 69c5798acd..5f0fd144e1 100644
--- a/mobile/apps/photos/test/utils/date_query_parsing_test.dart
+++ b/mobile/apps/photos/test/utils/date_query_parsing_test.dart
@@ -240,8 +240,8 @@ void main() {
'should parse short MM/DD format "02/25" (no year, handled by tokenized)',
() {
final PartialDate parsedDate = dateParseService.parse('02/25');
- expect(parsedDate.day, 25); // value 25 is assigned to day first
- expect(parsedDate.month, 2); // value 02 is assigned to month
+ expect(parsedDate.day, 25);
+ expect(parsedDate.month, 2);
expect(parsedDate.year, isNull);
},
);
@@ -260,21 +260,21 @@ void main() {
final PartialDate parsedDate = dateParseService.parse('25/02/25');
expect(parsedDate.day, 25);
expect(parsedDate.month, 2);
- expect(parsedDate.year, 2025); // Based on _convertTwoDigitYear pivot
+ expect(parsedDate.year, 2025);
});
test('should parse two-digit year "01/01/01" as 2001', () {
final PartialDate parsedDate = dateParseService.parse('01/01/01');
expect(parsedDate.day, 1);
expect(parsedDate.month, 1);
- expect(parsedDate.year, 2001); // 01 < _TWO_DIGIT_YEAR_PIVOT
+ expect(parsedDate.year, 2001);
});
test('should parse two-digit year "01/01/99" as 1999', () {
final PartialDate parsedDate = dateParseService.parse('01/01/99');
expect(parsedDate.day, 1);
expect(parsedDate.month, 1);
- expect(parsedDate.year, 1999); // 99 > _TWO_DIGIT_YEAR_PIVOT
+ expect(parsedDate.year, 1999);
});
});
diff --git a/mobile/packages/configuration/lib/base_configuration.dart b/mobile/packages/configuration/lib/base_configuration.dart
index 0e85333893..8db9cd4d95 100644
--- a/mobile/packages/configuration/lib/base_configuration.dart
+++ b/mobile/packages/configuration/lib/base_configuration.dart
@@ -423,10 +423,8 @@ abstract class BaseConfiguration {
_secretKey = await _secureStorage.read(key: secretKeyKey);
} catch (e, s) {
_logger.severe("Configuration init failed", e, s);
- /*
- Check if it's a known is related to reading secret from secure storage
- on android https://github.com/mogol/flutter_secure_storage/issues/541
- */
+ // BadPaddingException can mean Android secure storage is inaccessible.
+ // https://github.com/mogol/flutter_secure_storage/issues/541
if (e is PlatformException) {
final PlatformException error = e;
final bool isBadPaddingError =
diff --git a/mobile/packages/configuration/pubspec.yaml b/mobile/packages/configuration/pubspec.yaml
index d5104df9fb..85d8657f9d 100644
--- a/mobile/packages/configuration/pubspec.yaml
+++ b/mobile/packages/configuration/pubspec.yaml
@@ -18,12 +18,9 @@ dependencies:
path: ../../packages/logging
flutter:
sdk: flutter
- # Do not upgrade this package unless this issue is resolved:
- # https://github.com/juliansteenbakker/flutter_secure_storage/issues/870
- # On v9.2.4, keys related to lockscreen persist even after reintsall. For context see:
+ # Version 9.2.4 leaves lock-screen keys behind after an app reinstall.
+ # Upgrade only after this is fixed or with a migration.
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/870#issuecomment-2777447937
- # Let's wait till the issue is resolved by the package maintainer.
- # If not resolved and we need to upgrade, write a migration script.
flutter_secure_storage: 9.0.0
path: 1.9.1
path_provider: 2.1.5
diff --git a/mobile/packages/ente_pure_utils/lib/src/task_queue.dart b/mobile/packages/ente_pure_utils/lib/src/task_queue.dart
index 1c15485552..a257597463 100644
--- a/mobile/packages/ente_pure_utils/lib/src/task_queue.dart
+++ b/mobile/packages/ente_pure_utils/lib/src/task_queue.dart
@@ -70,13 +70,14 @@ class TaskQueue<T> {
final _runningTasks = <T>{};
+ // Most recently updated tasks run first.
TaskQueue({
this.maxConcurrentTasks = 1,
this.taskTimeout = const Duration(minutes: 5),
this.maxQueueSize = 100,
}) : _priorityQueue = HeapPriorityQueue<_QueueItem>(
(a, b) => b.lastUpdated.compareTo(a.lastUpdated),
- ); // Reversed for most recent first
+ );
Future<void> addTask(T id, Future<void> Function() task) {
if (_taskMap.containsKey(id)) {
diff --git a/mobile/packages/ente_qr/android/src/main/kotlin/io/ente/ente_qr/EnteQrPlugin.kt b/mobile/packages/ente_qr/android/src/main/kotlin/io/ente/ente_qr/EnteQrPlugin.kt
index 53addb90cd..a1c2173d66 100644
--- a/mobile/packages/ente_qr/android/src/main/kotlin/io/ente/ente_qr/EnteQrPlugin.kt
+++ b/mobile/packages/ente_qr/android/src/main/kotlin/io/ente/ente_qr/EnteQrPlugin.kt
@@ -275,7 +275,6 @@ class EnteQrPlugin: FlutterPlugin, MethodCallHandler {
if (py > maxY) maxY = py
}
- // Add padding around finder patterns
val padX = (maxX - minX) * 0.15f
val padY = (maxY - minY) * 0.15f
minX = (minX - padX).coerceAtLeast(0f)
diff --git a/mobile/packages/ente_qr/ios/ente_qr.podspec b/mobile/packages/ente_qr/ios/ente_qr.podspec
index f52d6d032b..8a5a67a86d 100644
--- a/mobile/packages/ente_qr/ios/ente_qr.podspec
+++ b/mobile/packages/ente_qr/ios/ente_qr.podspec
@@ -1,7 +1,3 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint ente_qr.podspec` to validate before publishing.
-#
Pod::Spec.new do |s|
s.name = 'ente_qr'
s.version = '0.0.1'
diff --git a/mobile/packages/ente_qr/macos/ente_qr.podspec b/mobile/packages/ente_qr/macos/ente_qr.podspec
index 813ef80b99..47c9b4a220 100644
--- a/mobile/packages/ente_qr/macos/ente_qr.podspec
+++ b/mobile/packages/ente_qr/macos/ente_qr.podspec
@@ -1,7 +1,3 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint ente_qr.podspec` to validate before publishing.
-#
Pod::Spec.new do |s|
s.name = 'ente_qr'
s.version = '0.0.1'
diff --git a/mobile/packages/lock_screen/pubspec.yaml b/mobile/packages/lock_screen/pubspec.yaml
index 36a6e336ae..adb1ef0e38 100644
--- a/mobile/packages/lock_screen/pubspec.yaml
+++ b/mobile/packages/lock_screen/pubspec.yaml
@@ -30,12 +30,9 @@ dependencies:
flutter:
sdk: flutter
flutter_animate: 4.5.2
- # Do not upgrade this package unless this issue is resolved:
- # https://github.com/juliansteenbakker/flutter_secure_storage/issues/870
- # On v9.2.4, keys related to lockscreen persist even after reintsall. For context see:
+ # Version 9.2.4 leaves lock-screen keys behind after an app reinstall.
+ # Upgrade only after this is fixed or with a migration.
# https://github.com/juliansteenbakker/flutter_secure_storage/issues/870#issuecomment-2777447937
- # Let's wait till the issue is resolved by the package maintainer.
- # If not resolved and we need to upgrade, write a migration script.
flutter_secure_storage: 9.0.0
flutter_svg: 2.3.0
local_auth: 3.0.1
diff --git a/mobile/packages/rust/ios/ente_rust.podspec b/mobile/packages/rust/ios/ente_rust.podspec
index 800e6bdacc..817881c7c2 100644
--- a/mobile/packages/rust/ios/ente_rust.podspec
+++ b/mobile/packages/rust/ios/ente_rust.podspec
@@ -1,7 +1,3 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint ente_rust.podspec` to validate before publishing.
-#
Pod::Spec.new do |s|
s.name = 'ente_rust'
s.version = '0.0.1'
diff --git a/mobile/packages/rust/macos/ente_rust.podspec b/mobile/packages/rust/macos/ente_rust.podspec
index 13aac1b5b2..6f3cba21ce 100644
--- a/mobile/packages/rust/macos/ente_rust.podspec
+++ b/mobile/packages/rust/macos/ente_rust.podspec
@@ -1,7 +1,3 @@
-#
-# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
-# Run `pod lib lint ente_rust.podspec` to validate before publishing.
-#
Pod::Spec.new do |s|
s.name = 'ente_rust'
s.version = '0.0.1'
diff --git a/mobile/packages/ui/lib/components/action_sheet_widget.dart b/mobile/packages/ui/lib/components/action_sheet_widget.dart
index 4a4b938335..867dea61d8 100644
--- a/mobile/packages/ui/lib/components/action_sheet_widget.dart
+++ b/mobile/packages/ui/lib/components/action_sheet_widget.dart
@@ -158,9 +158,7 @@ class ContentContainerWidget extends StatelessWidget {
? const SizedBox.shrink()
: Text(
title!,
- style: textTheme.largeBold.copyWith(
- color: textBaseDark,
- ), //constant color
+ style: textTheme.largeBold.copyWith(color: textBaseDark),
),
title == null || bodyMissing
? const SizedBox.shrink()
@@ -174,7 +172,7 @@ class ContentContainerWidget extends StatelessWidget {
body!,
style: textTheme.body.copyWith(
color: textMutedDark,
- ), //constant color
+ ),
))
: Icon(
Icons.check_outlined,
@@ -189,9 +187,7 @@ class ContentContainerWidget extends StatelessWidget {
padding: const EdgeInsets.only(top: 19.0),
child: Text(
bodyHighlight!,
- style: textTheme.body.copyWith(
- color: textBaseDark,
- ), //constant color
+ style: textTheme.body.copyWith(color: textBaseDark),
),
)
: const SizedBox.shrink(),
diff --git a/mobile/packages/ui/lib/components/buttons/button_widget.dart b/mobile/packages/ui/lib/components/buttons/button_widget.dart
index c8ff3b516a..d06529bfb5 100644
--- a/mobile/packages/ui/lib/components/buttons/button_widget.dart
+++ b/mobile/packages/ui/lib/components/buttons/button_widget.dart
@@ -356,7 +356,7 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
color: checkIconColor,
),
)
- : const SizedBox.shrink(), //fallback
+ : const SizedBox.shrink(),
),
),
),
diff --git a/mobile/packages/ui/lib/components/buttons/dynamic_fab.dart b/mobile/packages/ui/lib/components/buttons/dynamic_fab.dart
index 08b18c6074..8f4b1cc736 100644
--- a/mobile/packages/ui/lib/components/buttons/dynamic_fab.dart
+++ b/mobile/packages/ui/lib/components/buttons/dynamic_fab.dart
@@ -51,7 +51,7 @@ class DynamicFAB extends StatelessWidget {
child: Transform.rotate(
angle: isFormValid! ? 0 : math.pi / 2,
child: const Icon(Icons.chevron_right, size: 36),
- ), //keypad down here
+ ),
),
],
),
diff --git a/mobile/packages/ui/lib/theme/colors.dart b/mobile/packages/ui/lib/theme/colors.dart
index e772c46635..efcbbb1074 100644
--- a/mobile/packages/ui/lib/theme/colors.dart
+++ b/mobile/packages/ui/lib/theme/colors.dart
@@ -832,14 +832,14 @@ const List<Color> avatarLight = [
Color.fromRGBO(148, 180, 159, 1),
Color.fromRGBO(135, 162, 251, 1),
Color.fromRGBO(198, 137, 198, 1),
- Color.fromRGBO(147, 125, 194, 1), // Fixed duplicate
+ Color.fromRGBO(147, 125, 194, 1),
Color.fromRGBO(50, 82, 136, 1),
Color.fromRGBO(133, 180, 224, 1),
Color.fromRGBO(193, 163, 163, 1),
- Color.fromRGBO(225, 160, 89, 1), // Fixed duplicate
+ Color.fromRGBO(225, 160, 89, 1),
Color.fromRGBO(66, 97, 101, 1),
- Color.fromRGBO(107, 119, 178, 1), // Fixed duplicate
- Color.fromRGBO(149, 127, 239, 1), // Fixed duplicate
+ Color.fromRGBO(107, 119, 178, 1),
+ Color.fromRGBO(149, 127, 239, 1),
Color.fromRGBO(221, 157, 226, 1),
Color.fromRGBO(130, 171, 139, 1),
Color.fromRGBO(155, 187, 232, 1),
diff --git a/mobile/packages/ui/lib/theme/ente_theme_data.dart b/mobile/packages/ui/lib/theme/ente_theme_data.dart
index 21ff26bc13..1db4537eaf 100644
--- a/mobile/packages/ui/lib/theme/ente_theme_data.dart
+++ b/mobile/packages/ui/lib/theme/ente_theme_data.dart
@@ -40,7 +40,7 @@ final lightThemeData = ThemeData(
),
cardColor: const Color.fromRGBO(250, 250, 250, 1.0),
dialogTheme: const DialogThemeData().copyWith(
- backgroundColor: const Color.fromRGBO(250, 250, 250, 1.0), //
+ backgroundColor: const Color.fromRGBO(250, 250, 250, 1.0),
titleTextStyle: const TextStyle(
color: Colors.black,
fontSize: 24,
@@ -472,9 +472,9 @@ OutlinedButtonThemeData buildOutlinedButtonThemeData({
}
ElevatedButtonThemeData buildElevatedButtonThemeData({
- required Color onPrimary, // text button color
+ required Color onPrimary,
required Color primary,
- double elevation = 2, // background color of button
+ double elevation = 2,
}) {
return ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
diff --git a/mobile/packages/ui/lib/theme/multi_app_demo.dart b/mobile/packages/ui/lib/theme/multi_app_demo.dart
index 8d839e378e..f106e9933f 100644
--- a/mobile/packages/ui/lib/theme/multi_app_demo.dart
+++ b/mobile/packages/ui/lib/theme/multi_app_demo.dart
@@ -71,7 +71,7 @@ class GamingApp {
Color(0xFFFF9800),
Color(0xFFFFB74D),
],
- warning500: const Color(0xFFF44336), // Custom warning for gaming
+ warning500: const Color(0xFFF44336),
);
static final customDarkScheme = EnteColorScheme.dark(
diff --git a/mobile/packages/ui/lib/utils/file_icon_utils.dart b/mobile/packages/ui/lib/utils/file_icon_utils.dart
index 9f3166a863..a7714b3fb3 100644
--- a/mobile/packages/ui/lib/utils/file_icon_utils.dart
+++ b/mobile/packages/ui/lib/utils/file_icon_utils.dart
@@ -47,7 +47,7 @@ class FileIconUtils {
final lastDotIndex = lowerFileName.lastIndexOf('.');
if (lastDotIndex == -1) {
- return _defaultConfig; // No extension found
+ return _defaultConfig;
}
final extension = lowerFileName.substring(lastDotIndex);
diff --git a/mobile/packages/utils/lib/email_util.dart b/mobile/packages/utils/lib/email_util.dart
index b8e32c1cc7..2f92f2bed3 100644
--- a/mobile/packages/utils/lib/email_util.dart
+++ b/mobile/packages/utils/lib/email_util.dart
@@ -184,7 +184,7 @@ Future<void> exportLogs(
]) async {
if (!isSharing) {
final DateTime now = DateTime.now().toUtc();
- final String shortMonthName = DateFormat('MMM').format(now); // Short month
+ final String shortMonthName = DateFormat('MMM').format(now);
final String logFileName =
'ente-logs-${now.year}-$shortMonthName-${now.day}-${now.hour}-${now.minute}';