Skip to content

Android auto update changes#8813

Open
jigar-f wants to merge 3 commits into
mainfrom
jigar/android-auto-update
Open

Android auto update changes#8813
jigar-f wants to merge 3 commits into
mainfrom
jigar/android-auto-update

Conversation

@jigar-f
Copy link
Copy Markdown
Contributor

@jigar-f jigar-f commented May 27, 2026

This pull request improves error handling and code readability in the Android MethodHandler class and adds new update-related strings to multiple localization files to support new update flows in the app.

Android error handling and code improvements:

  • Refactored error handling in several methods in MethodHandler.kt to use runCatching and .onFailure for more consistent and concise error reporting, replacing manual try/catch blocks. This improves maintainability and ensures all errors are reported in a standardized way. [1] [2] [3] [4] [5]
  • Improved code readability by formatting long argument lists and intent constructions for better clarity and maintainability. [1] [2]
  • Removed an unnecessary closing brace in the MethodHandler class for cleaner structure.

Localization and update flow support:

Copilot AI review requested due to automatic review settings May 27, 2026 13:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the app’s update-check flow by expanding the Flutter Updater to support Android sideload updates alongside existing desktop auto-updates, refactoring the Android sideload updater implementation (networking, semver comparison, dialogs/telemetry), and adding new i18n strings to support the new update UI.

Changes:

  • Add direct Dart dependencies (http, pub_semver) to support Android sideload update networking and version comparison.
  • Refactor Android sideload update checking/install prompting (HTTP POST to update endpoint, semver parsing, dialogs/notifications, telemetry logging).
  • Add new update-related localization strings across supported .po files and refactor Android MethodHandler error handling/readability.

Reviewed changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pubspec.yaml Adds http and pub_semver as direct dependencies for update checking/version comparison.
pubspec.lock Updates lockfile to reflect new direct dependencies.
lib/core/updater/updater.dart Extends updater logic to treat Android as a supported platform and routes manual checks appropriately.
lib/core/updater/android_sideload_updater.dart Major refactor: HTTP-based update fetch, semver parsing via pub_semver, UI dialogs/notifications, install flow + telemetry.
lib/core/common/app_urls.dart Centralizes the Android sideload update endpoint URL.
assets/locales/*.po Adds new update-flow strings (e.g., Update now/Later/Up to date/check failures).
android/app/src/main/kotlin/org/getlantern/lantern/handler/MethodHandler.kt Refactors several method handlers to use runCatching and improves formatting/readability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/core/updater/android_sideload_updater.dart Outdated
Comment thread lib/core/updater/android_sideload_updater.dart
Comment thread lib/core/updater/android_sideload_updater.dart Outdated
Comment thread assets/locales/en.po Outdated
@jigar-f jigar-f requested a review from atavism May 27, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants