Skip to content

Conversation

mnoman09
Copy link
Contributor

Summary

Add a set of new APIs for forced-decisions to OptimizelyUserContext:

  • setForcedDecision
  • getForcedDecision
  • removeForcedDecision
  • removeAllForcedDecisions

Test plan

  • unit tests for the new APIs
decide(sdkKey, decideKeys, decideOptions, result);
break;
}
case APIs.SET_FORCED_DECISION: {
Copy link
Contributor

Choose a reason for hiding this comment

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

please revise this whole thing. We should parse parameters in their respective functions.

Or i would say, create methods getFlagKey, getRuleKey etc... pass arguments in those methods. and then call these methods from their respective function.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks, looks cleaner.

msohailhussain
msohailhussain previously approved these changes Aug 1, 2022
Copy link
Contributor

@msohailhussain msohailhussain left a comment

Choose a reason for hiding this comment

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

do refactoring please. and lgtm

@mnoman09 mnoman09 changed the base branch from yasir/forced-decision to master August 2, 2022 13:25
@mnoman09 mnoman09 dismissed msohailhussain’s stale review August 2, 2022 13:25

The base branch was changed.

import com.optimizely.optimizely_flutter_sdk.helper_classes.ArgumentsParser;

import static com.optimizely.optimizely_flutter_sdk.helper_classes.Constants.*;
import static com.optimizely.optimizely_flutter_sdk.helper_classes.Utils.convertKeysCamelCaseToSnakeCase;
Copy link
Contributor

Choose a reason for hiding this comment

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

I need to discuss this method offline, this may take longer time to convert into camel case.

result.success(createResponse(false, ErrorMessage.USER_CONTEXT_NOT_FOUND));
return;
}
List<String> decideKeys = argumentsParser.getDecideKeys();
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be an array?

Map<String, Object> listenerUnmodifiable = Collections.unmodifiableMap(listenerResponse);
OptimizelyFlutterSdkPlugin.channel.invokeMethod("callbackListener", listenerUnmodifiable);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

eol

Copy link
Contributor

@msohailhussain msohailhussain left a comment

Choose a reason for hiding this comment

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

lgtm

@msohailhussain msohailhussain merged commit cae9cdd into master Aug 2, 2022
@yasirfolio3 yasirfolio3 deleted the mnoman/forced-decision branch August 15, 2022 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants