Skip to content

Commit 20e8ded

Browse files
Removed live variables functionality. (#373)
1 parent 965d0b8 commit 20e8ded

File tree

21 files changed

+1
-1684
lines changed

21 files changed

+1
-1684
lines changed

OptimizelySDKCore/OptimizelySDKCore.xcodeproj/project.pbxproj

Lines changed: 0 additions & 30 deletions
Large diffs are not rendered by default.

OptimizelySDKCore/OptimizelySDKCore/OPTLYDatafileKeys.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ extern NSString * const OPTLYDatafileKeysMatchTypeLessThan;
8181
extern NSString * const OPTLYDatafileKeysMatchTypeRegex;
8282
// Custom Attribute Condition Types
8383
extern NSString * const OPTLYDatafileKeysCustomAttributeConditionType;
84-
// Live Variables (DEPRECATED)
85-
extern NSString * const OPTLYDatafileKeysVariableId;
86-
extern NSString * const OPTLYDatafileKeysVariableKey;
87-
extern NSString * const OPTLYDatafileKeysVariableType;
88-
extern NSString * const OPTLYDatafileKeysVariableValue;
89-
// Variation Live Variable (DEPRECATED)
90-
extern NSString * const OPTLYDatafileKeysVariationVariableId;
91-
extern NSString * const OPTLYDatafileKeysVariationVariableValue;
9284
// User Profile Service (not in datafile yet)
9385
extern NSString * const OPTLYDatafileKeysUserProfileServiceUserId;
9486
extern NSString * const OPTLYDatafileKeysUserProfileServiceExperimentBucketMap;

OptimizelySDKCore/OptimizelySDKCore/OPTLYDatafileKeys.m

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@
7777
NSString * const OPTLYDatafileKeysMatchTypeRegex = @"regex";
7878
// Custom Attribute Condition Types
7979
NSString * const OPTLYDatafileKeysCustomAttributeConditionType = @"custom_attribute";
80-
// Live Variables (DEPRECATED)
81-
NSString * const OPTLYDatafileKeysVariableId = @"id";
82-
NSString * const OPTLYDatafileKeysVariableKey = @"key";
83-
NSString * const OPTLYDatafileKeysVariableType = @"type";
84-
NSString * const OPTLYDatafileKeysVariableValue = @"defaultValue";
85-
// Variation Live Variable (DEPRECATED)
86-
NSString * const OPTLYDatafileKeysVariationVariableId = @"id";
87-
NSString * const OPTLYDatafileKeysVariationVariableValue = @"value";
8880
// User Profile Service (not in datafile yet)
8981
NSString * const OPTLYDatafileKeysUserProfileServiceUserId = @"user_id";
9082
NSString * const OPTLYDatafileKeysUserProfileServiceExperimentBucketMap = @"experiment_bucket_map";

OptimizelySDKCore/OptimizelySDKCore/OPTLYErrorHandlerMessages.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ extern NSString * const OPTLYErrorHandlerMessagesTrafficAllocationUnknown;
4646
extern NSString * const OPTLYErrorHandlerMessagesEventDispatchFailed;
4747
extern NSString * const OPTLYErrorHandlerMessagesConfigInvalid;
4848

49-
// Live Variables (DEPRECATED)
50-
extern NSString * const OPTLYErrorHandlerMessagesLiveVariableKeyUnknown;
51-
5249
extern NSString * const OPTLYErrorHandlerMessagesManagerBuilderInvalid;
5350

5451
extern NSString *const OPTLYErrorHandlerMessagesDataStoreDatabaseNoSavedEvents;

OptimizelySDKCore/OptimizelySDKCore/OPTLYErrorHandlerMessages.m

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
NSString * const OPTLYErrorHandlerMessagesEventDispatchFailed = @"Event %@ failed to dispatch.";
4747
NSString * const OPTLYErrorHandlerMessagesConfigInvalid = @"Project config is nil or invalid.";
4848

49-
// Live Variables (DEPRECATED)
50-
NSString * const OPTLYErrorHandlerMessagesLiveVariableKeyUnknown = @"Live variable key %@ is not in datafile."; // live variable key
51-
5249
// Manager Errors
5350
NSString *const OPTLYErrorHandlerMessagesManagerBuilderInvalid = @"Provided OPTLYManagerBuilder object is invalid.";
5451

OptimizelySDKCore/OptimizelySDKCore/OPTLYLoggerMessages.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,6 @@ extern NSString *const OPTLYLoggerMessagesEventDispatcherInvalidEvent;
163163

164164
// error
165165

166-
// ---- Live Variables ---- (DEPRECATED)
167-
// info
168-
extern NSString *const OPTLYLoggerMessagesVariableValue;
169-
extern NSString *const OPTLYLoggerMessagesNoVariationFoundForExperimentWithLiveVariable;
170-
// warning
171-
extern NSString *const OPTLYLoggerMessagesLiveVariablesDeprecated;
172-
extern NSString *const OPTLYLoggerMessagesNoExperimentsContainVariable;
173-
extern NSString *const OPTLYLoggerMessagesVariableUnknownForVariableKey;
174-
175166
// ---- Manager ----
176167
// error
177168
extern NSString *const OPTLYLoggerMessagesManagerBuilderBlockNotValid;

OptimizelySDKCore/OptimizelySDKCore/OPTLYLoggerMessages.m

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,6 @@
157157
NSString *const OPTLYLoggerMessagesEventDispatcherRemovedEvent = @"[EVENT DISPATCHER] %@ removed: %@ with error: %@"; //event type, event, error
158158
NSString *const OPTLYLoggerMessagesEventDispatcherInvalidEvent = @"[EVENT DISPATCHER] Invalid event.";
159159

160-
// ---- Live Variables ---- (DEPRECATED)
161-
// info
162-
NSString *const OPTLYLoggerMessagesVariableValue = @"[LIVE VARIABLES] Variable %@ has value: %@.";
163-
NSString *const OPTLYLoggerMessagesNoVariationFoundForExperimentWithLiveVariable = @"[LIVE VARIABLES] Variation not found for user ID: %@ with experiment key: %@ containing live variable: %@.";
164-
// warning
165-
NSString *const OPTLYLoggerMessagesLiveVariablesDeprecated = @"[LIVE VARIABLES] Mobile 1.x Live Variables are DEPRECATED. Please migrate to Full Stack 2.0 Feature Management.";
166-
NSString *const OPTLYLoggerMessagesNoExperimentsContainVariable = @"[LIVE VARIABLES] No experiment was found to contain variable key: %@.";
167-
NSString *const OPTLYLoggerMessagesVariableUnknownForVariableKey = @"[LIVE VARIABLES] Live variable not found for variable key: %@."; // live variable key
168-
169160
// ---- Manager ----
170161
// error
171162
NSString *const OPTLYLoggerMessagesManagerBuilderBlockNotValid = @"[MANAGER] An Optimizely Manager Builder instance was not able to be initialized because the OPTLYManagerBuilderBlock was nil.";

OptimizelySDKCore/OptimizelySDKCore/OPTLYProjectConfig.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ NS_ASSUME_NONNULL_END
6060
@property (nonatomic, strong, nonnull) NSArray<OPTLYAttribute *><OPTLYAttribute> *attributes;
6161
/// List of group objects
6262
@property (nonatomic, strong, nonnull) NSArray<OPTLYGroup *><OPTLYGroup> *groups;
63-
/// List of live variable objects (DEPRECATED)
64-
@property (nonatomic, strong, nonnull) NSArray<OPTLYVariable *><OPTLYVariable, OPTLYOptional> *variables;
6563

6664
/// a comprehensive list of experiments that includes experiments being whitelisted (in Groups)
6765
@property (nonatomic, strong, nullable) NSArray<OPTLYExperiment *><OPTLYExperiment, OPTLYOptional> *allExperiments;
@@ -151,11 +149,6 @@ __attribute((deprecated("Use OPTLYProjectConfig initWithBuilder method instead."
151149
*/
152150
- (nullable OPTLYAudience *)getAudienceForId:(nonnull NSString *)audienceId;
153151

154-
/**
155-
* Get a variable for a given live variable key. (DEPRECATED)
156-
*/
157-
- (nullable OPTLYVariable *)getVariableForVariableKey:(nonnull NSString *)variableKey;
158-
159152
/**
160153
* Get forced variation for a given experiment key and user id.
161154
*/

OptimizelySDKCore/OptimizelySDKCore/OPTLYProjectConfig.m

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#import "OPTLYVariation.h"
3131
#import "OPTLYFeatureFlag.h"
3232
#import "OPTLYRollout.h"
33-
// Live Variables (DEPRECATED)
34-
#import "OPTLYVariable.h"
3533

3634
NSString * const kExpectedDatafileVersion = @"4";
3735
NSString * const kReservedAttributePrefix = @"$opt_";
@@ -54,9 +52,6 @@ @interface OPTLYProjectConfig()
5452
// userId --> experimentId --> variationId
5553
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSMutableDictionary *><Ignore> *forcedVariationMap;
5654

57-
// Live Variables (DEPRECATED)
58-
@property (nonatomic, strong) NSDictionary<NSString *, OPTLYVariable *><Ignore> *variableKeyToVariableMap;
59-
6055
@end
6156

6257
@implementation OPTLYProjectConfig
@@ -294,16 +289,6 @@ - (OPTLYRollout *)getRolloutForId:(NSString *)rolloutId {
294289
return rollout;
295290
}
296291

297-
// Live Variables (DEPRECATED)
298-
- (OPTLYVariable *)getVariableForVariableKey:(NSString *)variableKey {
299-
OPTLYVariable *variable = self.variableKeyToVariableMap[variableKey];
300-
if (!variable) {
301-
NSString *logMessage = [NSString stringWithFormat:OPTLYLoggerMessagesVariableUnknownForVariableKey, variableKey];
302-
[self.logger logMessage:logMessage withLevel:OptimizelyLogLevelDebug];
303-
}
304-
return variable;
305-
}
306-
307292
#pragma mark -- Forced Variation Methods --
308293

309294
- (OPTLYVariation *)getForcedVariation:(nonnull NSString *)experimentKey
@@ -471,14 +456,6 @@ - (NSDictionary *)eventKeyToEventMap {
471456
return _groupIdToGroupMap;
472457
}
473458

474-
// Live Variables (DEPRECATED)
475-
- (NSDictionary<NSString *, OPTLYVariable *> *)variableKeyToVariableMap {
476-
if (!_variableKeyToVariableMap) {
477-
_variableKeyToVariableMap = [self generateVariableKeyToVariableMap];
478-
}
479-
return _variableKeyToVariableMap;
480-
}
481-
482459
//- (NSMutableDictionary<NSString *, NSMutableDictionary<NSString *, NSString *>> *)forcedVariationMap {
483460
- (NSMutableDictionary<NSString *, NSMutableDictionary *> *)forcedVariationMap {
484461
@synchronized (self) {
@@ -608,15 +585,6 @@ - (NSDictionary *)generateAttributeToKeyMap
608585
return [NSDictionary dictionaryWithDictionary:map];
609586
}
610587

611-
// Live Variables (DEPRECATED)
612-
- (NSDictionary<NSString *, OPTLYVariable *> *)generateVariableKeyToVariableMap {
613-
NSMutableDictionary *map = [[NSMutableDictionary alloc] init];
614-
for (OPTLYVariable *variable in self.variables) {
615-
map[variable.variableKey] = variable;
616-
}
617-
return [NSDictionary dictionaryWithDictionary:map];
618-
}
619-
620588
# pragma mark - Helper Methods
621589

622590
// TODO: Remove bucketer from parameters -- this is not needed

OptimizelySDKCore/OptimizelySDKCore/OPTLYVariable.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

OptimizelySDKCore/OptimizelySDKCore/OPTLYVariable.m

Lines changed: 0 additions & 29 deletions
This file was deleted.

OptimizelySDKCore/OptimizelySDKCore/OPTLYVariation.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
#import <OptimizelySDKCore/OPTLYJSONModelLib.h>
2222
#endif
2323

24-
@class OPTLYVariableUsage, OPTLYVariationVariable;
24+
@class OPTLYVariableUsage;
2525
@protocol OPTLYVariableUsage;
2626
@protocol OPTLYVariation;
27-
// Live Variables (DEPRECATED)
28-
@protocol OPTLYVariationVariable;
2927

3028
/**
3129
* This class is a representation of an Optimizely variation.
@@ -44,7 +42,4 @@
4442
/// Gets the variable usage instance for a given variable id
4543
- (nullable OPTLYVariableUsage *)getVariableUsageForVariableId:(nullable NSString *)variableId;
4644

47-
/// The array containing the variation's live variable information -- variable ID and variable value. (DEPRECATED)
48-
@property (nonatomic, strong, nullable) NSArray<OPTLYVariationVariable *><OPTLYVariationVariable, OPTLYOptional> *variables;
49-
5045
@end

OptimizelySDKCore/OptimizelySDKCore/OPTLYVariationVariable.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

OptimizelySDKCore/OptimizelySDKCore/OPTLYVariationVariable.m

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)