From 32f7e8e036ed0df15c3cb25db3ca559aa5c623e2 Mon Sep 17 00:00:00 2001 From: Brandon Trautmann Date: Fri, 17 Feb 2023 10:09:15 -0500 Subject: [PATCH] chore: upgrade dio to 5.0.0 (#32) * chore: upgrade dio to 5.0.0 * add test randomization seed * update semantic PR workflow * upgrade dependencies, run codegen * fix tests that rely on specific dio messaging * update version of test_track in pubspec --- .github/workflows/semantic-pull-request.yml | 22 +++++-- .github/workflows/validate.yml | 8 +-- .../lib/src/domain/vary/run_ab.dart | 6 +- .../src/models/app_version_build.freezed.dart | 64 +++++++++---------- .../models/app_visitor_config.freezed.dart | 51 ++++++++------- .../lib/src/models/assignment.freezed.dart | 64 ++++++++++--------- .../src/models/assignment_event.freezed.dart | 63 +++++++++--------- .../lib/src/models/identifier.freezed.dart | 54 ++++++++-------- .../lib/src/models/split.freezed.dart | 64 ++++++++++--------- .../src/models/split_registry.freezed.dart | 34 +++++----- .../lib/src/models/variant.freezed.dart | 52 +++++++-------- .../lib/src/models/visitor.freezed.dart | 50 ++++++++------- .../lib/src/networking/http_client.dart | 4 +- .../interceptors/retry_options.dart | 2 +- packages/test_track/lib/src/test_track.dart | 10 +-- packages/test_track/pubspec.yaml | 24 +++---- .../interceptors/retry_interceptor_test.dart | 2 +- .../interceptors/retry_options_test.dart | 4 +- packages/test_track/test/test_track_test.dart | 4 +- tool/generate_code_coverage.sh | 2 +- 20 files changed, 309 insertions(+), 275 deletions(-) diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml index 69ef316..5cd00bc 100644 --- a/.github/workflows/semantic-pull-request.yml +++ b/.github/workflows/semantic-pull-request.yml @@ -1,12 +1,26 @@ name: Semantic PR -on: [pull_request_target] +on: [pull_request] + +permissions: + pull-requests: read jobs: - validate_title: + build: runs-on: ubuntu-latest steps: - name: Validate PR title - uses: amannn/action-semantic-pull-request@v4 + uses: amannn/action-semantic-pull-request@v4.6.0 + with: + types: + feat + fix + docs + style + refactor + test + ci + chore + validateSingleCommit: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 8f34eff..130024d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -24,8 +24,8 @@ jobs: working-directory: packages/${{ inputs.package-name }} steps: - - uses: actions/checkout@v2.3.5 - - uses: dart-lang/setup-dart@v1.3 + - uses: actions/checkout@v3.3.0 + - uses: dart-lang/setup-dart@v1.4 - name: Install dependencies run: dart pub get @@ -60,8 +60,8 @@ jobs: working-directory: packages/${{ inputs.package-name }} steps: - - uses: actions/checkout@v2.3.5 - - uses: dart-lang/setup-dart@v1.3 + - uses: actions/checkout@v3.3.0 + - uses: dart-lang/setup-dart@v1.4 - name: Install dependencies run: | diff --git a/packages/test_track/lib/src/domain/vary/run_ab.dart b/packages/test_track/lib/src/domain/vary/run_ab.dart index 06573dd..144a592 100644 --- a/packages/test_track/lib/src/domain/vary/run_ab.dart +++ b/packages/test_track/lib/src/domain/vary/run_ab.dart @@ -37,11 +37,11 @@ class RunAb { ); } - final _trueVariant = trueVariant ?? 'true'; + trueVariant ??= 'true'; final unsortedVariants = List.of(split.variants); final sortedFalseVariants = unsortedVariants ..sort((v1, v2) => v1.name.compareTo(v2.name)) - ..removeWhere((v) => v.name == _trueVariant); + ..removeWhere((v) => v.name == trueVariant); final falseVariant = sortedFalseVariants.firstOrNull?.name; @@ -53,7 +53,7 @@ class RunAb { ); return RunAbResult( - _trueVariant == runVaryResult.variant, + trueVariant == runVaryResult.variant, runVaryResult.visitor, ); } diff --git a/packages/test_track/lib/src/models/app_version_build.freezed.dart b/packages/test_track/lib/src/models/app_version_build.freezed.dart index 5c6772b..52f8e1e 100644 --- a/packages/test_track/lib/src/models/app_version_build.freezed.dart +++ b/packages/test_track/lib/src/models/app_version_build.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'app_version_build.dart'; @@ -34,39 +34,42 @@ mixin _$AppVersionBuild { abstract class $AppVersionBuildCopyWith<$Res> { factory $AppVersionBuildCopyWith( AppVersionBuild value, $Res Function(AppVersionBuild) then) = - _$AppVersionBuildCopyWithImpl<$Res>; + _$AppVersionBuildCopyWithImpl<$Res, AppVersionBuild>; + @useResult $Res call({String appName, String version, String buildTimestamp}); } /// @nodoc -class _$AppVersionBuildCopyWithImpl<$Res> +class _$AppVersionBuildCopyWithImpl<$Res, $Val extends AppVersionBuild> implements $AppVersionBuildCopyWith<$Res> { _$AppVersionBuildCopyWithImpl(this._value, this._then); - final AppVersionBuild _value; // ignore: unused_field - final $Res Function(AppVersionBuild) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? appName = freezed, - Object? version = freezed, - Object? buildTimestamp = freezed, + Object? appName = null, + Object? version = null, + Object? buildTimestamp = null, }) { return _then(_value.copyWith( - appName: appName == freezed + appName: null == appName ? _value.appName : appName // ignore: cast_nullable_to_non_nullable as String, - version: version == freezed + version: null == version ? _value.version : version // ignore: cast_nullable_to_non_nullable as String, - buildTimestamp: buildTimestamp == freezed + buildTimestamp: null == buildTimestamp ? _value.buildTimestamp : buildTimestamp // ignore: cast_nullable_to_non_nullable as String, - )); + ) as $Val); } } @@ -77,36 +80,35 @@ abstract class _$$_AppVersionBuildCopyWith<$Res> _$_AppVersionBuild value, $Res Function(_$_AppVersionBuild) then) = __$$_AppVersionBuildCopyWithImpl<$Res>; @override + @useResult $Res call({String appName, String version, String buildTimestamp}); } /// @nodoc class __$$_AppVersionBuildCopyWithImpl<$Res> - extends _$AppVersionBuildCopyWithImpl<$Res> + extends _$AppVersionBuildCopyWithImpl<$Res, _$_AppVersionBuild> implements _$$_AppVersionBuildCopyWith<$Res> { __$$_AppVersionBuildCopyWithImpl( _$_AppVersionBuild _value, $Res Function(_$_AppVersionBuild) _then) - : super(_value, (v) => _then(v as _$_AppVersionBuild)); - - @override - _$_AppVersionBuild get _value => super._value as _$_AppVersionBuild; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? appName = freezed, - Object? version = freezed, - Object? buildTimestamp = freezed, + Object? appName = null, + Object? version = null, + Object? buildTimestamp = null, }) { return _then(_$_AppVersionBuild( - appName: appName == freezed + appName: null == appName ? _value.appName : appName // ignore: cast_nullable_to_non_nullable as String, - version: version == freezed + version: null == version ? _value.version : version // ignore: cast_nullable_to_non_nullable as String, - buildTimestamp: buildTimestamp == freezed + buildTimestamp: null == buildTimestamp ? _value.buildTimestamp : buildTimestamp // ignore: cast_nullable_to_non_nullable as String, @@ -143,22 +145,20 @@ class _$_AppVersionBuild implements _AppVersionBuild { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_AppVersionBuild && - const DeepCollectionEquality().equals(other.appName, appName) && - const DeepCollectionEquality().equals(other.version, version) && - const DeepCollectionEquality() - .equals(other.buildTimestamp, buildTimestamp)); + (identical(other.appName, appName) || other.appName == appName) && + (identical(other.version, version) || other.version == version) && + (identical(other.buildTimestamp, buildTimestamp) || + other.buildTimestamp == buildTimestamp)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(appName), - const DeepCollectionEquality().hash(version), - const DeepCollectionEquality().hash(buildTimestamp)); + int get hashCode => + Object.hash(runtimeType, appName, version, buildTimestamp); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_AppVersionBuildCopyWith<_$_AppVersionBuild> get copyWith => __$$_AppVersionBuildCopyWithImpl<_$_AppVersionBuild>(this, _$identity); diff --git a/packages/test_track/lib/src/models/app_visitor_config.freezed.dart b/packages/test_track/lib/src/models/app_visitor_config.freezed.dart index eb2d3e6..63bbfdd 100644 --- a/packages/test_track/lib/src/models/app_visitor_config.freezed.dart +++ b/packages/test_track/lib/src/models/app_visitor_config.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'app_visitor_config.dart'; @@ -33,42 +33,46 @@ mixin _$AppVisitorConfig { abstract class $AppVisitorConfigCopyWith<$Res> { factory $AppVisitorConfigCopyWith( AppVisitorConfig value, $Res Function(AppVisitorConfig) then) = - _$AppVisitorConfigCopyWithImpl<$Res>; + _$AppVisitorConfigCopyWithImpl<$Res, AppVisitorConfig>; + @useResult $Res call({List splits, Visitor visitor}); $VisitorCopyWith<$Res> get visitor; } /// @nodoc -class _$AppVisitorConfigCopyWithImpl<$Res> +class _$AppVisitorConfigCopyWithImpl<$Res, $Val extends AppVisitorConfig> implements $AppVisitorConfigCopyWith<$Res> { _$AppVisitorConfigCopyWithImpl(this._value, this._then); - final AppVisitorConfig _value; // ignore: unused_field - final $Res Function(AppVisitorConfig) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? splits = freezed, - Object? visitor = freezed, + Object? splits = null, + Object? visitor = null, }) { return _then(_value.copyWith( - splits: splits == freezed + splits: null == splits ? _value.splits : splits // ignore: cast_nullable_to_non_nullable as List, - visitor: visitor == freezed + visitor: null == visitor ? _value.visitor : visitor // ignore: cast_nullable_to_non_nullable as Visitor, - )); + ) as $Val); } @override + @pragma('vm:prefer-inline') $VisitorCopyWith<$Res> get visitor { return $VisitorCopyWith<$Res>(_value.visitor, (value) { - return _then(_value.copyWith(visitor: value)); + return _then(_value.copyWith(visitor: value) as $Val); }); } } @@ -80,6 +84,7 @@ abstract class _$$_AppVisitorConfigCopyWith<$Res> _$_AppVisitorConfig value, $Res Function(_$_AppVisitorConfig) then) = __$$_AppVisitorConfigCopyWithImpl<$Res>; @override + @useResult $Res call({List splits, Visitor visitor}); @override @@ -88,26 +93,24 @@ abstract class _$$_AppVisitorConfigCopyWith<$Res> /// @nodoc class __$$_AppVisitorConfigCopyWithImpl<$Res> - extends _$AppVisitorConfigCopyWithImpl<$Res> + extends _$AppVisitorConfigCopyWithImpl<$Res, _$_AppVisitorConfig> implements _$$_AppVisitorConfigCopyWith<$Res> { __$$_AppVisitorConfigCopyWithImpl( _$_AppVisitorConfig _value, $Res Function(_$_AppVisitorConfig) _then) - : super(_value, (v) => _then(v as _$_AppVisitorConfig)); - - @override - _$_AppVisitorConfig get _value => super._value as _$_AppVisitorConfig; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? splits = freezed, - Object? visitor = freezed, + Object? splits = null, + Object? visitor = null, }) { return _then(_$_AppVisitorConfig( - splits: splits == freezed + splits: null == splits ? _value._splits : splits // ignore: cast_nullable_to_non_nullable as List, - visitor: visitor == freezed + visitor: null == visitor ? _value.visitor : visitor // ignore: cast_nullable_to_non_nullable as Visitor, @@ -128,6 +131,7 @@ class _$_AppVisitorConfig implements _AppVisitorConfig { final List _splits; @override List get splits { + if (_splits is EqualUnmodifiableListView) return _splits; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_splits); } @@ -146,18 +150,17 @@ class _$_AppVisitorConfig implements _AppVisitorConfig { (other.runtimeType == runtimeType && other is _$_AppVisitorConfig && const DeepCollectionEquality().equals(other._splits, _splits) && - const DeepCollectionEquality().equals(other.visitor, visitor)); + (identical(other.visitor, visitor) || other.visitor == visitor)); } @JsonKey(ignore: true) @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_splits), - const DeepCollectionEquality().hash(visitor)); + runtimeType, const DeepCollectionEquality().hash(_splits), visitor); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_AppVisitorConfigCopyWith<_$_AppVisitorConfig> get copyWith => __$$_AppVisitorConfigCopyWithImpl<_$_AppVisitorConfig>(this, _$identity); diff --git a/packages/test_track/lib/src/models/assignment.freezed.dart b/packages/test_track/lib/src/models/assignment.freezed.dart index 4a81441..e7a9bd4 100644 --- a/packages/test_track/lib/src/models/assignment.freezed.dart +++ b/packages/test_track/lib/src/models/assignment.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'assignment.dart'; @@ -34,38 +34,42 @@ mixin _$Assignment { abstract class $AssignmentCopyWith<$Res> { factory $AssignmentCopyWith( Assignment value, $Res Function(Assignment) then) = - _$AssignmentCopyWithImpl<$Res>; + _$AssignmentCopyWithImpl<$Res, Assignment>; + @useResult $Res call({String splitName, String variant, String context}); } /// @nodoc -class _$AssignmentCopyWithImpl<$Res> implements $AssignmentCopyWith<$Res> { +class _$AssignmentCopyWithImpl<$Res, $Val extends Assignment> + implements $AssignmentCopyWith<$Res> { _$AssignmentCopyWithImpl(this._value, this._then); - final Assignment _value; // ignore: unused_field - final $Res Function(Assignment) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? splitName = freezed, - Object? variant = freezed, - Object? context = freezed, + Object? splitName = null, + Object? variant = null, + Object? context = null, }) { return _then(_value.copyWith( - splitName: splitName == freezed + splitName: null == splitName ? _value.splitName : splitName // ignore: cast_nullable_to_non_nullable as String, - variant: variant == freezed + variant: null == variant ? _value.variant : variant // ignore: cast_nullable_to_non_nullable as String, - context: context == freezed + context: null == context ? _value.context : context // ignore: cast_nullable_to_non_nullable as String, - )); + ) as $Val); } } @@ -76,35 +80,35 @@ abstract class _$$_AssignmentCopyWith<$Res> _$_Assignment value, $Res Function(_$_Assignment) then) = __$$_AssignmentCopyWithImpl<$Res>; @override + @useResult $Res call({String splitName, String variant, String context}); } /// @nodoc -class __$$_AssignmentCopyWithImpl<$Res> extends _$AssignmentCopyWithImpl<$Res> +class __$$_AssignmentCopyWithImpl<$Res> + extends _$AssignmentCopyWithImpl<$Res, _$_Assignment> implements _$$_AssignmentCopyWith<$Res> { __$$_AssignmentCopyWithImpl( _$_Assignment _value, $Res Function(_$_Assignment) _then) - : super(_value, (v) => _then(v as _$_Assignment)); - - @override - _$_Assignment get _value => super._value as _$_Assignment; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? splitName = freezed, - Object? variant = freezed, - Object? context = freezed, + Object? splitName = null, + Object? variant = null, + Object? context = null, }) { return _then(_$_Assignment( - splitName: splitName == freezed + splitName: null == splitName ? _value.splitName : splitName // ignore: cast_nullable_to_non_nullable as String, - variant: variant == freezed + variant: null == variant ? _value.variant : variant // ignore: cast_nullable_to_non_nullable as String, - context: context == freezed + context: null == context ? _value.context : context // ignore: cast_nullable_to_non_nullable as String, @@ -139,21 +143,19 @@ class _$_Assignment implements _Assignment { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_Assignment && - const DeepCollectionEquality().equals(other.splitName, splitName) && - const DeepCollectionEquality().equals(other.variant, variant) && - const DeepCollectionEquality().equals(other.context, context)); + (identical(other.splitName, splitName) || + other.splitName == splitName) && + (identical(other.variant, variant) || other.variant == variant) && + (identical(other.context, context) || other.context == context)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(splitName), - const DeepCollectionEquality().hash(variant), - const DeepCollectionEquality().hash(context)); + int get hashCode => Object.hash(runtimeType, splitName, variant, context); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_AssignmentCopyWith<_$_Assignment> get copyWith => __$$_AssignmentCopyWithImpl<_$_Assignment>(this, _$identity); diff --git a/packages/test_track/lib/src/models/assignment_event.freezed.dart b/packages/test_track/lib/src/models/assignment_event.freezed.dart index f9299c0..b226c47 100644 --- a/packages/test_track/lib/src/models/assignment_event.freezed.dart +++ b/packages/test_track/lib/src/models/assignment_event.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'assignment_event.dart'; @@ -34,39 +34,42 @@ mixin _$AssignmentEvent { abstract class $AssignmentEventCopyWith<$Res> { factory $AssignmentEventCopyWith( AssignmentEvent value, $Res Function(AssignmentEvent) then) = - _$AssignmentEventCopyWithImpl<$Res>; + _$AssignmentEventCopyWithImpl<$Res, AssignmentEvent>; + @useResult $Res call({String visitorId, String splitName, String context}); } /// @nodoc -class _$AssignmentEventCopyWithImpl<$Res> +class _$AssignmentEventCopyWithImpl<$Res, $Val extends AssignmentEvent> implements $AssignmentEventCopyWith<$Res> { _$AssignmentEventCopyWithImpl(this._value, this._then); - final AssignmentEvent _value; // ignore: unused_field - final $Res Function(AssignmentEvent) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? visitorId = freezed, - Object? splitName = freezed, - Object? context = freezed, + Object? visitorId = null, + Object? splitName = null, + Object? context = null, }) { return _then(_value.copyWith( - visitorId: visitorId == freezed + visitorId: null == visitorId ? _value.visitorId : visitorId // ignore: cast_nullable_to_non_nullable as String, - splitName: splitName == freezed + splitName: null == splitName ? _value.splitName : splitName // ignore: cast_nullable_to_non_nullable as String, - context: context == freezed + context: null == context ? _value.context : context // ignore: cast_nullable_to_non_nullable as String, - )); + ) as $Val); } } @@ -77,36 +80,35 @@ abstract class _$$_AssignmentEventCopyWith<$Res> _$_AssignmentEvent value, $Res Function(_$_AssignmentEvent) then) = __$$_AssignmentEventCopyWithImpl<$Res>; @override + @useResult $Res call({String visitorId, String splitName, String context}); } /// @nodoc class __$$_AssignmentEventCopyWithImpl<$Res> - extends _$AssignmentEventCopyWithImpl<$Res> + extends _$AssignmentEventCopyWithImpl<$Res, _$_AssignmentEvent> implements _$$_AssignmentEventCopyWith<$Res> { __$$_AssignmentEventCopyWithImpl( _$_AssignmentEvent _value, $Res Function(_$_AssignmentEvent) _then) - : super(_value, (v) => _then(v as _$_AssignmentEvent)); - - @override - _$_AssignmentEvent get _value => super._value as _$_AssignmentEvent; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? visitorId = freezed, - Object? splitName = freezed, - Object? context = freezed, + Object? visitorId = null, + Object? splitName = null, + Object? context = null, }) { return _then(_$_AssignmentEvent( - visitorId: visitorId == freezed + visitorId: null == visitorId ? _value.visitorId : visitorId // ignore: cast_nullable_to_non_nullable as String, - splitName: splitName == freezed + splitName: null == splitName ? _value.splitName : splitName // ignore: cast_nullable_to_non_nullable as String, - context: context == freezed + context: null == context ? _value.context : context // ignore: cast_nullable_to_non_nullable as String, @@ -142,21 +144,20 @@ class _$_AssignmentEvent implements _AssignmentEvent { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_AssignmentEvent && - const DeepCollectionEquality().equals(other.visitorId, visitorId) && - const DeepCollectionEquality().equals(other.splitName, splitName) && - const DeepCollectionEquality().equals(other.context, context)); + (identical(other.visitorId, visitorId) || + other.visitorId == visitorId) && + (identical(other.splitName, splitName) || + other.splitName == splitName) && + (identical(other.context, context) || other.context == context)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(visitorId), - const DeepCollectionEquality().hash(splitName), - const DeepCollectionEquality().hash(context)); + int get hashCode => Object.hash(runtimeType, visitorId, splitName, context); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_AssignmentEventCopyWith<_$_AssignmentEvent> get copyWith => __$$_AssignmentEventCopyWithImpl<_$_AssignmentEvent>(this, _$identity); diff --git a/packages/test_track/lib/src/models/identifier.freezed.dart b/packages/test_track/lib/src/models/identifier.freezed.dart index 06974c8..af4056c 100644 --- a/packages/test_track/lib/src/models/identifier.freezed.dart +++ b/packages/test_track/lib/src/models/identifier.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'identifier.dart'; @@ -33,33 +33,37 @@ mixin _$Identifier { abstract class $IdentifierCopyWith<$Res> { factory $IdentifierCopyWith( Identifier value, $Res Function(Identifier) then) = - _$IdentifierCopyWithImpl<$Res>; + _$IdentifierCopyWithImpl<$Res, Identifier>; + @useResult $Res call({String identifierType, String value}); } /// @nodoc -class _$IdentifierCopyWithImpl<$Res> implements $IdentifierCopyWith<$Res> { +class _$IdentifierCopyWithImpl<$Res, $Val extends Identifier> + implements $IdentifierCopyWith<$Res> { _$IdentifierCopyWithImpl(this._value, this._then); - final Identifier _value; // ignore: unused_field - final $Res Function(Identifier) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? identifierType = freezed, - Object? value = freezed, + Object? identifierType = null, + Object? value = null, }) { return _then(_value.copyWith( - identifierType: identifierType == freezed + identifierType: null == identifierType ? _value.identifierType : identifierType // ignore: cast_nullable_to_non_nullable as String, - value: value == freezed + value: null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable as String, - )); + ) as $Val); } } @@ -70,30 +74,30 @@ abstract class _$$_IdentifierCopyWith<$Res> _$_Identifier value, $Res Function(_$_Identifier) then) = __$$_IdentifierCopyWithImpl<$Res>; @override + @useResult $Res call({String identifierType, String value}); } /// @nodoc -class __$$_IdentifierCopyWithImpl<$Res> extends _$IdentifierCopyWithImpl<$Res> +class __$$_IdentifierCopyWithImpl<$Res> + extends _$IdentifierCopyWithImpl<$Res, _$_Identifier> implements _$$_IdentifierCopyWith<$Res> { __$$_IdentifierCopyWithImpl( _$_Identifier _value, $Res Function(_$_Identifier) _then) - : super(_value, (v) => _then(v as _$_Identifier)); - - @override - _$_Identifier get _value => super._value as _$_Identifier; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? identifierType = freezed, - Object? value = freezed, + Object? identifierType = null, + Object? value = null, }) { return _then(_$_Identifier( - identifierType: identifierType == freezed + identifierType: null == identifierType ? _value.identifierType : identifierType // ignore: cast_nullable_to_non_nullable as String, - value: value == freezed + value: null == value ? _value.value : value // ignore: cast_nullable_to_non_nullable as String, @@ -124,20 +128,18 @@ class _$_Identifier implements _Identifier { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_Identifier && - const DeepCollectionEquality() - .equals(other.identifierType, identifierType) && - const DeepCollectionEquality().equals(other.value, value)); + (identical(other.identifierType, identifierType) || + other.identifierType == identifierType) && + (identical(other.value, value) || other.value == value)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(identifierType), - const DeepCollectionEquality().hash(value)); + int get hashCode => Object.hash(runtimeType, identifierType, value); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_IdentifierCopyWith<_$_Identifier> get copyWith => __$$_IdentifierCopyWithImpl<_$_Identifier>(this, _$identity); diff --git a/packages/test_track/lib/src/models/split.freezed.dart b/packages/test_track/lib/src/models/split.freezed.dart index 7235ba0..d167aa4 100644 --- a/packages/test_track/lib/src/models/split.freezed.dart +++ b/packages/test_track/lib/src/models/split.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'split.dart'; @@ -33,7 +33,8 @@ mixin _$Split { /// @nodoc abstract class $SplitCopyWith<$Res> { factory $SplitCopyWith(Split value, $Res Function(Split) then) = - _$SplitCopyWithImpl<$Res>; + _$SplitCopyWithImpl<$Res, Split>; + @useResult $Res call( {String name, List variants, @@ -41,33 +42,36 @@ abstract class $SplitCopyWith<$Res> { } /// @nodoc -class _$SplitCopyWithImpl<$Res> implements $SplitCopyWith<$Res> { +class _$SplitCopyWithImpl<$Res, $Val extends Split> + implements $SplitCopyWith<$Res> { _$SplitCopyWithImpl(this._value, this._then); - final Split _value; // ignore: unused_field - final $Res Function(Split) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? variants = freezed, - Object? isFeatureGate = freezed, + Object? name = null, + Object? variants = null, + Object? isFeatureGate = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - variants: variants == freezed + variants: null == variants ? _value.variants : variants // ignore: cast_nullable_to_non_nullable as List, - isFeatureGate: isFeatureGate == freezed + isFeatureGate: null == isFeatureGate ? _value.isFeatureGate : isFeatureGate // ignore: cast_nullable_to_non_nullable as bool, - )); + ) as $Val); } } @@ -76,6 +80,7 @@ abstract class _$$_SplitCopyWith<$Res> implements $SplitCopyWith<$Res> { factory _$$_SplitCopyWith(_$_Split value, $Res Function(_$_Split) then) = __$$_SplitCopyWithImpl<$Res>; @override + @useResult $Res call( {String name, List variants, @@ -83,30 +88,28 @@ abstract class _$$_SplitCopyWith<$Res> implements $SplitCopyWith<$Res> { } /// @nodoc -class __$$_SplitCopyWithImpl<$Res> extends _$SplitCopyWithImpl<$Res> +class __$$_SplitCopyWithImpl<$Res> extends _$SplitCopyWithImpl<$Res, _$_Split> implements _$$_SplitCopyWith<$Res> { __$$_SplitCopyWithImpl(_$_Split _value, $Res Function(_$_Split) _then) - : super(_value, (v) => _then(v as _$_Split)); - - @override - _$_Split get _value => super._value as _$_Split; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? variants = freezed, - Object? isFeatureGate = freezed, + Object? name = null, + Object? variants = null, + Object? isFeatureGate = null, }) { return _then(_$_Split( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - variants: variants == freezed + variants: null == variants ? _value._variants : variants // ignore: cast_nullable_to_non_nullable as List, - isFeatureGate: isFeatureGate == freezed + isFeatureGate: null == isFeatureGate ? _value.isFeatureGate : isFeatureGate // ignore: cast_nullable_to_non_nullable as bool, @@ -131,6 +134,7 @@ class _$_Split implements _Split { final List _variants; @override List get variants { + if (_variants is EqualUnmodifiableListView) return _variants; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_variants); } @@ -149,22 +153,20 @@ class _$_Split implements _Split { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_Split && - const DeepCollectionEquality().equals(other.name, name) && + (identical(other.name, name) || other.name == name) && const DeepCollectionEquality().equals(other._variants, _variants) && - const DeepCollectionEquality() - .equals(other.isFeatureGate, isFeatureGate)); + (identical(other.isFeatureGate, isFeatureGate) || + other.isFeatureGate == isFeatureGate)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(name), - const DeepCollectionEquality().hash(_variants), - const DeepCollectionEquality().hash(isFeatureGate)); + int get hashCode => Object.hash(runtimeType, name, + const DeepCollectionEquality().hash(_variants), isFeatureGate); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_SplitCopyWith<_$_Split> get copyWith => __$$_SplitCopyWithImpl<_$_Split>(this, _$identity); diff --git a/packages/test_track/lib/src/models/split_registry.freezed.dart b/packages/test_track/lib/src/models/split_registry.freezed.dart index 07e3578..bb583fc 100644 --- a/packages/test_track/lib/src/models/split_registry.freezed.dart +++ b/packages/test_track/lib/src/models/split_registry.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'split_registry.dart'; @@ -32,29 +32,32 @@ mixin _$SplitRegistry { abstract class $SplitRegistryCopyWith<$Res> { factory $SplitRegistryCopyWith( SplitRegistry value, $Res Function(SplitRegistry) then) = - _$SplitRegistryCopyWithImpl<$Res>; + _$SplitRegistryCopyWithImpl<$Res, SplitRegistry>; + @useResult $Res call({List splits}); } /// @nodoc -class _$SplitRegistryCopyWithImpl<$Res> +class _$SplitRegistryCopyWithImpl<$Res, $Val extends SplitRegistry> implements $SplitRegistryCopyWith<$Res> { _$SplitRegistryCopyWithImpl(this._value, this._then); - final SplitRegistry _value; // ignore: unused_field - final $Res Function(SplitRegistry) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? splits = freezed, + Object? splits = null, }) { return _then(_value.copyWith( - splits: splits == freezed + splits: null == splits ? _value.splits : splits // ignore: cast_nullable_to_non_nullable as List, - )); + ) as $Val); } } @@ -65,26 +68,25 @@ abstract class _$$_SplitRegistryCopyWith<$Res> _$_SplitRegistry value, $Res Function(_$_SplitRegistry) then) = __$$_SplitRegistryCopyWithImpl<$Res>; @override + @useResult $Res call({List splits}); } /// @nodoc class __$$_SplitRegistryCopyWithImpl<$Res> - extends _$SplitRegistryCopyWithImpl<$Res> + extends _$SplitRegistryCopyWithImpl<$Res, _$_SplitRegistry> implements _$$_SplitRegistryCopyWith<$Res> { __$$_SplitRegistryCopyWithImpl( _$_SplitRegistry _value, $Res Function(_$_SplitRegistry) _then) - : super(_value, (v) => _then(v as _$_SplitRegistry)); - - @override - _$_SplitRegistry get _value => super._value as _$_SplitRegistry; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? splits = freezed, + Object? splits = null, }) { return _then(_$_SplitRegistry( - splits: splits == freezed + splits: null == splits ? _value._splits : splits // ignore: cast_nullable_to_non_nullable as List, @@ -103,6 +105,7 @@ class _$_SplitRegistry implements _SplitRegistry { final List _splits; @override List get splits { + if (_splits is EqualUnmodifiableListView) return _splits; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_splits); } @@ -127,6 +130,7 @@ class _$_SplitRegistry implements _SplitRegistry { @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_SplitRegistryCopyWith<_$_SplitRegistry> get copyWith => __$$_SplitRegistryCopyWithImpl<_$_SplitRegistry>(this, _$identity); diff --git a/packages/test_track/lib/src/models/variant.freezed.dart b/packages/test_track/lib/src/models/variant.freezed.dart index 92bb605..54c6e53 100644 --- a/packages/test_track/lib/src/models/variant.freezed.dart +++ b/packages/test_track/lib/src/models/variant.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'variant.dart'; @@ -31,33 +31,37 @@ mixin _$Variant { /// @nodoc abstract class $VariantCopyWith<$Res> { factory $VariantCopyWith(Variant value, $Res Function(Variant) then) = - _$VariantCopyWithImpl<$Res>; + _$VariantCopyWithImpl<$Res, Variant>; + @useResult $Res call({String name, int weight}); } /// @nodoc -class _$VariantCopyWithImpl<$Res> implements $VariantCopyWith<$Res> { +class _$VariantCopyWithImpl<$Res, $Val extends Variant> + implements $VariantCopyWith<$Res> { _$VariantCopyWithImpl(this._value, this._then); - final Variant _value; // ignore: unused_field - final $Res Function(Variant) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? weight = freezed, + Object? name = null, + Object? weight = null, }) { return _then(_value.copyWith( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - weight: weight == freezed + weight: null == weight ? _value.weight : weight // ignore: cast_nullable_to_non_nullable as int, - )); + ) as $Val); } } @@ -67,29 +71,29 @@ abstract class _$$_VariantCopyWith<$Res> implements $VariantCopyWith<$Res> { _$_Variant value, $Res Function(_$_Variant) then) = __$$_VariantCopyWithImpl<$Res>; @override + @useResult $Res call({String name, int weight}); } /// @nodoc -class __$$_VariantCopyWithImpl<$Res> extends _$VariantCopyWithImpl<$Res> +class __$$_VariantCopyWithImpl<$Res> + extends _$VariantCopyWithImpl<$Res, _$_Variant> implements _$$_VariantCopyWith<$Res> { __$$_VariantCopyWithImpl(_$_Variant _value, $Res Function(_$_Variant) _then) - : super(_value, (v) => _then(v as _$_Variant)); - - @override - _$_Variant get _value => super._value as _$_Variant; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? name = freezed, - Object? weight = freezed, + Object? name = null, + Object? weight = null, }) { return _then(_$_Variant( - name: name == freezed + name: null == name ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - weight: weight == freezed + weight: null == weight ? _value.weight : weight // ignore: cast_nullable_to_non_nullable as int, @@ -120,19 +124,17 @@ class _$_Variant implements _Variant { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_Variant && - const DeepCollectionEquality().equals(other.name, name) && - const DeepCollectionEquality().equals(other.weight, weight)); + (identical(other.name, name) || other.name == name) && + (identical(other.weight, weight) || other.weight == weight)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(name), - const DeepCollectionEquality().hash(weight)); + int get hashCode => Object.hash(runtimeType, name, weight); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_VariantCopyWith<_$_Variant> get copyWith => __$$_VariantCopyWithImpl<_$_Variant>(this, _$identity); diff --git a/packages/test_track/lib/src/models/visitor.freezed.dart b/packages/test_track/lib/src/models/visitor.freezed.dart index 753df78..0be2daa 100644 --- a/packages/test_track/lib/src/models/visitor.freezed.dart +++ b/packages/test_track/lib/src/models/visitor.freezed.dart @@ -1,7 +1,7 @@ // coverage:ignore-file // GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark part of 'visitor.dart'; @@ -31,33 +31,37 @@ mixin _$Visitor { /// @nodoc abstract class $VisitorCopyWith<$Res> { factory $VisitorCopyWith(Visitor value, $Res Function(Visitor) then) = - _$VisitorCopyWithImpl<$Res>; + _$VisitorCopyWithImpl<$Res, Visitor>; + @useResult $Res call({List assignments, String id}); } /// @nodoc -class _$VisitorCopyWithImpl<$Res> implements $VisitorCopyWith<$Res> { +class _$VisitorCopyWithImpl<$Res, $Val extends Visitor> + implements $VisitorCopyWith<$Res> { _$VisitorCopyWithImpl(this._value, this._then); - final Visitor _value; // ignore: unused_field - final $Res Function(Visitor) _then; + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + @pragma('vm:prefer-inline') @override $Res call({ - Object? assignments = freezed, - Object? id = freezed, + Object? assignments = null, + Object? id = null, }) { return _then(_value.copyWith( - assignments: assignments == freezed + assignments: null == assignments ? _value.assignments : assignments // ignore: cast_nullable_to_non_nullable as List, - id: id == freezed + id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable as String, - )); + ) as $Val); } } @@ -67,29 +71,29 @@ abstract class _$$_VisitorCopyWith<$Res> implements $VisitorCopyWith<$Res> { _$_Visitor value, $Res Function(_$_Visitor) then) = __$$_VisitorCopyWithImpl<$Res>; @override + @useResult $Res call({List assignments, String id}); } /// @nodoc -class __$$_VisitorCopyWithImpl<$Res> extends _$VisitorCopyWithImpl<$Res> +class __$$_VisitorCopyWithImpl<$Res> + extends _$VisitorCopyWithImpl<$Res, _$_Visitor> implements _$$_VisitorCopyWith<$Res> { __$$_VisitorCopyWithImpl(_$_Visitor _value, $Res Function(_$_Visitor) _then) - : super(_value, (v) => _then(v as _$_Visitor)); - - @override - _$_Visitor get _value => super._value as _$_Visitor; + : super(_value, _then); + @pragma('vm:prefer-inline') @override $Res call({ - Object? assignments = freezed, - Object? id = freezed, + Object? assignments = null, + Object? id = null, }) { return _then(_$_Visitor( - assignments: assignments == freezed + assignments: null == assignments ? _value._assignments : assignments // ignore: cast_nullable_to_non_nullable as List, - id: id == freezed + id: null == id ? _value.id : id // ignore: cast_nullable_to_non_nullable as String, @@ -110,6 +114,7 @@ class _$_Visitor implements _Visitor { final List _assignments; @override List get assignments { + if (_assignments is EqualUnmodifiableListView) return _assignments; // ignore: implicit_dynamic_type return EqualUnmodifiableListView(_assignments); } @@ -129,18 +134,17 @@ class _$_Visitor implements _Visitor { other is _$_Visitor && const DeepCollectionEquality() .equals(other._assignments, _assignments) && - const DeepCollectionEquality().equals(other.id, id)); + (identical(other.id, id) || other.id == id)); } @JsonKey(ignore: true) @override int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(_assignments), - const DeepCollectionEquality().hash(id)); + runtimeType, const DeepCollectionEquality().hash(_assignments), id); @JsonKey(ignore: true) @override + @pragma('vm:prefer-inline') _$$_VisitorCopyWith<_$_Visitor> get copyWith => __$$_VisitorCopyWithImpl<_$_Visitor>(this, _$identity); diff --git a/packages/test_track/lib/src/networking/http_client.dart b/packages/test_track/lib/src/networking/http_client.dart index bc239c2..aaacf09 100644 --- a/packages/test_track/lib/src/networking/http_client.dart +++ b/packages/test_track/lib/src/networking/http_client.dart @@ -23,8 +23,8 @@ class HttpClient { }) : this._( Dio() ..options.baseUrl = baseUrl - ..options.connectTimeout = 10000 - ..options.receiveTimeout = 20000 + ..options.connectTimeout = const Duration(seconds: 10) + ..options.receiveTimeout = const Duration(seconds: 20) ..map((dio) { final interceptors = [ LoggingInterceptor(logger: logger), diff --git a/packages/test_track/lib/src/networking/interceptors/retry_options.dart b/packages/test_track/lib/src/networking/interceptors/retry_options.dart index df4dd35..b79cb50 100644 --- a/packages/test_track/lib/src/networking/interceptors/retry_options.dart +++ b/packages/test_track/lib/src/networking/interceptors/retry_options.dart @@ -26,7 +26,7 @@ class RetryOptions { bool shouldRetry(DioError error, {required bool isIdempotent}) { if (attempts <= 0) return false; - if (error.type == DioErrorType.connectTimeout) return true; + if (error.type == DioErrorType.connectionTimeout) return true; if (error.type == DioErrorType.receiveTimeout && isIdempotent) return true; diff --git a/packages/test_track/lib/src/test_track.dart b/packages/test_track/lib/src/test_track.dart index df9c19f..324d892 100644 --- a/packages/test_track/lib/src/test_track.dart +++ b/packages/test_track/lib/src/test_track.dart @@ -33,11 +33,11 @@ class TestTrack { HttpClientAdapter? customHttpAdapter, TestTrackLogger? logger, }) async { - final _logger = logger ?? const SilentTestTrackLogger(); + logger ??= const SilentTestTrackLogger(); final client = HttpClient( baseUrl: baseUrl, - logger: _logger, + logger: logger, customAdapter: customHttpAdapter, ); @@ -48,7 +48,7 @@ class TestTrack { ); final reportAssignmentEvent = ReportAssignmentEvent( client: client, - logger: _logger, + logger: logger, ); final overrideAssignments = OverrideAssignments( client: client, @@ -90,7 +90,7 @@ class TestTrack { visitor = appVisitorConfig.visitor; splitRegistry = appVisitorConfig.splitRegistry; } on DioError catch (e) { - _logger.info( + logger.info( 'Failed to fetch app visitor config from server, using cached data', error: e.message, stackTrace: e.stackTrace, @@ -107,7 +107,7 @@ class TestTrack { logout, runVary, runAb, - _logger, + logger, visitor, splitRegistry, ); diff --git a/packages/test_track/pubspec.yaml b/packages/test_track/pubspec.yaml index 84bf3db..bd2c61b 100644 --- a/packages/test_track/pubspec.yaml +++ b/packages/test_track/pubspec.yaml @@ -1,6 +1,6 @@ name: test_track description: The dart client for the TestTrack system. It provides client-side split-testing and feature-toggling through a simple API. -version: 0.0.3 +version: 0.0.4 homepage: https://github.com/Betterment/test_track_dart_client repository: https://github.com/Betterment/test_track_dart_client @@ -8,24 +8,24 @@ environment: sdk: ">=2.15.0 <3.0.0" dependencies: - collection: ^1.15.0 + collection: ^1.17.1 crypto: ^3.0.1 - dio: ^4.0.0 - equatable: ^2.0.2 + dio: ^5.0.0 + equatable: ^2.0.5 freezed_annotation: ^2.1.0 - json_annotation: ^4.6.0 - meta: ^1.3.0 - uuid: ^3.0.4 + json_annotation: ^4.8.0 + meta: ^1.9.0 + uuid: ^3.0.7 dev_dependencies: - build_runner: ^2.0.4 - charlatan: ^0.1.0 - coverage: ^1.0.3 + build_runner: ^2.3.3 + charlatan: ^0.2.0 + coverage: ^1.6.3 fake_async: ^1.2.0 - freezed: ^2.0.4 + freezed: ^2.3.2 json_serializable: ^6.0.1 - lints: ^1.0.1 + lints: ^2.0.1 mocktail: ^0.3.0 test: ^1.17.7 test_track_test_support: ^0.0.1 diff --git a/packages/test_track/test/networking/interceptors/retry_interceptor_test.dart b/packages/test_track/test/networking/interceptors/retry_interceptor_test.dart index aaf6158..779451a 100644 --- a/packages/test_track/test/networking/interceptors/retry_interceptor_test.dart +++ b/packages/test_track/test/networking/interceptors/retry_interceptor_test.dart @@ -44,7 +44,7 @@ void main() { ); error = DioError( - type: DioErrorType.connectTimeout, + type: DioErrorType.connectionTimeout, requestOptions: RequestOptions( path: 'test.com', extra: {'is_idempotent': true}, diff --git a/packages/test_track/test/networking/interceptors/retry_options_test.dart b/packages/test_track/test/networking/interceptors/retry_options_test.dart index 630bef5..cee4513 100644 --- a/packages/test_track/test/networking/interceptors/retry_options_test.dart +++ b/packages/test_track/test/networking/interceptors/retry_options_test.dart @@ -11,7 +11,7 @@ void main() { test('it returns true', () { final subject = RetryOptions(attempts: 2); final error = DioError( - type: DioErrorType.connectTimeout, + type: DioErrorType.connectionTimeout, requestOptions: RequestOptions(path: ''), ); @@ -51,7 +51,7 @@ void main() { test('it returns false', () { final subject = RetryOptions(attempts: 0); final error = DioError( - type: DioErrorType.connectTimeout, + type: DioErrorType.connectionTimeout, requestOptions: RequestOptions(path: ''), ); diff --git a/packages/test_track/test/test_track_test.dart b/packages/test_track/test/test_track_test.dart index 0480ed8..10ccde9 100644 --- a/packages/test_track/test/test_track_test.dart +++ b/packages/test_track/test/test_track_test.dart @@ -94,7 +94,7 @@ void main() { expect( logger.infoLogs.single.error, - 'Http status error [500]', + 'The request returned an invalid status code of 500.', ); }); @@ -272,7 +272,7 @@ void main() { expect( logger.infoLogs.single.error, - 'Http status error [500]', + 'The request returned an invalid status code of 500.', ); }); }); diff --git a/tool/generate_code_coverage.sh b/tool/generate_code_coverage.sh index 3878aa1..325fafe 100755 --- a/tool/generate_code_coverage.sh +++ b/tool/generate_code_coverage.sh @@ -8,7 +8,7 @@ dart pub global activate coverage dart pub global activate remove_from_coverage # Run tests and generate lcov -dart test --coverage=coverage && dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib +dart test --test-randomize-ordering-seed=random --coverage=coverage && dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib # Don't report coverage on `.g.` and `.freezed.` files dart pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '.freezed.dart$' -r '.g.dart$' -r '^.*/factories/.*_factory.dart$' -r '.*/helpers/pair.dart$'