From 1fbc85ec9917eb29047461cec09157f70b1afe78 Mon Sep 17 00:00:00 2001 From: Kha Truong <64438356+khatruong2009@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:02:44 -0800 Subject: [PATCH] Chore(logging): move queued-item-store into aws_logging_cloudwatch (#4086) --- .github/dependabot.yaml | 95 ++++--- .github/workflows/amplify_api_dart.yaml | 4 + .github/workflows/amplify_core.yaml | 4 + .github/workflows/amplify_datastore.yaml | 4 + .../amplify_datastore_plugin_interface.yaml | 4 + .../workflows/amplify_push_notifications.yaml | 4 + .../amplify_push_notifications_example.yaml | 4 + .github/workflows/aws_logging_cloudwatch.yaml | 4 + .../src/amplify_cloudwatch_logger_plugin.dart | 2 - .../amplify_logging_cloudwatch/pubspec.yaml | 3 - .../test/queued_item_store_test.dart | 248 ------------------ .../com.amplify.logging_cached_logs.sqlite | Bin 0 -> 1302528 bytes .../lib/src/cloudwatch_logger_plugin.dart | 11 +- .../src/path_provider/app_path_provider.dart | 6 + .../path_provider/app_path_provider_html.dart | 22 ++ .../path_provider/app_path_provider_io.dart | 24 ++ .../path_provider/app_path_provider_stub.dart | 26 ++ .../dart_queued_item_store.dart | 0 .../dart_queued_item_store.stub.dart | 4 +- .../dart_queued_item_store.vm.dart | 14 +- .../dart_queued_item_store.web.dart | 4 +- .../drift/drift_queued_item_store.dart | 0 .../drift/drift_queued_item_store.g.dart | 0 .../index_db/indexed_db_adapter.dart | 0 .../aws_logging_cloudwatch/pubspec.yaml | 3 + .../queued_item_store_test.dart | 244 ++++++++++++++++- 26 files changed, 418 insertions(+), 316 deletions(-) delete mode 100644 packages/logging_cloudwatch/amplify_logging_cloudwatch/test/queued_item_store_test.dart create mode 100644 packages/logging_cloudwatch/aws_logging_cloudwatch/com.amplify.logging_cached_logs.sqlite create mode 100644 packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider.dart create mode 100644 packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_html.dart create mode 100644 packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart create mode 100644 packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart rename packages/logging_cloudwatch/{amplify_logging_cloudwatch => aws_logging_cloudwatch}/lib/src/queued_item_store/dart_queued_item_store.dart (100%) rename packages/logging_cloudwatch/{amplify_logging_cloudwatch => aws_logging_cloudwatch}/lib/src/queued_item_store/dart_queued_item_store.stub.dart (94%) rename packages/logging_cloudwatch/{amplify_logging_cloudwatch => aws_logging_cloudwatch}/lib/src/queued_item_store/dart_queued_item_store.vm.dart (77%) rename packages/logging_cloudwatch/{amplify_logging_cloudwatch => aws_logging_cloudwatch}/lib/src/queued_item_store/dart_queued_item_store.web.dart (93%) rename packages/logging_cloudwatch/{amplify_logging_cloudwatch => aws_logging_cloudwatch}/lib/src/queued_item_store/drift/drift_queued_item_store.dart (100%) rename packages/logging_cloudwatch/{amplify_logging_cloudwatch => aws_logging_cloudwatch}/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart (100%) rename packages/logging_cloudwatch/{amplify_logging_cloudwatch => aws_logging_cloudwatch}/lib/src/queued_item_store/index_db/indexed_db_adapter.dart (100%) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 896d93cf4e..5005f3e58d 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -174,10 +174,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -209,6 +209,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -275,11 +276,11 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -308,10 +309,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -344,10 +345,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -377,6 +378,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -428,10 +430,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -471,6 +473,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -520,12 +523,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -551,12 +554,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -580,6 +583,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -671,10 +675,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -729,10 +733,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -775,10 +779,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -819,10 +823,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -870,12 +874,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -904,12 +908,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -942,12 +946,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -978,6 +982,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -1014,10 +1019,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1073,12 +1078,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -1121,12 +1126,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -1168,10 +1173,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1236,10 +1241,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1276,10 +1281,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1315,10 +1320,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1361,10 +1366,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1405,10 +1410,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1443,10 +1448,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1482,10 +1487,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1513,10 +1518,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1904,10 +1909,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" # Group dependencies which have a constraint set in the global "pubspec.yaml" groups: device_info_plus: @@ -1948,10 +1953,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -1979,10 +1984,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -2007,6 +2012,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_signature_v4" + - dependency-name: "amplify_db_common_dart" - dependency-name: "smithy" - dependency-name: "smithy_aws" # Group dependencies which have a constraint set in the global "pubspec.yaml" @@ -2014,6 +2020,9 @@ updates: built_value: patterns: - "built_value" + drift: + patterns: + - "drift" intl: patterns: - "intl" @@ -2050,6 +2059,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_signature_v4" + - dependency-name: "amplify_db_common_dart" - dependency-name: "smithy" - dependency-name: "smithy_aws" # Group dependencies which have a constraint set in the global "pubspec.yaml" @@ -2075,6 +2085,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_signature_v4" + - dependency-name: "amplify_db_common_dart" - dependency-name: "smithy" - dependency-name: "smithy_aws" # Group dependencies which have a constraint set in the global "pubspec.yaml" @@ -2099,6 +2110,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -2160,6 +2172,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -2182,6 +2195,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" @@ -2205,10 +2219,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -2248,10 +2262,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -2280,10 +2294,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3187,11 +3201,11 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_db_common" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_storage_s3_dart" - package-ecosystem: "pub" directory: "packages/storage/amplify_storage_s3/example" @@ -3210,10 +3224,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3257,10 +3271,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3301,10 +3315,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" # Group dependencies which have a constraint set in the global "pubspec.yaml" groups: async: @@ -3350,10 +3364,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3384,10 +3398,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3418,12 +3432,12 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - dependency-name: "amplify_flutter" - dependency-name: "amplify_logging_cloudwatch" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" @@ -3458,10 +3472,10 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" - - dependency-name: "amplify_db_common_dart" - dependency-name: "amplify_secure_storage_dart" - dependency-name: "worker_bee" - dependency-name: "worker_bee_builder" @@ -3497,6 +3511,7 @@ updates: - dependency-name: "aws_common" - dependency-name: "amplify_lints" - dependency-name: "aws_logging_cloudwatch" + - dependency-name: "amplify_db_common_dart" - dependency-name: "aws_signature_v4" - dependency-name: "smithy" - dependency-name: "smithy_aws" diff --git a/.github/workflows/amplify_api_dart.yaml b/.github/workflows/amplify_api_dart.yaml index 6961d7a08f..88a3a85db4 100644 --- a/.github/workflows/amplify_api_dart.yaml +++ b/.github/workflows/amplify_api_dart.yaml @@ -24,6 +24,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -50,6 +52,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_core.yaml b/.github/workflows/amplify_core.yaml index 4e860cb45e..60bb40b7ff 100644 --- a/.github/workflows/amplify_core.yaml +++ b/.github/workflows/amplify_core.yaml @@ -22,6 +22,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -46,6 +48,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_datastore.yaml b/.github/workflows/amplify_datastore.yaml index 9d6f8f5958..03facfd76b 100644 --- a/.github/workflows/amplify_datastore.yaml +++ b/.github/workflows/amplify_datastore.yaml @@ -22,6 +22,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -46,6 +48,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_datastore_plugin_interface.yaml b/.github/workflows/amplify_datastore_plugin_interface.yaml index a6550afd87..4399997ded 100644 --- a/.github/workflows/amplify_datastore_plugin_interface.yaml +++ b/.github/workflows/amplify_datastore_plugin_interface.yaml @@ -20,6 +20,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' @@ -42,6 +44,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/smithy/smithy/lib/**/*.dart' diff --git a/.github/workflows/amplify_push_notifications.yaml b/.github/workflows/amplify_push_notifications.yaml index 93f79bffde..db29a6a34c 100644 --- a/.github/workflows/amplify_push_notifications.yaml +++ b/.github/workflows/amplify_push_notifications.yaml @@ -19,6 +19,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/**/*.dart' @@ -52,6 +54,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/**/*.dart' diff --git a/.github/workflows/amplify_push_notifications_example.yaml b/.github/workflows/amplify_push_notifications_example.yaml index 97b9b0ad30..730d5f4750 100644 --- a/.github/workflows/amplify_push_notifications_example.yaml +++ b/.github/workflows/amplify_push_notifications_example.yaml @@ -16,6 +16,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/example/**/*.dart' @@ -48,6 +50,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml' - 'packages/notifications/push/amplify_push_notifications/example/**/*.dart' diff --git a/.github/workflows/aws_logging_cloudwatch.yaml b/.github/workflows/aws_logging_cloudwatch.yaml index 90af71948a..936449a852 100644 --- a/.github/workflows/aws_logging_cloudwatch.yaml +++ b/.github/workflows/aws_logging_cloudwatch.yaml @@ -20,6 +20,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*' @@ -44,6 +46,8 @@ on: - 'packages/aws_common/pubspec.yaml' - 'packages/aws_signature_v4/lib/**/*.dart' - 'packages/aws_signature_v4/pubspec.yaml' + - 'packages/common/amplify_db_common_dart/lib/**/*.dart' + - 'packages/common/amplify_db_common_dart/pubspec.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.dart' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/**/*.yaml' - 'packages/logging_cloudwatch/aws_logging_cloudwatch/lib/**/*' diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart b/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart index ac54bd8ac1..d06246afdf 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart +++ b/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/amplify_cloudwatch_logger_plugin.dart @@ -1,6 +1,5 @@ import 'package:amplify_logging_cloudwatch/src/amplify_log_stream_name_provider.dart'; import 'package:amplify_logging_cloudwatch/src/path_provider/flutter_path_provider.dart'; -import 'package:amplify_logging_cloudwatch/src/queued_item_store/dart_queued_item_store.dart'; import 'package:aws_logging_cloudwatch/aws_logging_cloudwatch.dart'; /// {@macro aws_logging_cloudwatch.cloudwatch_logger_plugin} @@ -17,7 +16,6 @@ class AmplifyCloudWatchLoggerPlugin extends CloudWatchLoggerPlugin { defaultLogStreamNameProvider: AmplifyLogStreamNameProvider().defaultLogStreamName, ), - logStore: DartQueuedItemStore(null), remoteLoggingConstraintProvider: pluginConfig.defaultRemoteConfiguration == null ? null diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml b/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml index 91bea196cd..13b701cbba 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml +++ b/packages/logging_cloudwatch/amplify_logging_cloudwatch/pubspec.yaml @@ -11,12 +11,9 @@ environment: dependencies: amplify_core: ">=1.4.0 <1.5.0" - amplify_db_common_dart: ">=0.3.0+1 <0.4.0" aws_common: ">=0.6.0 <0.7.0" aws_logging_cloudwatch: ^0.1.0 - collection: ^1.15.0 device_info_plus: ^9.0.0 - drift: ">=2.12.0 <2.13.0" flutter: sdk: flutter intl: ">=0.18.0 <1.0.0" diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/test/queued_item_store_test.dart b/packages/logging_cloudwatch/amplify_logging_cloudwatch/test/queued_item_store_test.dart deleted file mode 100644 index c49b105780..0000000000 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/test/queued_item_store_test.dart +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -import 'package:amplify_logging_cloudwatch/src/queued_item_store/dart_queued_item_store.dart'; -import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; -import 'package:test/test.dart'; - -void main() { - late DartQueuedItemStore db; - - group('DartQueuedItemStore ', () { - setUpAll(() { - db = DartQueuedItemStore('/tmp'); - }); - - tearDownAll(() async { - await db.clear(); - }); - - setUp(() async { - await db.clear(); - }); - - Future> getAll() async { - return db.getCount(100); - } - - test('writes values to storage', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await db.getCount(values.length); - final readValues = readItems.map((e) => e.value); - expect(readValues, equals(values)); - }); - - test('writes values to storage with enable queue rotation', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem( - value, - DateTime.now().toIso8601String(), - enableQueueRotation: true, - ); - } - - final readItems = await getAll(); - expect(readItems.length, 1); - expect(readItems.first.value, values.last); - }); - - test('returns first n items in storage', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await db.getCount(3); - final readValues = readItems.map((e) => e.value); - expect(readValues, equals(values.sublist(0, 3))); - }); - - test( - 'returns all stored items when get request size exceeds stored item count', - () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await db.getCount(100); - final readValues = readItems.map((e) => e.value); - expect(readValues, values); - }); - - test('deletes all items in storage', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - await db.deleteItems(await getAll()); - - final readItems = await getAll(); - expect(readItems, isEmpty); - }); - - test('deletes first subset of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - await db.deleteItems(await db.getCount(3)); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(3)); - }); - - test('deletes middle subset of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(3, 7); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, const ['0', '1', '2', '7', '8', '9']); - }); - - test('deletes last subset of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(7); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(0, 7)); - }); - - test('deletes first, middle, and last subsets of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - const valuesToDelete = ['0', '1', '4', '5', '8', '9']; - final itemsToDelete = (await getAll()).where((item) { - return valuesToDelete.contains(item.value); - }); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, const ['2', '3', '6', '7']); - }); - - test('deletes inner left and right subsets of stored items', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - const valuesToDelete = ['1', '2', '4', '5', '7', '8']; - final itemsToDelete = (await getAll()).where((item) { - return valuesToDelete.contains(item.value); - }); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, const ['0', '3', '6', '9']); - }); - - test('deletes the first stored item', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(0, 1); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(1)); - }); - - test('deletes the last stored item', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final itemsToDelete = (await getAll()).toList().sublist(9); - await db.deleteItems(itemsToDelete); - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values.sublist(0, 9)); - }); - - test('throws no error when deleting all items twice', () async { - const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - var readValues = await getAll(); - - await db.deleteItems(readValues); - await db.deleteItems(readValues); - - readValues = await getAll(); - - expect(readValues, isEmpty); - }); - - test('returns all stored items', () async { - const values = ['0', '1', '2', '3', '4', '5']; - for (final value in values) { - await db.addItem(value, DateTime.now().toIso8601String()); - } - - final readItems = await getAll(); - final readValues = readItems.map((e) => e.value); - expect(readValues, values); - }); - - test('returns empty list when no items are stored', () async { - final readItems = await getAll(); - expect(readItems, isEmpty); - }); - - test( - 'checks if storage is full', - () async { - const capacityLimit = 1; - - final largeItem = '0' * 10240; // 10KB for example - - for (var i = 0; i < 5; i++) { - await db.addItem(largeItem, DateTime.now().toIso8601String()); - } - - var result = db.isFull(capacityLimit); - expect(result, isFalse); - - for (var i = 0; i < 100; i++) { - await db.addItem(largeItem, DateTime.now().toIso8601String()); - } - - result = db.isFull(capacityLimit); - expect(result, isTrue); - }, - ); - }); -} diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/com.amplify.logging_cached_logs.sqlite b/packages/logging_cloudwatch/aws_logging_cloudwatch/com.amplify.logging_cached_logs.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..89304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tWB1PBlyK!5-N0t5&UAV8qMKzIIs zF*^0t5&UAV7cs0RjXF5FpU9fc*a`Q=Wz$Y=i-mF1!C6mBO#fB*pk1PBlyK!5-N0tAK;=+6Jo7wcKR2k?Yp?$Ct* z0RjXF5FkK+009C72oPvhK>q)5e9~702oNAZV3Yy}lUK_Bx4LbaivR%v1PIg@$Y=kT zmK~@5Bqkt0fB*pk1PBlyK!5-N0tEUCbm#wPi)s1!|CjXduLA)B1PBlyK!5-N0t5&U zAkeaa{QoFZo`xnsfB*pkhXoEMuaN(5dE+u00RjXF5U4AV&;G9{%R}8M+)jW10RjXF z5FkK+009C72n-|8ng3sJ7t3kB2XOf?cj!WZ009C72oNAZfB*pk1PHV$Apd_jKItn0 z1PBlyFiL@g$;;*cTiv$IMSuVS0tD&{L{xAPu|L=qe2oNAZfB*pk1PBlyK!Csy z0^Rxl^=doI_W+(a#0`27AV7cs0RjXF5FkK+009E+3dsMDGUaJ#0t5&UAaGdVVDd8g z|91B+lMx_5fB=Eo0{QHJQI?0=bGV-X0RjXF5FkK+009C72oM-TpgaG+T(8T||DO+W zgB}D35FkK+009C72oNAZfIzzf^8bh9lfEKAfB*pkqZBxp+%Es$?!IL*0t5&UAW&N% zpZ%}Pj#GOM_Y)vMfB*pk1PBlyK!5-N0z(LN=l>V;`6}N7SPgN59s~#wAV7cs0RjXF z5FkK+K)V9+|D#NK8kztB0t5&g7C4yPCjZ~=zGX531PBlyP+K6M{qM^1PZNeK`jK!Cvg3LH#6(dYmFxI2^X1PBlyKw!)Q`Dg#1Quc^3 z{~pXvfB*pk1PBlyK!5-N0t5)WU!e2n|E+f0?Izy?xcdEnl|K?7K!5-N0t5&UAV7cs K0RkVK0{;)O@G getApplicationSupportPath() async { + return ''; + } + + @override + Future getTemporaryPath() async { + return ''; + } +} diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart new file mode 100644 index 0000000000..87fe157320 --- /dev/null +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart @@ -0,0 +1,24 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import 'dart:io'; + +import 'package:amplify_core/amplify_core.dart'; + +/// {@template aws_logging_cloudwatch.app_path_provider} +/// Provides App paths for aws_logging_cloudwatch package. +/// {@endtemplate} +class DartAppPathProvider implements AppPathProvider { + /// {@macro aws_logging_cloudwatch.app_path_provider} + const DartAppPathProvider(); + + @override + Future getApplicationSupportPath() async { + return Directory.current.path; + } + + @override + Future getTemporaryPath() async { + return Directory.systemTemp.path; + } +} diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart new file mode 100644 index 0000000000..068f8f04f2 --- /dev/null +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart @@ -0,0 +1,26 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +import 'package:amplify_core/amplify_core.dart'; + +/// {@template aws_logging_cloudwatch.app_path_provider} +/// Provides App paths for aws_logging_cloudwatch package. +/// {@endtemplate} +class DartAppPathProvider implements AppPathProvider { + /// {@macro aws_logging_cloudwatch.app_path_provider} + const DartAppPathProvider(); + + @override + Future getApplicationSupportPath() async { + throw UnimplementedError( + 'getApplicationSupportPath() has not been implemented in the current platform.', + ); + } + + @override + Future getTemporaryPath() async { + throw UnimplementedError( + 'getTemporaryPath() has not been implemented in the current platform.', + ); + } +} diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.dart diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart similarity index 94% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart index fd2bd1fee4..5db1a8d647 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.stub.dart @@ -3,7 +3,7 @@ import 'dart:async'; -import 'package:aws_common/aws_common.dart'; +import 'package:amplify_core/amplify_core.dart'; // ignore: implementation_imports import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:meta/meta.dart'; @@ -14,7 +14,7 @@ import 'package:meta/meta.dart'; class DartQueuedItemStore implements QueuedItemStore, Closeable { /// {@macro amplify_logging_cloudwatch.dart_queued_item_store} // ignore: avoid_unused_constructor_parameters - DartQueuedItemStore(String? storagePath) { + DartQueuedItemStore(AppPathProvider appPathProvider) { throw UnimplementedError('constructor has not been implemented.'); } diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart similarity index 77% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart index c4cb9ef090..2ea1ae0c5a 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.vm.dart @@ -3,23 +3,17 @@ import 'dart:async'; -import 'package:amplify_logging_cloudwatch/src/queued_item_store/drift/drift_queued_item_store.dart'; -import 'package:aws_common/aws_common.dart'; +import 'package:amplify_core/amplify_core.dart'; +import 'package:aws_logging_cloudwatch/src/queued_item_store/drift/drift_queued_item_store.dart'; // ignore: implementation_imports import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:meta/meta.dart'; -import 'package:path_provider/path_provider.dart'; /// {@macro amplify_logging_cloudwatch.dart_queued_item_store} class DartQueuedItemStore implements QueuedItemStore, Closeable { /// {@macro amplify_logging_cloudwatch.dart_queued_item_store} - factory DartQueuedItemStore(String? storagePath) { - final FutureOr path; - if (storagePath == null) { - path = getApplicationSupportDirectory().then((value) => value.path); - } else { - path = storagePath; - } + factory DartQueuedItemStore(AppPathProvider pathProvider) { + final FutureOr path = pathProvider.getApplicationSupportPath(); final database = DriftQueuedItemStore(path); return DartQueuedItemStore._(database); } diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart similarity index 93% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart index 9cc7c50b96..deac3ff6cb 100644 --- a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/dart_queued_item_store.web.dart @@ -6,8 +6,8 @@ import 'dart:async'; import 'package:amplify_core/amplify_core.dart'; -import 'package:amplify_logging_cloudwatch/src/queued_item_store/index_db/indexed_db_adapter.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/in_memory_queued_item_store.dart'; +import 'package:aws_logging_cloudwatch/src/queued_item_store/index_db/indexed_db_adapter.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:meta/meta.dart'; @@ -17,7 +17,7 @@ class DartQueuedItemStore implements QueuedItemStore, Closeable { /// {@macro amplify_logging_cloudwatch.index_db_queued_item_store} // ignore: avoid_unused_constructor_parameters - DartQueuedItemStore(String? storagePath); + DartQueuedItemStore(AppPathProvider appPathProvider); late final Future _database = () async { if (await IndexedDbAdapter.checkIsIndexedDBSupported()) { diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.dart diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/drift/drift_queued_item_store.g.dart diff --git a/packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart similarity index 100% rename from packages/logging_cloudwatch/amplify_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart rename to packages/logging_cloudwatch/aws_logging_cloudwatch/lib/src/queued_item_store/index_db/indexed_db_adapter.dart diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml b/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml index 095c3f2ee3..90d70b085f 100644 --- a/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/pubspec.yaml @@ -10,10 +10,13 @@ environment: dependencies: amplify_core: ">=1.4.0 <1.5.0" + amplify_db_common_dart: ">=0.3.0+1 <0.4.0" aws_common: ">=0.6.0 <0.7.0" aws_signature_v4: ">=0.5.0 <0.6.0" built_collection: ^5.1.1 built_value: ">=8.6.0 <8.7.0" + collection: ^1.15.0 + drift: ">=2.12.0 <2.13.0" fixnum: ^1.1.0 intl: ">=0.18.0 <1.0.0" json_annotation: ">=4.8.1 <4.9.0" diff --git a/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart b/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart index ab035a6ca2..3576e0daa0 100644 --- a/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart +++ b/packages/logging_cloudwatch/aws_logging_cloudwatch/test/queued_item_store/queued_item_store_test.dart @@ -1,6 +1,8 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +import 'package:aws_logging_cloudwatch/src/path_provider/app_path_provider.dart'; +import 'package:aws_logging_cloudwatch/src/queued_item_store/dart_queued_item_store.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/in_memory_queued_item_store.dart'; import 'package:aws_logging_cloudwatch/src/queued_item_store/queued_item_store.dart'; import 'package:test/test.dart'; @@ -231,7 +233,7 @@ void main() { await db.addItem('0', DateTime.now().toIso8601String()); } - var result = db.isFull(capacityLimit); + var result = await db.isFull(capacityLimit); expect(result, isFalse); // add enough items to exceed capacity limit of 1mb @@ -239,7 +241,245 @@ void main() { await db.addItem('0', DateTime.now().toIso8601String()); } - result = db.isFull(capacityLimit); + result = await db.isFull(capacityLimit); + expect(result, isTrue); + }, + ); + }); + + group('DartQueuedItemStore ', () { + setUpAll(() { + db = DartQueuedItemStore(const DartAppPathProvider()); + }); + + tearDownAll(() async { + await db.clear(); + }); + + setUp(() async { + await db.clear(); + }); + + Future> getAll() async { + return db.getCount(100); + } + + test('writes values to storage', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await db.getCount(values.length); + final readValues = readItems.map((e) => e.value); + expect(readValues, equals(values)); + }); + + test('writes values to storage with enable queue rotation', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem( + value, + DateTime.now().toIso8601String(), + enableQueueRotation: true, + ); + } + + final readItems = await getAll(); + expect(readItems.length, 1); + expect(readItems.first.value, values.last); + }); + + test('returns first n items in storage', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await db.getCount(3); + final readValues = readItems.map((e) => e.value); + expect(readValues, equals(values.sublist(0, 3))); + }); + + test( + 'returns all stored items when get request size exceeds stored item count', + () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await db.getCount(100); + final readValues = readItems.map((e) => e.value); + expect(readValues, values); + }); + + test('deletes all items in storage', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + await db.deleteItems(await getAll()); + + final readItems = await getAll(); + expect(readItems, isEmpty); + }); + + test('deletes first subset of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + await db.deleteItems(await db.getCount(3)); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(3)); + }); + + test('deletes middle subset of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(3, 7); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, const ['0', '1', '2', '7', '8', '9']); + }); + + test('deletes last subset of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(7); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(0, 7)); + }); + + test('deletes first, middle, and last subsets of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + const valuesToDelete = ['0', '1', '4', '5', '8', '9']; + final itemsToDelete = (await getAll()).where((item) { + return valuesToDelete.contains(item.value); + }); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, const ['2', '3', '6', '7']); + }); + + test('deletes inner left and right subsets of stored items', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + const valuesToDelete = ['1', '2', '4', '5', '7', '8']; + final itemsToDelete = (await getAll()).where((item) { + return valuesToDelete.contains(item.value); + }); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, const ['0', '3', '6', '9']); + }); + + test('deletes the first stored item', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(0, 1); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(1)); + }); + + test('deletes the last stored item', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final itemsToDelete = (await getAll()).toList().sublist(9); + await db.deleteItems(itemsToDelete); + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values.sublist(0, 9)); + }); + + test('throws no error when deleting all items twice', () async { + const values = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + var readValues = await getAll(); + + await db.deleteItems(readValues); + await db.deleteItems(readValues); + + readValues = await getAll(); + + expect(readValues, isEmpty); + }); + + test('returns all stored items', () async { + const values = ['0', '1', '2', '3', '4', '5']; + for (final value in values) { + await db.addItem(value, DateTime.now().toIso8601String()); + } + + final readItems = await getAll(); + final readValues = readItems.map((e) => e.value); + expect(readValues, values); + }); + + test('returns empty list when no items are stored', () async { + final readItems = await getAll(); + expect(readItems, isEmpty); + }); + + test( + 'checks if storage is full', + () async { + const capacityLimit = 1; + + final largeItem = '0' * 10240; // 10KB for example + + for (var i = 0; i < 5; i++) { + await db.addItem(largeItem, DateTime.now().toIso8601String()); + } + + var result = await db.isFull(capacityLimit); + expect(result, isFalse); + + for (var i = 0; i < 100; i++) { + await db.addItem(largeItem, DateTime.now().toIso8601String()); + } + + result = await db.isFull(capacityLimit); expect(result, isTrue); }, );