Skip to content

Commit

Permalink
Merge pull request #196 from bugsnag/release-v1.6.0
Browse files Browse the repository at this point in the history
Release v1.6.0
  • Loading branch information
rich-bugsnag committed Nov 9, 2022
2 parents 9d5db1f + 47c3f9e commit 0390347
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

## 1.6.0 (2022-11-09)

* Adds the `Telemetry.Usage` configuration property. [#194](https://github.com/bugsnag/bugsnag-unreal/pull/194)
* Adds the `MaxStringValueLength` configuration property. [#193](https://github.com/bugsnag/bugsnag-unreal/pull/193)

## 1.5.1 (2022-10-27)

* Updates the bugsnag-cocoa dependency from v6.19.0 to [v6.25.0](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6240-2022-10-05)
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ e2e_mac: $(TEST_MAC_APP)

.PHONY: build_example_android
build_example_android: $(EXAMPLE_MAC_LIB)
$(MAKE) -f make/Android.make package
"$(UE_RUNUAT)" $(UE_BUILDCOOK_ARGS) -project="$(UPROJECT)" -targetplatform=Android -distribution

.PHONY: install_example_android
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Bugsnag/Bugsnag.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 10,
"VersionName": "1.5.1",
"Version": 11,
"VersionName": "1.6.0",
"FriendlyName": "Bugsnag",
"Description": "Bugsnag is an error monitoring and application stability management solution.",
"Category": "Developer",
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<insertValue value="repository $S(PluginDir)/../ThirdParty/Android/lib"/>
<insertNewline/>
<insert>
com.bugsnag,bugsnag-plugin-android-unreal,1.5.1
com.bugsnag,bugsnag-plugin-android-unreal,1.6.0
com.bugsnag,bugsnag-android,5.28.1
</insert>
<insertNewline/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobject FAndroidPlatformConfiguration::Parse(JNIEnv* Env,
jniCallWithObjects(Env, jConfig, Cache->ConfigSetMaxPersistedEvents, Config->GetMaxPersistedEvents());
jniCallWithObjects(Env, jConfig, Cache->ConfigSetMaxPersistedSessions, Config->GetMaxPersistedSessions());
jniCallWithObjects(Env, jConfig, Cache->ConfigSetMaxReportedThreads, Config->GetMaxReportedThreads());
jniCallWithObjects(Env, jConfig, Cache->ConfigSetMaxStringValueLength, Config->GetMaxStringValueLength());
jniCallWithBool(Env, jConfig, Cache->ConfigSetPersistUser, Config->GetPersistUser());

jobject jTelemetry = FAndroidPlatformJNI::ParseTelemetryTypeSet(Env, Cache, Config->GetTelemetry());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac
CacheInstanceJavaMethod(env, cache->ConfigSetMaxPersistedEvents, cache->ConfigClass, "setMaxPersistedEvents", "(I)V");
CacheInstanceJavaMethod(env, cache->ConfigSetMaxPersistedSessions, cache->ConfigClass, "setMaxPersistedSessions", "(I)V");
CacheInstanceJavaMethod(env, cache->ConfigSetMaxReportedThreads, cache->ConfigClass, "setMaxReportedThreads", "(I)V");
CacheInstanceJavaMethod(env, cache->ConfigSetMaxStringValueLength, cache->ConfigClass, "setMaxStringValueLength", "(I)V");
CacheInstanceJavaMethod(env, cache->ConfigSetPersistenceDirectory, cache->ConfigClass, "setPersistenceDirectory", "(Ljava/io/File;)V");
CacheInstanceJavaMethod(env, cache->ConfigSetPersistUser, cache->ConfigClass, "setPersistUser", "(Z)V");
CacheInstanceJavaMethod(env, cache->ConfigSetProjectPackages, cache->ConfigClass, "setProjectPackages", "(Ljava/util/Set;)V");
Expand Down Expand Up @@ -368,6 +369,7 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac
CacheStaticJavaField(env, cache->ErrorTypeAndroid, cache->ErrorTypeClass, "ANDROID", "Lcom/bugsnag/android/ErrorType;");
CacheStaticJavaField(env, cache->ErrorTypeC, cache->ErrorTypeClass, "C", "Lcom/bugsnag/android/ErrorType;");
CacheStaticJavaField(env, cache->TelemetryInternalErrors, cache->TelemetryClass, "INTERNAL_ERRORS", "Lcom/bugsnag/android/Telemetry;");
CacheStaticJavaField(env, cache->TelemetryUsage, cache->TelemetryClass, "USAGE", "Lcom/bugsnag/android/Telemetry;");
CacheStaticJavaField(env, cache->ThreadSendPolicyAlways, cache->ThreadSendPolicyClass, "ALWAYS", "Lcom/bugsnag/android/ThreadSendPolicy;");
CacheStaticJavaField(env, cache->ThreadSendPolicyUnhandledOnly, cache->ThreadSendPolicyClass, "UNHANDLED_ONLY", "Lcom/bugsnag/android/ThreadSendPolicy;");
CacheStaticJavaField(env, cache->ThreadSendPolicyNever, cache->ThreadSendPolicyClass, "NEVER", "Lcom/bugsnag/android/ThreadSendPolicy;");
Expand Down Expand Up @@ -577,7 +579,8 @@ jobject FAndroidPlatformJNI::ParseTelemetryTypeSet(JNIEnv* Env, const JNIReferen
return nullptr;
}
jclass TypeClass = Cache->TelemetryClass;
if (addTypeToSet(Env, Cache, jSet, EnumHasAllFlags(Value, EBugsnagTelemetryTypes::InternalErrors), TypeClass, Cache->TelemetryInternalErrors))
if (addTypeToSet(Env, Cache, jSet, EnumHasAllFlags(Value, EBugsnagTelemetryTypes::InternalErrors), TypeClass, Cache->TelemetryInternalErrors) &&
addTypeToSet(Env, Cache, jSet, EnumHasAllFlags(Value, EBugsnagTelemetryTypes::Usage), TypeClass, Cache->TelemetryUsage))
{
return jSet;
}
Expand Down
2 changes: 2 additions & 0 deletions Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ typedef struct
jmethodID ConfigSetMaxPersistedEvents;
jmethodID ConfigSetMaxPersistedSessions;
jmethodID ConfigSetMaxReportedThreads;
jmethodID ConfigSetMaxStringValueLength;
jmethodID ConfigSetPersistenceDirectory;
jmethodID ConfigSetPersistUser;
jmethodID ConfigSetProjectPackages;
Expand Down Expand Up @@ -287,6 +288,7 @@ typedef struct
jfieldID ErrorTypeAndroid;
jfieldID ErrorTypeC;
jfieldID TelemetryInternalErrors;
jfieldID TelemetryUsage;
jfieldID ThreadSendPolicyAlways;
jfieldID ThreadSendPolicyUnhandledOnly;
jfieldID ThreadSendPolicyNever;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

static BSGTelemetryOptions GetTelemetryTypes(EBugsnagTelemetryTypes Value)
{
return (EnumHasAllFlags(Value, EBugsnagTelemetryTypes::InternalErrors) ? BSGTelemetryInternalErrors : 0);
return (EnumHasAllFlags(Value, EBugsnagTelemetryTypes::InternalErrors) ? BSGTelemetryInternalErrors : 0) |
(EnumHasAllFlags(Value, EBugsnagTelemetryTypes::Usage) ? BSGTelemetryUsage : 0);
}

static BSGThreadSendPolicy GetThreadSendPolicy(EBugsnagSendThreadsPolicy Policy)
Expand Down Expand Up @@ -108,6 +109,8 @@ BugsnagConfiguration* FApplePlatformConfiguration::Configuration(const TSharedRe

CocoaConfig.maxPersistedSessions = Configuration->GetMaxPersistedSessions();

CocoaConfig.maxStringValueLength = Configuration->GetMaxStringValueLength();

CocoaConfig.persistUser = Configuration->GetPersistUser();

CocoaConfig.telemetry = GetTelemetryTypes(Configuration->GetTelemetry());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ void FApplePlatformConfigurationSpec::Define()
{
TSharedRef<FBugsnagConfiguration> Configuration = MakeShared<FBugsnagConfiguration>(ApiKey);
BugsnagConfiguration* CocoaConfig = FApplePlatformConfiguration::Configuration(Configuration);
TEST_TRUE(CocoaConfig.telemetry == BSGTelemetryInternalErrors);
TEST_TRUE(CocoaConfig.telemetry == BSGTelemetryAll);
Configuration->SetTelemetry(EBugsnagTelemetryTypes::None);
CocoaConfig = FApplePlatformConfiguration::Configuration(Configuration);
TEST_TRUE(CocoaConfig.telemetry == 0);
Configuration->SetTelemetry(EBugsnagTelemetryTypes::Usage);
CocoaConfig = FApplePlatformConfiguration::Configuration(Configuration);
TEST_TRUE(CocoaConfig.telemetry == BSGTelemetryUsage);
});

It("ReleaseStage", [this]()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ static EBugsnagEnabledBreadcrumbTypes Convert(FBugsnagEnabledBreadcrumbTypes Val

static EBugsnagTelemetryTypes Convert(const FBugsnagTelemetryTypes& Value)
{
return (Value.bInternalErrors ? EBugsnagTelemetryTypes::InternalErrors : EBugsnagTelemetryTypes::None);
return (Value.bInternalErrors ? EBugsnagTelemetryTypes::InternalErrors : EBugsnagTelemetryTypes::None) |
(Value.bUsage ? EBugsnagTelemetryTypes::Usage : EBugsnagTelemetryTypes::None);
}

uint64 const FBugsnagConfiguration::AppHangThresholdFatalOnly = INT_MAX;
Expand All @@ -60,6 +61,7 @@ FBugsnagConfiguration::FBugsnagConfiguration(const UBugsnagSettings& Settings)
, bSendLaunchCrashesSynchronously(Settings.bSendLaunchCrashesSynchronously)
, MaxPersistedEvents(Settings.MaxPersistedEvents)
, MaxPersistedSessions(Settings.MaxPersistedSessions)
, MaxStringValueLength(Settings.MaxStringValueLength)
, bPersistUser(Settings.bPersistUser)
, Telemetry(Convert(Settings.Telemetry))
, ReleaseStage(UnsetIfEmpty(Settings.ReleaseStage))
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Bugsnag/Source/Bugsnag/Private/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

#define BUGSNAG_UNREAL_NAME "Unreal Bugsnag Notifier"
#define BUGSNAG_UNREAL_URL "https://github.com/bugsnag/bugsnag-unreal"
#define BUGSNAG_UNREAL_VERSION_STRING "1.5.1"
#define BUGSNAG_UNREAL_VERSION_STRING "1.6.0"
15 changes: 15 additions & 0 deletions Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,20 @@ class BUGSNAG_API FBugsnagConfiguration final : public IBugsnagFeatureFlagStore,
*/
void SetMaxPersistedSessions(uint32 Value) { MaxPersistedSessions = Value; };

/**
* The maximum length of a string in metadata.
*
* To help avoid excessive event payload sizes, any strings exceeding this length will be truncated.
*
* This limit defaults to 10,000 characters.
*/
uint32 GetMaxStringValueLength() const { return MaxStringValueLength; }

/**
* @param Value The maximum length of a string in metadata.
*/
void SetMaxStringValueLength(uint32 Value) { MaxStringValueLength = Value; };

/**
* The maximum number of Android JVM threads that will be reported with an event.
*
Expand Down Expand Up @@ -585,6 +599,7 @@ class BUGSNAG_API FBugsnagConfiguration final : public IBugsnagFeatureFlagStore,
uint32 MaxPersistedEvents = 32;
uint32 MaxPersistedSessions = 128;
uint32 MaxReportedThreads = 200;
uint32 MaxStringValueLength = 10000;
bool bPersistUser = true;
EBugsnagTelemetryTypes Telemetry = EBugsnagTelemetryTypes::All;
FBugsnagUser User;
Expand Down
8 changes: 8 additions & 0 deletions Plugins/Bugsnag/Source/Bugsnag/Public/BugsnagSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ struct FBugsnagTelemetryTypes
// Errors within the Bugsnag SDK.
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Advanced Configuration")
bool bInternalErrors = true;

// Information about how Bugsnag has been configured.
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Advanced Configuration")
bool bUsage = true;
};

/**
Expand Down Expand Up @@ -195,6 +199,10 @@ class BUGSNAG_API UBugsnagSettings : public UObject
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Advanced Configuration", Meta = (ClampMin = "1"))
uint32 MaxPersistedSessions = 128;

// The maximum length of a string in metadata.
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Advanced Configuration", Meta = (ClampMin = "1"))
uint32 MaxStringValueLength = 10000;

// Whether User information should be persisted to disk between application runs.
UPROPERTY(GlobalConfig, EditAnywhere, Category = "Advanced Configuration")
bool bPersistUser = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ enum class EBugsnagTelemetryTypes : uint8
{
None = 0,
InternalErrors = 1 << 0,
All = InternalErrors
Usage = 1 << 1,
All = InternalErrors | Usage
};
ENUM_CLASS_FLAGS(EBugsnagTelemetryTypes)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1
1.6.0
2 changes: 1 addition & 1 deletion deps/bugsnag-plugin-android-unreal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ task generatePom {
pom {
project {
groupId 'com.bugsnag'
version '1.5.1'
version '1.6.0'
packaging 'aar'
}
}.writeTo("$buildDir/outputs/aar/bugsnag-plugin-android-unreal-release.pom")
Expand Down

0 comments on commit 0390347

Please sign in to comment.