💚 End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Prune remaining mobile comments
Manav Rathiad06769c6544
diff --git a/mobile/apps/auth/ios/Podfile b/mobile/apps/auth/ios/Podfileindex 8a76e28f8b..1739d9cf10 100644--- a/mobile/apps/auth/ios/Podfile+++ b/mobile/apps/auth/ios/Podfile@@ -1,4 +1,3 @@-# Uncomment this line to define a global platform for your projectplatform :ios, '13.0'# CocoaPods analytics sends network stats synchronously affecting flutter build latency.diff --git a/mobile/apps/auth/lib/core/constants.dart b/mobile/apps/auth/lib/core/constants.dartindex 80effb883d..e63fb309e5 100644--- a/mobile/apps/auth/lib/core/constants.dart+++ b/mobile/apps/auth/lib/core/constants.dart@@ -13,8 +13,8 @@ final Uri githubFeatureRequestUri = Uri.https();const int microSecondsInDay = 86400000000;const int android11SDKINT = 30;-const int galleryLoadStartTime = -8000000000000000; // Wednesday, March 6, 1748-const int galleryLoadEndTime = 9223372036854775807; // 2^63 -1+const int galleryLoadStartTime = -8000000000000000; // June 28, 1716+const int galleryLoadEndTime = 9223372036854775807; // 2^63 - 1// todo: 6Jun22: delete old media identifier after 3 monthsconst String oldSharedMediaIdentifier = 'ente-shared://';diff --git a/mobile/apps/auth/lib/models/code.dart b/mobile/apps/auth/lib/models/code.dartindex 632800fc0c..9ba960db0b 100644--- a/mobile/apps/auth/lib/models/code.dart+++ b/mobile/apps/auth/lib/models/code.dart@@ -264,9 +264,7 @@ class Code {} else if (algorithm == "sha512" || "algorithm.sha512" == algorithm) {return Algorithm.sha512;}- } catch (e) {- // nothing- }+ } catch (e) {}return Algorithm.sha1;}diff --git a/mobile/apps/auth/lib/ui/utils/icon_utils.dart b/mobile/apps/auth/lib/ui/utils/icon_utils.dartindex 0870c1fd95..b569a10963 100644--- a/mobile/apps/auth/lib/ui/utils/icon_utils.dart+++ b/mobile/apps/auth/lib/ui/utils/icon_utils.dart@@ -216,7 +216,7 @@ class IconUtils {if (hexColor == null) return null;final theme = Theme.of(context).brightness;final color = Color(int.parse("0xFF$hexColor"));- // Color is close to neutral-grey and it's too light or dark for theme+ // Use the theme icon color when a neutral grey lacks contrast.if (_isCloseToNeutralGrey(color) &&((theme == Brightness.light && _getColorLuminance(color) > 0.70) ||(theme == Brightness.dark && _getColorLuminance(color) < 0.05))) {diff --git a/mobile/apps/auth/linux/CMakeLists.txt b/mobile/apps/auth/linux/CMakeLists.txtindex 02428a19c7..29336637ef 100644--- a/mobile/apps/auth/linux/CMakeLists.txt+++ b/mobile/apps/auth/linux/CMakeLists.txt@@ -1,25 +1,16 @@-# Project-level configuration.cmake_minimum_required(VERSION 3.10)project(runner LANGUAGES CXX)# Preserve the pre-Sentry 9 desktop crash-handling behavior.set(ENV{SENTRY_NATIVE_BACKEND} "none")-# The name of the executable created for the application. Change this to change-# the on-disk name of your application.set(BINARY_NAME "enteauth")-# The unique GTK application identifier for this application. See:-# https://wiki.gnome.org/HowDoI/ChooseApplicationIDset(APPLICATION_ID "io.ente.auth")-# Explicitly opt in to modern CMake behaviors to avoid warnings with recent-# versions of CMake.cmake_policy(SET CMP0063 NEW)-# Load bundled libraries from the lib/ directory relative to the binary.set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")-# Root filesystem for cross-building.if(FLUTTER_TARGET_PLATFORM_SYSROOT)set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})@@ -29,7 +20,6 @@ if(FLUTTER_TARGET_PLATFORM_SYSROOT)set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)endif()-# Define build configuration options.if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)set(CMAKE_BUILD_TYPE "Debug" CACHESTRING "Flutter build mode" FORCE)@@ -37,77 +27,51 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)"Debug" "Profile" "Release")endif()-# Compilation settings that should be applied to most targets.-#-# Be cautious about adding new options here, as plugins use this function by-# default. In most cases, you should add new options to specific targets instead-# of modifying this function.+# Plugins also inherit these settings.function(APPLY_STANDARD_SETTINGS TARGET)target_compile_features(${TARGET} PUBLIC cxx_std_14)target_compile_options(${TARGET} PRIVATE -Wall -Werror)# FIXME: workaround for tray_manager deprecation issue:- target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations) # Allow deprecated warnings+ target_compile_options(${TARGET} PRIVATE -Wno-error=deprecated-declarations)target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")endfunction()-# Flutter library and tool build rules.set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")add_subdirectory(${FLUTTER_MANAGED_DIR})-# System-level dependencies.find_package(PkgConfig REQUIRED)pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")-# Define the application target. To change its name, change BINARY_NAME above,-# not the value here, or `flutter run` will no longer work.-#-# Any new source files that you add to the application should be added here.add_executable(${BINARY_NAME}"main.cc""my_application.cc""${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc")-# Apply the standard set of build settings. This can be removed for applications-# that need different build settings.apply_standard_settings(${BINARY_NAME})-# Add dependency libraries. Add any application-specific dependencies here.target_link_libraries(${BINARY_NAME} PRIVATE flutter)target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::X11)-# Run the Flutter tool portions of the build. This must not be removed.add_dependencies(${BINARY_NAME} flutter_assemble)-# Only the install-generated bundle's copy of the executable will launch-# correctly, since the resources must in the right relative locations. To avoid-# people trying to run the unbundled copy, put it in a subdirectory instead of-# the default top-level location.set_target_properties(${BINARY_NAME}PROPERTIESRUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run")--# Generated plugin build rules, which manage building the plugins and adding-# them to the application.include(flutter/generated_plugins.cmake)--# === Installation ===-# By default, "installing" just makes a relocatable bundle in the build-# directory.set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)endif()-# Start with a clean build bundle directory every time.install(CODE "file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")" COMPONENT Runtime)@@ -130,14 +94,12 @@ foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})COMPONENT Runtime)endforeach(bundled_library)-# Copy the native assets provided by the build.dart from all packages.set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")install(DIRECTORY "${NATIVE_ASSETS_DIR}"DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"COMPONENT Runtime)-# Fully re-copy the assets directory on each build to avoid having stale files-# from a previous install.+# Replace the asset directory so removed assets do not survive a build.set(FLUTTER_ASSET_DIR_NAME "flutter_assets")install(CODE "file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")@@ -145,7 +107,6 @@ install(CODE "install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)-# Install the AOT library on non-Debug builds only.if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"COMPONENT Runtime)diff --git a/mobile/apps/auth/linux/flutter/CMakeLists.txt b/mobile/apps/auth/linux/flutter/CMakeLists.txtindex d5bd01648a..d7e011394e 100644--- a/mobile/apps/auth/linux/flutter/CMakeLists.txt+++ b/mobile/apps/auth/linux/flutter/CMakeLists.txt@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.10)set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")-# Configuration provided via flutter tool.include(${EPHEMERAL_DIR}/generated_config.cmake)# TODO: Move the rest of this into files in ephemeral. See@@ -19,8 +18,6 @@ function(list_prepend LIST_NAME PREFIX)set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)endfunction()-# === Flutter Library ===-# System-level dependencies.find_package(PkgConfig REQUIRED)pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)@@ -28,7 +25,6 @@ pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")-# Published to parent scope for install step.set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)@@ -69,7 +65,6 @@ target_link_libraries(flutter INTERFACE)add_dependencies(flutter flutter_assemble)-# === Flutter tool backend ===# _phony_ is a non-existent file to force this command to run every time,# since currently there's no way to get a full input/output list from the# flutter tool.diff --git a/mobile/apps/auth/windows/CMakeLists.txt b/mobile/apps/auth/windows/CMakeLists.txtindex 3900b6fdc4..22c5a7784a 100644--- a/mobile/apps/auth/windows/CMakeLists.txt+++ b/mobile/apps/auth/windows/CMakeLists.txt@@ -1,19 +1,13 @@-# Project-level configuration.cmake_minimum_required(VERSION 3.14)project(auth LANGUAGES CXX)# Preserve the pre-Sentry 9 desktop crash-handling behavior.set(ENV{SENTRY_NATIVE_BACKEND} "none")-# The name of the executable created for the application. Change this to change-# the on-disk name of your application.set(BINARY_NAME "auth")-# Explicitly opt in to modern CMake behaviors to avoid warnings with recent-# versions of CMake.cmake_policy(VERSION 3.14...3.25)-# Define build configuration option.get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)if(IS_MULTICONFIG)set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release"@@ -26,20 +20,14 @@ else()"Debug" "Profile" "Release")endif()endif()-# Define settings for the Profile build mode.set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}")set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}")-# Use Unicode for all projects.add_definitions(-DUNICODE -D_UNICODE)-# Compilation settings that should be applied to most targets.-#-# Be cautious about adding new options here, as plugins use this function by-# default. In most cases, you should add new options to specific targets instead-# of modifying this function.+# Plugins also inherit these settings.function(APPLY_STANDARD_SETTINGS TARGET)target_compile_features(${TARGET} PUBLIC cxx_std_17)target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100")@@ -48,24 +36,14 @@ function(APPLY_STANDARD_SETTINGS TARGET)target_compile_definitions(${TARGET} PRIVATE "$<$<CONFIG:Debug>:_DEBUG>")endfunction()-# Flutter library and tool build rules.set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")add_subdirectory(${FLUTTER_MANAGED_DIR})-# Application build; see runner/CMakeLists.txt.add_subdirectory("runner")--# Generated plugin build rules, which manage building the plugins and adding-# them to the application.include(flutter/generated_plugins.cmake)-# === Installation ===-# Support files are copied into place next to the executable, so that it can-# run in place. This is done instead of making a separate bundle (as on Linux)-# so that building and running from within Visual Studio will work.set(BUILD_BUNDLE_DIR "$<TARGET_FILE_DIR:${BINARY_NAME}>")-# Make the "install" step default, as it's required to run.set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)@@ -89,14 +67,12 @@ if(PLUGIN_BUNDLED_LIBRARIES)COMPONENT Runtime)endif()-# Copy the native assets provided by the build.dart from all packages.set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/")install(DIRECTORY "${NATIVE_ASSETS_DIR}"DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"COMPONENT Runtime)-# Fully re-copy the assets directory on each build to avoid having stale files-# from a previous install.+# Replace the asset directory so removed assets do not survive a build.set(FLUTTER_ASSET_DIR_NAME "flutter_assets")install(CODE "file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")@@ -104,7 +80,6 @@ install(CODE "install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)-# Install the AOT library on non-Debug builds only.install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"CONFIGURATIONS Profile;ReleaseCOMPONENT Runtime)diff --git a/mobile/apps/auth/windows/flutter/CMakeLists.txt b/mobile/apps/auth/windows/flutter/CMakeLists.txtindex 903f4899d6..b137ac6b1c 100644--- a/mobile/apps/auth/windows/flutter/CMakeLists.txt+++ b/mobile/apps/auth/windows/flutter/CMakeLists.txt@@ -3,22 +3,18 @@ cmake_minimum_required(VERSION 3.14)set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")-# Configuration provided via flutter tool.include(${EPHEMERAL_DIR}/generated_config.cmake)# TODO: Move the rest of this into files in ephemeral. See# https://github.com/flutter/flutter/issues/57146.set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")-# Set fallback configurations for older versions of the flutter tool.if (NOT DEFINED FLUTTER_TARGET_PLATFORM)set(FLUTTER_TARGET_PLATFORM "windows-x64")endif()-# === Flutter Library ===set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")-# Published to parent scope for install step.set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)@@ -39,7 +35,6 @@ target_include_directories(flutter INTERFACEtarget_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib")add_dependencies(flutter flutter_assemble)-# === Wrapper ===list(APPEND CPP_WRAPPER_SOURCES_CORE"core_implementations.cc""standard_codec.cc"@@ -55,7 +50,6 @@ list(APPEND CPP_WRAPPER_SOURCES_APP)list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/")-# Wrapper sources needed for a plugin.add_library(flutter_wrapper_plugin STATIC${CPP_WRAPPER_SOURCES_CORE}${CPP_WRAPPER_SOURCES_PLUGIN}@@ -71,7 +65,6 @@ target_include_directories(flutter_wrapper_plugin PUBLIC)add_dependencies(flutter_wrapper_plugin flutter_assemble)-# Wrapper sources needed for the runner.add_library(flutter_wrapper_app STATIC${CPP_WRAPPER_SOURCES_CORE}${CPP_WRAPPER_SOURCES_APP}@@ -83,7 +76,6 @@ target_include_directories(flutter_wrapper_app PUBLIC)add_dependencies(flutter_wrapper_app flutter_assemble)-# === Flutter tool backend ===# _phony_ is a non-existent file to force this command to run every time,# since currently there's no way to get a full input/output list from the# flutter tool.diff --git a/mobile/apps/auth/windows/runner/CMakeLists.txt b/mobile/apps/auth/windows/runner/CMakeLists.txtindex 394917c053..779b9bde5e 100644--- a/mobile/apps/auth/windows/runner/CMakeLists.txt+++ b/mobile/apps/auth/windows/runner/CMakeLists.txt@@ -1,11 +1,6 @@cmake_minimum_required(VERSION 3.14)project(runner LANGUAGES CXX)-# Define the application target. To change its name, change BINARY_NAME in the-# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer-# work.-#-# Any new source files that you add to the application should be added here.add_executable(${BINARY_NAME} WIN32"flutter_window.cpp""main.cpp"@@ -16,11 +11,8 @@ add_executable(${BINARY_NAME} WIN32"runner.exe.manifest")-# Apply the standard set of build settings. This can be removed for applications-# that need different build settings.apply_standard_settings(${BINARY_NAME})-# Add preprocessor definitions for the build version.target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")@@ -30,11 +22,8 @@ target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTT# Disable Windows macros that collide with C++ standard library functions.target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")-# Add dependency libraries and include directories. Add any application-specific-# dependencies here.target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")-# Run the Flutter tool portions of the build. This must not be removed.add_dependencies(${BINARY_NAME} flutter_assemble)diff --git a/mobile/apps/locker/ios/Podfile b/mobile/apps/locker/ios/Podfileindex 7e99f94391..d46d9bd037 100644--- a/mobile/apps/locker/ios/Podfile+++ b/mobile/apps/locker/ios/Podfile@@ -1,4 +1,3 @@-# Uncomment this line to define a global platform for your projectplatform :ios, '13.0'# CocoaPods analytics sends network stats synchronously affecting flutter build latency.diff --git a/mobile/apps/locker/lib/services/favorites_service.dart b/mobile/apps/locker/lib/services/favorites_service.dartindex dd06e578e1..44a44ad9cc 100644--- a/mobile/apps/locker/lib/services/favorites_service.dart+++ b/mobile/apps/locker/lib/services/favorites_service.dart@@ -193,7 +193,6 @@ class FavoritesService {Future<void> removeFromFavorites(EnteFile file) async {final inUploadID = file.uploadedFileID;if (inUploadID == null) {- // Do nothing, ignore} else {final Collection? favCollection = await getFavoritesCollection();diff --git a/mobile/apps/locker/lib/ui/pages/base_info_page.dart b/mobile/apps/locker/lib/ui/pages/base_info_page.dartindex ff07df48f5..df03665302 100644--- a/mobile/apps/locker/lib/ui/pages/base_info_page.dart+++ b/mobile/apps/locker/lib/ui/pages/base_info_page.dart@@ -226,9 +226,7 @@ abstract class BaseInfoPageState<T extends InfoData, W extends BaseInfoPage<T>>_initialSelectedCollectionIds = Set<int>.of(initialSelection);_hasLoadedCollectionSelection = true;});- } catch (e) {- // Handle error silently or show a message- }+ } catch (e) {}}void _onToggleCollection(int collectionId) {diff --git a/mobile/apps/photos/lib/core/configuration.dart b/mobile/apps/photos/lib/core/configuration.dartindex cb259a10e9..1a1d2b7262 100644--- a/mobile/apps/photos/lib/core/configuration.dart+++ b/mobile/apps/photos/lib/core/configuration.dart@@ -96,7 +96,9 @@ class Configuration implements LockScreenHost, AccountDeletionHost {);_documentsDirectory = (await getApplicationDocumentsDirectory()).path;final appSupportDirectory = await getApplicationSupportDirectory();- // Exclude Documents (SQLite, thumbnails, decrypted media) and Application Support (ML models) from backups since they’re server-derivable or must remain within the device’s E2EE boundary.+ // Exclude Documents (SQLite, thumbnails, decrypted media) and Application+ // Support (ML models) from backups. They are server-derivable or must+ // remain within the device's E2EE boundary.await excludeFromBackup(_documentsDirectory);await excludeFromBackup(appSupportDirectory.path);_tempDocumentsDirPath = _documentsDirectory + "/temp/";diff --git a/mobile/apps/photos/lib/core/constants.dart b/mobile/apps/photos/lib/core/constants.dartindex 07d2b1d312..24fe450469 100644--- a/mobile/apps/photos/lib/core/constants.dart+++ b/mobile/apps/photos/lib/core/constants.dart@@ -15,8 +15,8 @@ const int microSecondsInDay = 86400000000;const int android11SDKINT = 30;const int android12SDKINT = 31;const int jan011981Time = 347155200000000;-const int galleryLoadStartTime = -8000000000000000; // Wednesday, March 6, 1748-const int galleryLoadEndTime = 9223372036854775807; // 2^63 -1+const int galleryLoadStartTime = -8000000000000000; // June 28, 1716+const int galleryLoadEndTime = 9223372036854775807; // 2^63 - 1const int batchSize = 1000;const int batchSizeCopy = 100;const photoGridSizeDefault = 4;diff --git a/mobile/apps/photos/lib/db/ml/db.dart b/mobile/apps/photos/lib/db/ml/db.dartindex 376f1f9d6f..138133b3b9 100644--- a/mobile/apps/photos/lib/db/ml/db.dart+++ b/mobile/apps/photos/lib/db/ml/db.dart@@ -2235,7 +2235,6 @@ class MLDataDB with SqlDbBase implements IMLDataDB<int> {_logger.info("All embeddings migrated, breaking out of while loop");break;}- // Allow some time for any GC to finish_logger.info("Waiting for 100ms out of precaution, for GC to finish");await Future.delayed(const Duration(milliseconds: 100));}diff --git a/mobile/apps/photos/lib/models/search/album_search_result.dart b/mobile/apps/photos/lib/models/search/album_search_result.dartindex 6a74b17871..45a9f14b71 100644--- a/mobile/apps/photos/lib/models/search/album_search_result.dart+++ b/mobile/apps/photos/lib/models/search/album_search_result.dart@@ -27,7 +27,7 @@ class AlbumSearchResult extends SearchResult {@overrideList<EnteFile> resultFiles() {- // for album search result, we should open the album page directly+ // Album results open the album directly; this method must not be called.throw UnimplementedError();}diff --git a/mobile/apps/photos/lib/models/search/device_album_search_result.dart b/mobile/apps/photos/lib/models/search/device_album_search_result.dartindex 1f99e11f49..7f39be1d42 100644--- a/mobile/apps/photos/lib/models/search/device_album_search_result.dart+++ b/mobile/apps/photos/lib/models/search/device_album_search_result.dart@@ -26,13 +26,13 @@ class DeviceAlbumSearchResult extends SearchResult {@overrideList<EnteFile> resultFiles() {- // For device album search result, we open the device folder page directly+ // Device album results open the folder directly; do not call this method.throw UnimplementedError();}@overrideHierarchicalSearchFilter getHierarchicalSearchFilter() {- // Device albums don't support hierarchical search filter+ // Device albums do not support hierarchical filtering.throw UnimplementedError();}}diff --git a/mobile/apps/photos/lib/models/search/search_types.dart b/mobile/apps/photos/lib/models/search/search_types.dartindex 7d872b51f7..a76bb47810 100644--- a/mobile/apps/photos/lib/models/search/search_types.dart+++ b/mobile/apps/photos/lib/models/search/search_types.dart@@ -54,7 +54,6 @@ enum SectionType {wrapped,location,album,- // People section shows the files shared by other personscontacts,fileTypesAndExtension,}diff --git a/mobile/apps/photos/lib/module/metadata/exif.dart b/mobile/apps/photos/lib/module/metadata/exif.dartindex d79e62d8fb..ae3148bbe0 100644--- a/mobile/apps/photos/lib/module/metadata/exif.dart+++ b/mobile/apps/photos/lib/module/metadata/exif.dart@@ -165,7 +165,6 @@ ParsedExifDateTime _getStandardExifDateTimeInDeviceTimezone(final int offsetHours = int.parse(splitHHMM[0]);final int offsetMinutes =int.parse(splitHHMM[1]) * (offsetHours.isNegative ? -1 : 1);- // Adjust the date for the offset to get the photo's correct UTC timefinal photoUtcDate = result.add(Duration(hours: -offsetHours, minutes: -offsetMinutes),);diff --git a/mobile/apps/photos/lib/module/metadata/local_file.dart b/mobile/apps/photos/lib/module/metadata/local_file.dartindex e3724db996..043c0968f8 100644--- a/mobile/apps/photos/lib/module/metadata/local_file.dart+++ b/mobile/apps/photos/lib/module/metadata/local_file.dart@@ -33,11 +33,8 @@ void applyCreationTimeMetadata(EnteFile file, ParsedExifDateTime? exifTime) {if (!hasExifTime && Platform.isAndroid && file.title != null) {final timeFromFileName = parseDateTimeFromFileNameV2(file.title!);if (timeFromFileName != null) {- // only use timeFromFileName if the existing creationTime and- // timeFromFilename belongs to different date.- // This is done because many times the fileTimeStamp will only give us- // the date, not time value but the photo_manager's creation time will- // contain the time.+ // Filename dates often omit the time; keep photo_manager's timestamp+ // when both values fall on the same day.final bool useFileTimeStamp =file.creationTime == null ||!areFromSameDay(diff --git a/mobile/apps/photos/lib/services/filedata/model/file_data.dart b/mobile/apps/photos/lib/services/filedata/model/file_data.dartindex c016b10486..bdb12545ab 100644--- a/mobile/apps/photos/lib/services/filedata/model/file_data.dart+++ b/mobile/apps/photos/lib/services/filedata/model/file_data.dart@@ -86,8 +86,6 @@ class FileDataEntity {class RemoteFaceEmbedding {final List<Face> faces;final int version;-- // packageName/versionfinal String client;final int height;final int width;diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_process_lock.dart b/mobile/apps/photos/lib/services/machine_learning/ml_process_lock.dartindex 8bf7bbefd8..4bb87ba459 100644--- a/mobile/apps/photos/lib/services/machine_learning/ml_process_lock.dart+++ b/mobile/apps/photos/lib/services/machine_learning/ml_process_lock.dart@@ -24,12 +24,8 @@ enum MlLockAttempt {enum MlRunDisposition { completed, denied, stopped, failed }-/// Per-engine funnel plus the process-global `ml` lock.-///-/// All top-level ML operations must run through [tryRunExclusive]: the funnel-/// serializes operations within this engine, and the native lock excludes the-/// other engine. Calls make a single attempt unless [waitForAvailability] is-/// set for maintenance work that must complete before its caller continues.+// All top-level ML work must enter through tryRunExclusive. The Dart funnel+// serializes this engine; the native lock excludes the other Flutter engine.class MlProcessLock {MlProcessLock._();static final instance = MlProcessLock._();@@ -40,19 +36,12 @@ class MlProcessLock {final Lock _funnel = Lock();MlOperation? _activeOperation;- /// Whether the funnel is held or has queued waiters. For asserts and- /// diagnostics only — never use this to skip [tryRunExclusive].+ // Diagnostic only; do not use this to skip tryRunExclusive.bool get isBusy => _funnel.locked;MlOperation? get activeOperation => _activeOperation;- /// Runs [body] while holding the funnel and the native `ml` lock. The lock- /// is released only after [body] completes, so [body] must drain any- /// protected ML work it started before returning. Errors from [body]- /// propagate after release. [background] labels this engine's origin.- /// [waitForAvailability] waits for both the local funnel and the other- /// engine instead of returning a busy denial, bounded by [waitDeadline]- /// per wait when given.+ // The callback must finish all protected work before returning.Future<MlLockAttempt> tryRunExclusive(MlOperation operation,Future<void> Function() body, {diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_run_control.dart b/mobile/apps/photos/lib/services/machine_learning/ml_run_control.dartindex 6ae526ee8e..71cf7b2095 100644--- a/mobile/apps/photos/lib/services/machine_learning/ml_run_control.dart+++ b/mobile/apps/photos/lib/services/machine_learning/ml_run_control.dart@@ -10,8 +10,8 @@ enum MlStopReason {corruptModel,}-/// Durable per-run stop latch. Once stop is requested it holds for the rest-/// of that run — nothing resumes; work continues only when a new run starts.+// A stop remains latched for the run: started work drains, but no new stage+// begins.class MlRunControl {final _logger = Logger("MlRunControl");bool _stopRequested = false;@@ -31,8 +31,6 @@ class MlRunControl {onStop?.call();}- /// One-shot notification for the active run. Fires immediately when stop- /// was already requested.void attachOnStop(void Function() onStop) {if (_stopRequested) {onStop();diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart b/mobile/apps/photos/lib/services/machine_learning/ml_service.dartindex 3fe3c34793..2721d5e351 100644--- a/mobile/apps/photos/lib/services/machine_learning/ml_service.dart+++ b/mobile/apps/photos/lib/services/machine_learning/ml_service.dart@@ -547,9 +547,6 @@ class MLService {}}- /// Requests a durable stop of all acquiring or active ML runs. Active runs- /// drain already-started work and do not begin further stages; a new run may- /// start later through the normal triggers.void stopActiveRun(MlStopReason reason) {for (final control in _runControls.toList(growable: false)) {control.requestStop(reason);diff --git a/mobile/apps/photos/lib/services/notification_service.dart b/mobile/apps/photos/lib/services/notification_service.dartindex 031cbd8b8c..3effb92a6e 100644--- a/mobile/apps/photos/lib/services/notification_service.dart+++ b/mobile/apps/photos/lib/services/notification_service.dart@@ -339,7 +339,7 @@ class NotificationService {);}} catch (e, s) {- // For now we're swallowing any exceptions here because we don't want the memories logic to get disturbed+ // Notification failures must not interrupt memory or ritual updates._logger.severe("Something went wrong while scheduling notification",e,diff --git a/mobile/apps/photos/lib/services/process_activity.dart b/mobile/apps/photos/lib/services/process_activity.dartindex a52c36a41e..efde5b60e1 100644--- a/mobile/apps/photos/lib/services/process_activity.dart+++ b/mobile/apps/photos/lib/services/process_activity.dart@@ -4,10 +4,7 @@ const kLastBGTaskHeartBeatTime = "bg_task_hb_time";const kLastFGTaskHeartBeatTime = "fg_task_hb_time";const kEngineDeathTimeoutInMicroseconds = 5000000;-/// Whether the foreground engine has written its heartbeat within the last-/// five seconds. Reloads prefs so writes from the other engine are seen.-///-/// Heartbeats influence priority and yield latency only — never correctness.+// Heartbeats affect priority and yield latency, not correctness.Future<bool> isForegroundEngineActive() =>_isEngineActive(kLastFGTaskHeartBeatTime);diff --git a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart b/mobile/apps/photos/lib/services/sync/remote_sync_service.dartindex 2095f8137e..00457b3ae9 100644--- a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart+++ b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart@@ -873,8 +873,6 @@ class RemoteSyncService {);if (localFileEntries.isNotEmpty) {- // file uploaded from same device, replace the local file row by- // setting the generated ID of remoteFile to localFile generatedIDexistingFile = localFileEntries.first;localUploadedFromDevice++;alreadyClaimedLocalFilesGenID.add(existingFile.generatedID!);diff --git a/mobile/apps/photos/lib/ui/account/login_pwd_verification_page.dart b/mobile/apps/photos/lib/ui/account/login_pwd_verification_page.dartindex 8d944c5b5f..a0c51a376c 100644--- a/mobile/apps/photos/lib/ui/account/login_pwd_verification_page.dart+++ b/mobile/apps/photos/lib/ui/account/login_pwd_verification_page.dart@@ -210,7 +210,7 @@ class _LoginPasswordVerificationPageState);return;} else if (e is KeyDerivationError) {- // device is not powerful enough to perform derive key+ // This device is not powerful enough to derive the key.if (!context.mounted) return;final dialogChoice = await showChoiceDialog(context,diff --git a/mobile/apps/photos/lib/ui/account/request_pwd_verification_page.dart b/mobile/apps/photos/lib/ui/account/request_pwd_verification_page.dartindex 6d3542f012..56daacbabb 100644--- a/mobile/apps/photos/lib/ui/account/request_pwd_verification_page.dart+++ b/mobile/apps/photos/lib/ui/account/request_pwd_verification_page.dart@@ -151,8 +151,7 @@ class _RequestPasswordVerificationPageState),),Visibility(- // hidden textForm for suggesting auto-fill service for saving- // 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/collections/collection_action_sheet.dart b/mobile/apps/photos/lib/ui/collections/collection_action_sheet.dartindex bb09699e68..3205cb68a2 100644--- a/mobile/apps/photos/lib/ui/collections/collection_action_sheet.dart+++ b/mobile/apps/photos/lib/ui/collections/collection_action_sheet.dart@@ -429,8 +429,7 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {} else {final List<Collection>collections = CollectionsService.instance.getCollectionsForUI(- // in collections where user is a collaborator, only addTo and remove- // action can to be performed+ // Collaborators can only add or remove files.includeCollab: widget.actionType == CollectionActionType.addFiles,includeUncategorized: true,);diff --git a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dartindex 405e3ec371..614b85cc67 100644--- a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart+++ b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart@@ -121,7 +121,7 @@ class __BodyState extends State<_Body> {Text(widget.labelText,textAlign: TextAlign.center,- //textTheme in [getWidthOfLongestWord] should be same as this+ // Keep this style in sync with computeWidthOfWord.style: labelStyle,),],@@ -160,7 +160,7 @@ class __BodyState extends State<_Body> {textDirection: TextDirection.ltr,textScaler: MediaQuery.textScalerOf(context),)..layout();- //buffer of 8 added as width is shorter than actual text width+ // Add 8 points because TextPainter under-measures this label.return textPainter.size.width + 8;}}diff --git a/mobile/apps/photos/lib/ui/components/text_input_widget.dart b/mobile/apps/photos/lib/ui/components/text_input_widget.dartindex 7f72f7944c..e118a7afb7 100644--- a/mobile/apps/photos/lib/ui/components/text_input_widget.dart+++ b/mobile/apps/photos/lib/ui/components/text_input_widget.dart@@ -425,7 +425,7 @@ class _TextInputWidgetState extends State<TextInputWidget> {}}-//todo: Add clear and custom icon for suffic icon+// TODO: Add clear and custom suffix icons.class SuffixIconWidget extends StatelessWidget {final ExecutionState executionState;final bool shouldSurfaceExecutionStates;diff --git a/mobile/apps/photos/lib/ui/home/status_bar_widget.dart b/mobile/apps/photos/lib/ui/home/status_bar_widget.dartindex e1ff78fb0f..29338d67d4 100644--- a/mobile/apps/photos/lib/ui/home/status_bar_widget.dart+++ b/mobile/apps/photos/lib/ui/home/status_bar_widget.dart@@ -272,7 +272,7 @@ class _SyncStatusWidgetState extends State<SyncStatusWidget> {kSleepDuration.inMicroseconds);if (_event == null ||isNotOutdatedEvent ||- //sync error cases are handled in StatusBarWidget+ // StatusBarWidget handles sync errors._event!.status == SyncStatus.error) {return const SizedBox.shrink();}diff --git a/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart b/mobile/apps/photos/lib/ui/settings/storage_card_widget.dartindex 77fe8241a9..e68f01e61d 100644--- a/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart+++ b/mobile/apps/photos/lib/ui/settings/storage_card_widget.dart@@ -210,7 +210,7 @@ class _StorageCardWidgetState extends State<StorageCardWidget> {),showFamilyBreakup? StorageProgressWidget(- color: const Color(0xFFF4D93B), // Family: yellow+ color: const Color(0xFFF4D93B),fractionOfStorage:((usedStorageInBytes) / totalStorageInBytes),)diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dartindex 2b55b57a80..f2fb84b0bc 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart@@ -417,10 +417,8 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {}}- // todo: In the new design, clicking on free up space will directly open- // the free up space page and show loading indicator while calculating- // the space which can be claimed up. This code duplication should be removed- // whenever we move to the new design for free up space.+ // TODO: Remove this duplicate flow when the new design opens the+ // free-up-space page directly and calculates there.Future<dynamic> _deleteBackedUpFiles(BuildContext context) async {final dialog = createProgressDialog(context, context.strings.calculating);await dialog.show();diff --git a/mobile/apps/photos/plugins/ente_photos_platform/android/src/main/kotlin/io/ente/photos/platform/processlock/ProcessLockRegistry.kt b/mobile/apps/photos/plugins/ente_photos_platform/android/src/main/kotlin/io/ente/photos/platform/processlock/ProcessLockRegistry.ktindex 927bbd61e0..69f5b3e81a 100644--- a/mobile/apps/photos/plugins/ente_photos_platform/android/src/main/kotlin/io/ente/photos/platform/processlock/ProcessLockRegistry.kt+++ b/mobile/apps/photos/plugins/ente_photos_platform/android/src/main/kotlin/io/ente/photos/platform/processlock/ProcessLockRegistry.kt@@ -2,12 +2,6 @@ package io.ente.photos.platform.processlockimport android.util.Log-/**- * Process-global registry of named, engine-owned locks. Re-acquiring a name- * already held by the same plugin instance is granted idempotently (this is- * what heals a holder orphaned by a Dart hot restart); a different instance- * is denied. State lives only as long as the process.- */object ProcessLockRegistry {private class Holder(val instanceId: String,@@ -34,6 +28,7 @@ object ProcessLockRegistry {holders[name] = Holder(instanceId, origin, operation, System.nanoTime())true}+ // A Dart hot restart can leave this plugin instance holding the lock.current.instanceId == instanceId -> {Log.i(TAG,diff --git a/mobile/apps/photos/plugins/ente_photos_platform/ios/Sources/PhotosPlatformCore/ProcessLockRegistry.swift b/mobile/apps/photos/plugins/ente_photos_platform/ios/Sources/PhotosPlatformCore/ProcessLockRegistry.swiftindex 08105d02c7..a31a4dbb2b 100644--- a/mobile/apps/photos/plugins/ente_photos_platform/ios/Sources/PhotosPlatformCore/ProcessLockRegistry.swift+++ b/mobile/apps/photos/plugins/ente_photos_platform/ios/Sources/PhotosPlatformCore/ProcessLockRegistry.swift@@ -1,9 +1,5 @@import Foundation-/// Process-global registry of named, engine-owned locks. Re-acquiring a name-/// already held by the same plugin instance is granted idempotently (this is-/// what heals a holder orphaned by a Dart hot restart); a different instance-/// is denied. State lives only as long as the process.final class ProcessLockRegistry: @unchecked Sendable {static let shared = ProcessLockRegistry()@@ -28,6 +24,7 @@ final class ProcessLockRegistry: @unchecked Sendable {lock.lock()defer { lock.unlock() }if var current = holders[name] {+ // A Dart hot restart can leave this plugin instance holding the lock.guard current.instanceId == instanceId else { return false }NSLog("ProcessLockRegistry: healed same-instance holder of '%@' (%@/%@ -> %@/%@)",diff --git a/mobile/apps/photos/plugins/ente_photos_platform/lib/src/process_lock.dart b/mobile/apps/photos/plugins/ente_photos_platform/lib/src/process_lock.dartindex 85c2fa829f..de2e37ac93 100644--- a/mobile/apps/photos/plugins/ente_photos_platform/lib/src/process_lock.dart+++ b/mobile/apps/photos/plugins/ente_photos_platform/lib/src/process_lock.dart@@ -31,12 +31,6 @@ class ProcessLockState {'heldFor: ${heldFor.inMilliseconds}ms)';}-/// Client for the process-global, engine-owned named locks.-///-/// At most one Flutter engine holds a given name at a time. Acquisition is-/// idempotent for the engine that already holds the name; locks are released-/// automatically when the owning engine detaches, and all state dies with-/// the OS process.class ProcessLockClient {ProcessLockClient({MethodChannel? methodChannel}): _methodChannel = methodChannel ?? const MethodChannel(_methodChannelName);@@ -46,8 +40,6 @@ class ProcessLockClient {final MethodChannel _methodChannel;- /// Attempts to acquire [name] for this engine. Returns false when another- /// engine holds the lock. [origin] and [operation] are diagnostic labels.Future<bool> tryAcquire({required String name,required String origin,diff --git a/mobile/apps/photos/scripts/app_init_perf_test.sh b/mobile/apps/photos/scripts/app_init_perf_test.shindex 6058135ba4..89429364f3 100755--- a/mobile/apps/photos/scripts/app_init_perf_test.sh+++ b/mobile/apps/photos/scripts/app_init_perf_test.sh@@ -1,14 +1,8 @@#!/bin/bash-# Make sure to go through app_init_test.dart and-# fill in email and password.-# Specify destination directory for the perf results in perf_driver.dart.-# Specify the report_key of the test in perf_driver.dart. `report_key`` of-# `traceAction`` in app_init_test.dart.--# On first run, app will start from login page. from second run onwards,-# app will start from home page. --keep-app-running is for starting the-# app from home page instead of logging in on every run.+# Add credentials in integration_test/app_init_test.dart. Configure+# app_init_summary and the output filename in test_driver/perf_driver.dart.+# --keep-app-running lets later runs use the already logged-in app.export ENDPOINT="https://api.ente.com"diff --git a/mobile/apps/photos/scripts/gallery_scroll_perf_test.sh b/mobile/apps/photos/scripts/gallery_scroll_perf_test.shindex 850f5b3917..d7265c60af 100755--- a/mobile/apps/photos/scripts/gallery_scroll_perf_test.sh+++ b/mobile/apps/photos/scripts/gallery_scroll_perf_test.sh@@ -1,10 +1,8 @@#!/bin/bash-# Make sure to go through home_gallery_scroll_test.dart and-# fill in email and password.-# Specify destination directory for the perf results in perf_driver.dart.-# Specify the report_key of the test in perf_driver.dart. `report_key`` of-# `traceAction`` in app_init_test.dart.+# Add credentials in integration_test/home_gallery_scroll_test.dart.+# Configure home_gallery_scrolling_summary and the output filename in+# test_driver/perf_driver.dart.export ENDPOINT="https://api.ente.com"diff --git a/mobile/packages/ui/lib/theme/platform_text_config.dart b/mobile/packages/ui/lib/theme/platform_text_config.dartindex b04e26ef88..e63443c2f3 100644--- a/mobile/packages/ui/lib/theme/platform_text_config.dart+++ b/mobile/packages/ui/lib/theme/platform_text_config.dart@@ -44,8 +44,7 @@ class PlatformTextConfig {}static MediaQueryData adjustMediaQueryTextScaling(MediaQueryData data) {- // Clamp text scaling between 0.8 and 1.3 to prevent extreme scaling- // that can break UI layouts+ // Avoid layout breakage at extreme text scales.final textScaleFactor =(data.textScaler.scale(1.0) * getPlatformFontScaleFactor()).clamp(0.8,