Skip to content

Conversation

@yasirfolio3
Copy link
Contributor

Summary

  • Implements top-level odp interface in flutter classes.

Test plan

  • Added unit tests.
  • All previous unit tests should pass.

Issues

@yasirfolio3 yasirfolio3 requested a review from jaeopt May 2, 2023 19:29
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

Looks great! A couple of suggestions.

/// NOTE: A user context will only be created successfully when the SDK is fully configured using initializeClient.
///
/// Takes [userId] the [String] user ID to be used for bucketing.
/// Optional [userId] the [String] user ID to be used for bucketing.
Copy link
Contributor

Choose a reason for hiding this comment

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

We can add comment about "the device vuid will be used as an userId when userId is not provided."

/// On failure, **qualifiedSegments** will be nil and an error will be returned.
/// Optional [options] A set of [OptimizelySegmentOption] for fetching qualified segments.
/// Returns [FetchQualifiedSegmentsResponse] On success, it returns an array of segment names that the user is qualified for. On failure, ir returns the reason of failure.
Future<FetchQualifiedSegmentsResponse> fetchQualifiedSegments(
Copy link
Contributor

Choose a reason for hiding this comment

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

What about BaseResponse instead of FetchQualifiedSegmentsResponse? Or boolean in FetchQualifiedSegmentsResponse`, either one that make more sense?
It'll be consistent with other SDKs, where we return success/failure boolean instead of segments. iOS and android cores will return boolean as well.

/// The segments fetched will be saved in **qualifiedSegments** and can be accessed any time using **getQualifiedSegments**.
/// On failure, **qualifiedSegments** will be nil and an error will be returned.
/// Optional [options] A set of [OptimizelySegmentOption] for fetching qualified segments.
/// Returns [FetchQualifiedSegmentsResponse] On success, it returns an array of segment names that the user is qualified for. On failure, ir returns the reason of failure.
Copy link
Contributor

Choose a reason for hiding this comment

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

We return true, instead of "an array of segment names".

import 'package:optimizely_flutter_sdk/src/utils/constants.dart';

class FetchQualifiedSegmentsResponse extends BaseResponse {
List<String> qualifiedSegments = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

We may not need this list. Also ios/android cores won't return qualifedSegments.

@yasirfolio3 yasirfolio3 requested a review from jaeopt May 3, 2023 19:37
Copy link
Contributor

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

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

LGTM

@yasirfolio3 yasirfolio3 merged commit 59e998d into master May 3, 2023
@yasirfolio3 yasirfolio3 deleted the yasir/odp-support branch May 3, 2023 20:36
@yasirfolio3 yasirfolio3 restored the yasir/odp-support branch May 3, 2023 20:47
yasirfolio3 added a commit that referenced this pull request May 3, 2023
yasirfolio3 added a commit that referenced this pull request May 3, 2023
yasirfolio3 added a commit that referenced this pull request May 3, 2023
@yasirfolio3 yasirfolio3 deleted the yasir/odp-support branch May 3, 2023 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants