From 552c543f85f4895866773acf3782c5f53b2e539f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Andra=C5=A1ec?= Date: Wed, 17 Jan 2024 09:01:28 +0000 Subject: [PATCH 1/5] Add support for `readTransaction` in `sqflite` (#1819) --- CHANGELOG.md | 3 +- sqflite/lib/src/sentry_database.dart | 93 +++++++++++++++++++++++++- sqflite/test/sentry_database_test.dart | 42 ++++++++++++ 3 files changed, 134 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f822c59ae8..fd7f354246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ - Add isar breadcrumbs ([#1800](https://github.com/getsentry/sentry-dart/pull/1800)) - Starting with Flutter 3.16, Sentry adds the [`appFlavor`](https://api.flutter.dev/flutter/services/appFlavor-constant.html) to the `flutter_context` ([#1799](https://github.com/getsentry/sentry-dart/pull/1799)) - Add beforeScreenshotCallback to SentryFlutterOptions ([#1805](https://github.com/getsentry/sentry-dart/pull/1805)) - +- Add support for `readTransaction` in `sqflite` ([#1819](https://github.com/getsentry/sentry-dart/pull/1819)) + ### Dependencies - Bump Android SDK from v7.0.0 to v7.1.0 ([#1788](https://github.com/getsentry/sentry-dart/pull/1788)) diff --git a/sqflite/lib/src/sentry_database.dart b/sqflite/lib/src/sentry_database.dart index fafcad06d9..23ac1dae63 100644 --- a/sqflite/lib/src/sentry_database.dart +++ b/sqflite/lib/src/sentry_database.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:meta/meta.dart'; import 'package:sentry/sentry.dart'; import 'package:sqflite/sqflite.dart'; @@ -32,7 +34,10 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { // ignore: public_member_api_docs static const dbSqlQueryOp = 'db.sql.query'; - static const _dbSqlOp = 'db.sql.transaction'; + static const _dbSqlTransactionOp = 'db.sql.transaction'; + + static const _dbSqlReadTransactionOp = 'db.sql.read_transaction'; + @internal // ignore: public_member_api_docs static const dbSystemKey = 'db.system'; @@ -143,7 +148,7 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { final currentSpan = _hub.getSpan(); final description = 'Transaction DB: ${_database.path}'; final span = currentSpan?.startChild( - _dbSqlOp, + _dbSqlTransactionOp, description: description, ); // ignore: invalid_use_of_internal_member @@ -152,7 +157,7 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { var breadcrumb = Breadcrumb( message: description, - category: _dbSqlOp, + category: _dbSqlTransactionOp, data: {}, type: 'query', ); @@ -196,4 +201,86 @@ class SentryDatabase extends SentryDatabaseExecutor implements Database { } }); } + + @override + // ignore: override_on_non_overriding_member, public_member_api_docs + Future readTransaction(Future Function(Transaction txn) action) { + return Future(() async { + final currentSpan = _hub.getSpan(); + final description = 'Transaction DB: ${_database.path}'; + final span = currentSpan?.startChild( + _dbSqlReadTransactionOp, + description: description, + ); + // ignore: invalid_use_of_internal_member + span?.origin = SentryTraceOrigins.autoDbSqfliteDatabase; + setDatabaseAttributeData(span, dbName); + + var breadcrumb = Breadcrumb( + message: description, + category: _dbSqlReadTransactionOp, + data: {}, + type: 'query', + ); + setDatabaseAttributeOnBreadcrumb(breadcrumb, dbName); + + Future newAction(Transaction txn) async { + final executor = SentryDatabaseExecutor( + txn, + parentSpan: span, + hub: _hub, + dbName: dbName, + ); + final sentrySqfliteTransaction = + SentrySqfliteTransaction(executor, hub: _hub, dbName: dbName); + + return await action(sentrySqfliteTransaction); + } + + try { + final futureOrResult = _resolvedReadTransaction(newAction); + T result; + + if (futureOrResult is Future) { + result = await futureOrResult; + } else { + result = futureOrResult; + } + + span?.status = SpanStatus.ok(); + breadcrumb.data?['status'] = 'ok'; + + return result; + } catch (exception) { + span?.throwable = exception; + span?.status = SpanStatus.internalError(); + breadcrumb.data?['status'] = 'internal_error'; + breadcrumb = breadcrumb.copyWith( + level: SentryLevel.warning, + ); + + rethrow; + } finally { + await span?.finish(); + + // ignore: invalid_use_of_internal_member + await _hub.scope.addBreadcrumb(breadcrumb); + } + }); + } + + FutureOr _resolvedReadTransaction( + Future Function(Transaction txn) action, + ) async { + try { + // ignore: return_of_invalid_type + final result = await (_database as dynamic).readTransaction(action); + // Await and cast, as directly returning the future resulted in a runtime error. + return result as T; + } on NoSuchMethodError catch (_) { + // The `readTransaction` does not exists on sqflite version < 2.5.0+2. + // Fallback to transaction instead. + return _database.transaction(action); + } + } } diff --git a/sqflite/test/sentry_database_test.dart b/sqflite/test/sentry_database_test.dart index ad1a07b360..492da311df 100644 --- a/sqflite/test/sentry_database_test.dart +++ b/sqflite/test/sentry_database_test.dart @@ -107,6 +107,27 @@ void main() { await db.close(); }); + test('creates readTransaction span', () async { + final db = await fixture.getSut(); + + await db.readTransaction((txn) async { + expect(txn is SentrySqfliteTransaction, true); + }); + final span = fixture.tracer.children.last; + expect(span.context.operation, 'db.sql.read_transaction'); + expect(span.context.description, 'Transaction DB: $inMemoryDatabasePath'); + expect(span.status, SpanStatus.ok()); + expect(span.data[SentryDatabase.dbSystemKey], SentryDatabase.dbSystem); + expect(span.data[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect( + span.origin, + // ignore: invalid_use_of_internal_member + SentryTraceOrigins.autoDbSqfliteDatabase, + ); + + await db.close(); + }); + test('creates transaction breadcrumb', () async { final db = await fixture.getSut(); @@ -128,6 +149,27 @@ void main() { await db.close(); }); + test('creates readTransaction breadcrumb', () async { + final db = await fixture.getSut(); + + await db.readTransaction((txn) async { + expect(txn is SentrySqfliteTransaction, true); + }); + + final breadcrumb = fixture.hub.scope.breadcrumbs.first; + expect(breadcrumb.message, 'Transaction DB: $inMemoryDatabasePath'); + expect(breadcrumb.category, 'db.sql.read_transaction'); + expect(breadcrumb.data?['status'], 'ok'); + expect( + breadcrumb.data?[SentryDatabase.dbSystemKey], + SentryDatabase.dbSystem, + ); + expect(breadcrumb.data?[SentryDatabase.dbNameKey], inMemoryDatabasePath); + expect(breadcrumb.type, 'query'); + + await db.close(); + }); + test('creates transaction children run by the transaction', () async { final db = await fixture.getSut(); From d68bee781fa063972c3b0e8341c49be33f593441 Mon Sep 17 00:00:00 2001 From: Giancarlo Buenaflor Date: Mon, 22 Jan 2024 13:54:19 -0500 Subject: [PATCH 2/5] ci: disable some tests temporarily (#1835) --- .github/workflows/dart.yml | 3 ++- .github/workflows/flutter_test.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 779cf5ea90..2eedf96de9 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -31,7 +31,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + # TODO: exclude windows for now, because of failing tests in the new image runner + os: [ubuntu-latest, macos-latest] sdk: [stable, beta] exclude: - os: windows-latest diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index d1ce043f54..33990219b3 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -120,7 +120,8 @@ jobs: fail-fast: false matrix: sdk: ["stable", "beta"] - target: ["ios", "macos"] + # TODO: remove ios for now, will be fixed in v8 + target: ["macos"] steps: - name: checkout uses: actions/checkout@v4 From 7551d2930b29d9a29747d4786134d2614a84594e Mon Sep 17 00:00:00 2001 From: getsentry-bot Date: Mon, 22 Jan 2024 19:17:46 +0000 Subject: [PATCH 3/5] release: 7.15.0 --- CHANGELOG.md | 2 +- dart/lib/src/version.dart | 2 +- dart/pubspec.yaml | 2 +- dio/lib/src/version.dart | 2 +- dio/pubspec.yaml | 4 ++-- drift/lib/src/version.dart | 2 +- drift/pubspec.yaml | 4 ++-- file/lib/src/version.dart | 2 +- file/pubspec.yaml | 4 ++-- flutter/example/pubspec.yaml | 2 +- flutter/lib/src/version.dart | 2 +- flutter/pubspec.yaml | 4 ++-- hive/lib/src/version.dart | 2 +- hive/pubspec.yaml | 4 ++-- isar/lib/src/version.dart | 2 +- isar/pubspec.yaml | 4 ++-- logging/lib/src/version.dart | 2 +- logging/pubspec.yaml | 4 ++-- sqflite/lib/src/version.dart | 2 +- sqflite/pubspec.yaml | 4 ++-- 20 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd7f354246..e073b7b29f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 7.15.0 ### Features diff --git a/dart/lib/src/version.dart b/dart/lib/src/version.dart index dc38fd3e11..cd68dd9443 100644 --- a/dart/lib/src/version.dart +++ b/dart/lib/src/version.dart @@ -9,7 +9,7 @@ library version; /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; String sdkName(bool isWeb) => isWeb ? _browserSdkName : _ioSdkName; diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml index 2580a618d3..e4668ad96d 100644 --- a/dart/pubspec.yaml +++ b/dart/pubspec.yaml @@ -1,5 +1,5 @@ name: sentry -version: 7.14.0 +version: 7.15.0 description: > A crash reporting library for Dart that sends crash reports to Sentry.io. This library supports Dart VM and Web. For Flutter consider sentry_flutter instead. diff --git a/dio/lib/src/version.dart b/dio/lib/src/version.dart index 9737ee6520..a0d410b5dd 100644 --- a/dio/lib/src/version.dart +++ b/dio/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_dio'; diff --git a/dio/pubspec.yaml b/dio/pubspec.yaml index 92e57a96a9..abd613d381 100644 --- a/dio/pubspec.yaml +++ b/dio/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_dio description: An integration which adds support for performance tracing for the Dio package. -version: 7.14.0 +version: 7.15.0 homepage: https://docs.sentry.io/platforms/dart/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -11,7 +11,7 @@ environment: dependencies: dio: ^5.0.0 - sentry: 7.14.0 + sentry: 7.15.0 dev_dependencies: meta: ^1.3.0 diff --git a/drift/lib/src/version.dart b/drift/lib/src/version.dart index 621ab96e95..0a1bc2ce4d 100644 --- a/drift/lib/src/version.dart +++ b/drift/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_drift'; diff --git a/drift/pubspec.yaml b/drift/pubspec.yaml index df6380ba9d..af1d524c8b 100644 --- a/drift/pubspec.yaml +++ b/drift/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_drift description: An integration which adds support for performance tracing for the drift package. -version: 7.14.0 +version: 7.15.0 homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -10,7 +10,7 @@ environment: flutter: '>=3.3.0' dependencies: - sentry: 7.14.0 + sentry: 7.15.0 meta: ^1.3.0 drift: ^2.13.0 diff --git a/file/lib/src/version.dart b/file/lib/src/version.dart index 6900c8de5d..27f4d170a5 100644 --- a/file/lib/src/version.dart +++ b/file/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_file'; diff --git a/file/pubspec.yaml b/file/pubspec.yaml index 273124df8f..60c56c6248 100644 --- a/file/pubspec.yaml +++ b/file/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_file description: An integration which adds support for performance tracing for dart.io.File. -version: 7.14.0 +version: 7.15.0 homepage: https://docs.sentry.io/platforms/dart/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -10,7 +10,7 @@ environment: sdk: '>=2.19.0 <4.0.0' dependencies: - sentry: 7.14.0 + sentry: 7.15.0 meta: ^1.3.0 dev_dependencies: diff --git a/flutter/example/pubspec.yaml b/flutter/example/pubspec.yaml index 0f279e8e8f..bb021595c1 100644 --- a/flutter/example/pubspec.yaml +++ b/flutter/example/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_flutter_example description: Demonstrates how to use the sentry_flutter plugin. -version: 7.14.0 +version: 7.15.0 publish_to: 'none' # Remove this line if you wish to publish to pub.dev diff --git a/flutter/lib/src/version.dart b/flutter/lib/src/version.dart index ff71dd6e87..dd50a348fd 100644 --- a/flutter/lib/src/version.dart +++ b/flutter/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; /// The default SDK name reported to Sentry.io in the submitted events. const String sdkName = 'sentry.dart.flutter'; diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index d06f95e31e..c41ef8d6b0 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -1,5 +1,5 @@ name: sentry_flutter -version: 7.14.0 +version: 7.15.0 description: Sentry SDK for Flutter. This package aims to support different Flutter targets by relying on the many platforms supported by Sentry with native SDKs. homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart @@ -15,7 +15,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - sentry: 7.14.0 + sentry: 7.15.0 package_info_plus: '>=1.0.0 <=5.0.1' meta: ^1.3.0 ffi: ^2.0.0 diff --git a/hive/lib/src/version.dart b/hive/lib/src/version.dart index 08b6cbe335..b775854f98 100644 --- a/hive/lib/src/version.dart +++ b/hive/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_hive'; diff --git a/hive/pubspec.yaml b/hive/pubspec.yaml index 1bdad09235..4a8ac02d4e 100644 --- a/hive/pubspec.yaml +++ b/hive/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_hive description: An integration which adds support for performance tracing for the hive package. -version: 7.14.0 +version: 7.15.0 homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -9,7 +9,7 @@ environment: sdk: '>=2.17.0 <4.0.0' dependencies: - sentry: 7.14.0 + sentry: 7.15.0 hive: ^2.2.3 meta: ^1.3.0 diff --git a/isar/lib/src/version.dart b/isar/lib/src/version.dart index 7c1a7d4031..8d8ef99293 100644 --- a/isar/lib/src/version.dart +++ b/isar/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.13.1'; +const String sdkVersion = '7.15.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_isar'; diff --git a/isar/pubspec.yaml b/isar/pubspec.yaml index df066786f8..f618fe7543 100644 --- a/isar/pubspec.yaml +++ b/isar/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_isar description: An integration which adds support for performance tracing for the isar package. -version: 7.13.1 +version: 7.15.0 homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -12,7 +12,7 @@ environment: dependencies: isar: ^3.1.0 isar_flutter_libs: ^3.1.0 # contains Isar Core - sentry: 7.14.0 + sentry: 7.15.0 meta: ^1.3.0 path: ^1.8.3 diff --git a/logging/lib/src/version.dart b/logging/lib/src/version.dart index b1e21478f7..45fd9a81a7 100644 --- a/logging/lib/src/version.dart +++ b/logging/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_logging'; diff --git a/logging/pubspec.yaml b/logging/pubspec.yaml index 02cef6966a..71de51c471 100644 --- a/logging/pubspec.yaml +++ b/logging/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_logging description: An integration which adds support for recording log from the logging package. -version: 7.14.0 +version: 7.15.0 homepage: https://docs.sentry.io/platforms/dart/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -11,7 +11,7 @@ environment: dependencies: logging: ^1.0.0 - sentry: 7.14.0 + sentry: 7.15.0 dev_dependencies: lints: ^3.0.0 diff --git a/sqflite/lib/src/version.dart b/sqflite/lib/src/version.dart index 9c361f297d..e0f78f9f60 100644 --- a/sqflite/lib/src/version.dart +++ b/sqflite/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '7.14.0'; +const String sdkVersion = '7.15.0'; /// The package name reported to Sentry.io in the submitted events. const String packageName = 'pub:sentry_sqflite'; diff --git a/sqflite/pubspec.yaml b/sqflite/pubspec.yaml index 22188a8d91..d3e48214b3 100644 --- a/sqflite/pubspec.yaml +++ b/sqflite/pubspec.yaml @@ -1,6 +1,6 @@ name: sentry_sqflite description: An integration which adds support for performance tracing for the sqflite package. -version: 7.14.0 +version: 7.15.0 homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart issue_tracker: https://github.com/getsentry/sentry-dart/issues @@ -10,7 +10,7 @@ environment: flutter: '>=3.3.0' # matching sqflite dependencies: - sentry: 7.14.0 + sentry: 7.15.0 sqflite: ^2.0.0 sqflite_common: ^2.0.0 meta: ^1.3.0 From 270031a1b1eeaa94c3225fc05854352ce4786027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Andra=C5=A1ec?= Date: Tue, 23 Jan 2024 13:11:49 +0000 Subject: [PATCH 4/5] Accept `Map` in `Hint` class (#1807) --- CHANGELOG.md | 11 +++++++++++ dart/lib/src/hint.dart | 18 ++++++++++-------- dart/test/hint_test.dart | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e073b7b29f..fc9e7352bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## Unreleased + +### Features + +- Accept `Map` in `Hint` class ([#1807](https://github.com/getsentry/sentry-dart/pull/1807)) + - Please check if everything works as expected when using `Hint` + - Factory constructor `Hint.withMap(Map map)` now takes `Map` instead of `Map` + - Method `hint.addAll(Map keysAndValues)` now takes `Map` instead of `Map` + - Method `set(String key, dynamic value)` now takes value of `dynamic` instead of `Object` + - Method `hint.get(String key)` now returns `dynamic` instead of `Object?` + ## 7.15.0 ### Features diff --git a/dart/lib/src/hint.dart b/dart/lib/src/hint.dart index 87620d7ba1..aaa614518c 100644 --- a/dart/lib/src/hint.dart +++ b/dart/lib/src/hint.dart @@ -40,7 +40,7 @@ import 'sentry_attachment/sentry_attachment.dart'; /// }; /// ``` class Hint { - final Map _internalStorage = {}; + final Map _internalStorage = {}; final List attachments = []; @@ -62,7 +62,7 @@ class Hint { return hint; } - factory Hint.withMap(Map map) { + factory Hint.withMap(Map map) { final hint = Hint(); hint.addAll(map); return hint; @@ -80,17 +80,19 @@ class Hint { return hint; } - // Objects + // Key/Value Storage - void addAll(Map keysAndValues) { - _internalStorage.addAll(keysAndValues); + void addAll(Map keysAndValues) { + final withoutNullValues = + keysAndValues.map((key, value) => MapEntry(key, value ?? "null")); + _internalStorage.addAll(withoutNullValues); } - void set(String key, Object value) { - _internalStorage[key] = value; + void set(String key, dynamic value) { + _internalStorage[key] = value ?? "null"; } - Object? get(String key) { + dynamic get(String key) { return _internalStorage[key]; } diff --git a/dart/test/hint_test.dart b/dart/test/hint_test.dart index d46a022405..04c09a28a0 100644 --- a/dart/test/hint_test.dart +++ b/dart/test/hint_test.dart @@ -82,6 +82,23 @@ void main() { expect(sut.screenshot, attachment); expect(sut.viewHierarchy, attachment); }); + + test('Hint init with map null fallback', () { + final hint = Hint.withMap({'fixture-key': null}); + expect("null", hint.get("fixture-key")); + }); + + test('Hint addAll with map null fallback', () { + final hint = Hint(); + hint.addAll({'fixture-key': null}); + expect("null", hint.get("fixture-key")); + }); + + test('Hint set with null value fallback', () { + final hint = Hint(); + hint.set("fixture-key", null); + expect("null", hint.get("fixture-key")); + }); } class Fixture { From f770c4cf27cf7af52784b27085d7efce09f70004 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:05:54 -0500 Subject: [PATCH 5/5] build(deps): bump actions/cache from 3 to 4 (#1833) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Giancarlo Buenaflor --- .github/workflows/flutter_test.yml | 2 +- .github/workflows/metrics.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index 33990219b3..9a5b583420 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -57,7 +57,7 @@ jobs: uses: gradle/gradle-build-action@v2 - name: AVD cache - uses: actions/cache@v3 + uses: actions/cache@v4 id: avd-cache with: path: | diff --git a/.github/workflows/metrics.yml b/.github/workflows/metrics.yml index c190889723..1e383a93ea 100644 --- a/.github/workflows/metrics.yml +++ b/.github/workflows/metrics.yml @@ -65,7 +65,7 @@ jobs: - run: ./metrics/prepare.sh - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: app-plain-cache with: path: ${{ matrix.appPlain }}