Skip to content

Commit

Permalink
Merge pull request #43 from flagship-io/dut_bugs
Browse files Browse the repository at this point in the history
Dut bugs
  • Loading branch information
ABTastyAdel authored Feb 6, 2024
2 parents 79a8eb1 + 73bf443 commit 70f83bd
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 46 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.1.2 - 06/02/2024

- Bug fixes on Troubleshooting and Developer Usage hits

# 3.1.1 - 16/01/2024

- Return the correct flag value from value() method when null is given as default value or when the value for flag is null
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
device_information: d652f6dcea86bdc5300ffd495486de1d5047bf4f
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider_foundation: eaf5b3e458fc0e5fbb9940fb09980e853fe058b8
shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a

PODFILE CHECKSUM: 21b64fbb12492d731c9be90cbe0f2d328bef4b49
PODFILE CHECKSUM: ce13d36744da294d67f8e460dbb7aed7c09bd7f4

COCOAPODS: 1.12.1
COCOAPODS: 1.13.0
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -423,7 +423,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -472,7 +472,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
2 changes: 1 addition & 1 deletion example/lib/Providers/fs_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class FSData extends ChangeNotifier {
}

class UserData extends ChangeNotifier {
String _visitorId = "QA6/11";
String _visitorId = "userFevBis";
Map<String, Object> context = {
"testing_tracking_manager": true,
"condition1": "test"
Expand Down
28 changes: 14 additions & 14 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.18.0"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -111,7 +111,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.0.4"
version: "3.1.1"
flutter:
dependency: "direct main"
description: flutter
Expand Down Expand Up @@ -187,10 +187,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
murmurhash:
dependency: transitive
description:
Expand Down Expand Up @@ -392,18 +392,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
Expand Down Expand Up @@ -432,10 +432,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.6.1"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -464,10 +464,10 @@ packages:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
version: "0.3.0"
win32:
dependency: transitive
description:
Expand All @@ -485,5 +485,5 @@ packages:
source: hosted
version: "1.0.0"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.3.0"
24 changes: 24 additions & 0 deletions lib/dataUsage/data_report_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ String troubleShootingVersion = "1";
String stackType = "SDK";
String stackName = "Flutter";

// This enum describe the level given to hits of Troubleshooting or DeveloperUsage
enum HitUsageLevel { INFO, WARNING, ERROR }

class DataReportQueue {
Service _reportService = Service(http.Client());

Expand Down Expand Up @@ -52,10 +55,19 @@ class TroubleshootingHit extends BaseHit {
Map<String, String> speceficCustomFields = {};
// Label for the critical point
String label = "";

// Level by default is INFO
HitUsageLevel hitLevelUsage = HitUsageLevel.INFO;

TroubleshootingHit(String aVisitorId, this.label, this.speceficCustomFields)
: super() {
// Set the type of hit
type = HitCategory.TROUBLESHOOTING;
// Set the visitorId
visitorId = aVisitorId;
// Update level log according to label
_updateLogLevel();
// Set the commun infos
_fillTheCommunFieldsAndCompleteWithCustom();
}

Expand Down Expand Up @@ -93,10 +105,22 @@ class TroubleshootingHit extends BaseHit {
"stack.version": FlagshipVersion,
"flagshipInstanceId":
Flagship.sharedInstance().flagshipInstanceId.toString(),
"logLevel": hitLevelUsage.name,
};

_communCustomFields.addEntries(this.speceficCustomFields.entries);
}

// Update level log according to label
_updateLogLevel() {
if (label.contains("WARNING") || label.contains("FLAG_NOT_FOUND")) {
hitLevelUsage = HitUsageLevel.WARNING;
} else if (label.contains("ERROR")) {
hitLevelUsage = HitUsageLevel.ERROR;
} else {
hitLevelUsage = HitUsageLevel.INFO;
}
}
}

class DataUsageHit extends TroubleshootingHit {
Expand Down
6 changes: 3 additions & 3 deletions lib/dataUsage/data_usage_tracking.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ part 'trouble_shooting.g.dart';
String dataUsageLabel = "SDK_CONFIG";

// Allocation threshold for data usage tracking
int dataUsageAllocationThreshold = 10;
int dataUsageAllocationThreshold = 1;

class DataUsageTracking {
factory DataUsageTracking.sharedInstance() {
Expand Down Expand Up @@ -146,7 +146,7 @@ class DataUsageTracking {
DateTime.now().year.toString() +
DateTime.now().month.toString() +
DateTime.now().day.toString();
int hashAlloc = (MurmurHash.v3(combinedId, 0) % 100);
int hashAlloc = (MurmurHash.v3(combinedId, 0) % 1000);

Flagship.logger(Level.INFO,
"The hash allocation for Datausage tracking bucket is $hashAlloc ");
Expand Down Expand Up @@ -333,7 +333,7 @@ enum CriticalPoints {
// Trigger when the Flag.getValue method is called and no flag is found
GET_FLAG_VALUE_FLAG_NOT_FOUND,
// Trigger when the Flag.visitorExposed method is called and no flag is found
VISITOR_EXPOSED_FLAG_NO_FOUND,
VISITOR_EXPOSED_FLAG_NOT_FOUND,
// Trigger when the Flag.visitorExposed method is called and the flag value has a different type with default value
GET_FLAG_VALUE_TYPE_WARNING,
// Trigger when the SDK catches any other error but those listed here.
Expand Down
12 changes: 7 additions & 5 deletions lib/dataUsage/trouble_shooting.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,20 @@ Map<String, String> _createSdkConfig(FlagshipConfig? sdkConfig) {
(!(sdkConfig?.visitorCacheImp is DefaultCacheVisitorImp)).toString(),
"sdk.config.usingCustomHitCache":
(!(sdkConfig?.hitCacheImp is DefaultCacheHitImp)).toString(),
"sdk.config.trackingManager.config.strategy":
"sdk.config.trackingManager.strategy":
sdkConfig?.trackingManagerConfig.batchStrategy.name ?? "",
"sdk.config.trackingManager.config.batchIntervals":
sdkConfig?.trackingManagerConfig.batchIntervals.toString() ?? "",
"sdk.config.trackingManager.batchIntervals":
((sdkConfig?.trackingManagerConfig.batchIntervals ?? 0) * 1000)
.toString(),
"sdk.config.timeout": sdkConfig?.timeout.toString() ?? "",
"sdk.config.pollingTime": sdkConfig?.pollingTime.toString() ?? "",
"sdk.config.pollingTime": ((sdkConfig?.pollingTime ?? 0) * 1000).toString(),
"sdk.config.mode": sdkConfig?.decisionMode.name ?? "",

"sdk.config.decisionApiUrl": Endpoints.DECISION_API,
"sdk.status": Flagship.getStatus().name,
"sdk.lastInitializationTimestamp":
Flagship.sharedInstance().lastInitializationTimestamp,
"logLevel": sdkConfig?.getLevel().name ?? "",
"sdk.config.logLevel":
Flagship.sharedInstance().getConfiguration()?.getLevel().name ?? ""
};
}
2 changes: 1 addition & 1 deletion lib/flagship_version.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/// This file is automatically updated
const FlagshipVersion = "3.1.1";
const FlagshipVersion = "3.1.2";
26 changes: 13 additions & 13 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ packages:
dependency: "direct main"
description:
name: collection
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.2"
version: "1.18.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -364,10 +364,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -665,18 +665,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
stream_transform:
dependency: transitive
description:
Expand Down Expand Up @@ -713,10 +713,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev"
source: hosted
version: "0.6.0"
version: "0.6.1"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -761,10 +761,10 @@ packages:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
version: "0.3.0"
web_socket_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -798,5 +798,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.1.0-185.0.dev <4.0.0"
dart: ">=3.2.0-194.0.dev <4.0.0"
flutter: ">=3.7.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flagship
description: Flutter SDK for Flagship Feature management & Experiment platform for modern engineering and product teams
version: 3.1.1
version: 3.1.2
homepage: https://flagship.io

environment:
Expand Down

0 comments on commit 70f83bd

Please sign in to comment.