diff --git a/android/fastlane/metadata/android/de-DE/changelogs/4043.txt b/android/fastlane/metadata/android/de-DE/changelogs/4043.txt index f591cc4..7a2fa95 100644 --- a/android/fastlane/metadata/android/de-DE/changelogs/4043.txt +++ b/android/fastlane/metadata/android/de-DE/changelogs/4043.txt @@ -1,2 +1,3 @@ -- New feature: Notes -- Several bugfixes +- Neues Feature: Notizen +- Neue Sprache: Italienisch +- Mehere Fehlerbehebungen \ No newline at end of file diff --git a/android/fastlane/metadata/android/en-US/changelogs/4043.txt b/android/fastlane/metadata/android/en-US/changelogs/4043.txt new file mode 100644 index 0000000..da50afe --- /dev/null +++ b/android/fastlane/metadata/android/en-US/changelogs/4043.txt @@ -0,0 +1,3 @@ +- New feature: Notes +- New language: Italian +- Multiple bugfixes \ No newline at end of file diff --git a/build.yaml b/build.yaml index 57dfbd7..936a264 100644 --- a/build.yaml +++ b/build.yaml @@ -1,16 +1,8 @@ targets: $default: - include: - - pubspec.yaml - sources: - - assets/** - - lib/$lib$ - - lib/**.dart - - test/**.dart - - integration_test/**.dart - builders: mockito|mockBuilder: generate_for: + - lib/**.dart - test/**.dart - integration_test/**.dart \ No newline at end of file diff --git a/lib/constants.dart b/lib/constants.dart index 2a86892..cac12c5 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -5,3 +5,5 @@ import 'package:package_info_plus/package_info_plus.dart'; late final PackageInfo packageInfo; late final AndroidDeviceInfo? androidInfo; late final IosDeviceInfo? iosInfo; + +const latestSupportedApiVersion = 3; diff --git a/lib/features/changelogs/view/changelog_dialog.dart b/lib/features/changelogs/view/changelog_dialog.dart index a9804b1..202d271 100644 --- a/lib/features/changelogs/view/changelog_dialog.dart +++ b/lib/features/changelogs/view/changelog_dialog.dart @@ -63,6 +63,7 @@ class ChangelogDialog extends StatelessWidget { } const _versionNumbers = { + "4043": "3.2.0", "4033": "3.1.8", "4023": "3.1.7", "4013": "3.1.6", diff --git a/lib/features/login/cubit/authentication_cubit.dart b/lib/features/login/cubit/authentication_cubit.dart index 3263750..1c1eac6 100644 --- a/lib/features/login/cubit/authentication_cubit.dart +++ b/lib/features/login/cubit/authentication_cubit.dart @@ -4,6 +4,7 @@ import 'package:flutter/widgets.dart'; import 'package:hive_flutter/adapters.dart'; import 'package:hydrated_bloc/hydrated_bloc.dart'; import 'package:paperless_api/paperless_api.dart'; +import 'package:paperless_mobile/constants.dart'; import 'package:paperless_mobile/core/bloc/transient_error.dart'; import 'package:paperless_mobile/core/database/hive/hive_config.dart'; import 'package:paperless_mobile/core/database/hive/hive_extensions.dart'; @@ -619,12 +620,19 @@ class AuthenticationCubit extends Cubit { try { final response = await dio.get( "/api/", - options: Options( - sendTimeout: timeout, - ), + options: Options(sendTimeout: timeout), ); - final apiVersion = + int apiVersion = int.parse(response.headers.value('x-api-version') ?? "3"); + if (apiVersion > latestSupportedApiVersion) { + logger.fw( + "The server is running a newer API version ($apiVersion) than the app supports (v$latestSupportedApiVersion), falling back to latest supported version (v$latestSupportedApiVersion). " + "Warning: This might lead to unexpected behavior!", + className: runtimeType.toString(), + methodName: '_getApiVersion', + ); + apiVersion = latestSupportedApiVersion; + } logger.fd( "Successfully retrieved API version ($apiVersion).", className: runtimeType.toString(), diff --git a/pubspec.yaml b/pubspec.yaml index ed1600c..a4ed52c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 3.1.8+403 +version: 3.2.0+404 environment: sdk: ">=3.1.0 <4.0.0"