Skip to content

Commit

Permalink
Merge pull request #159 from bugsnag/release-v1.4.0
Browse files Browse the repository at this point in the history
Release v1.4.0
  • Loading branch information
nickdowell committed May 11, 2022
2 parents 7434b65 + 6d693f1 commit 0f3d38e
Show file tree
Hide file tree
Showing 22 changed files with 218 additions and 228 deletions.
15 changes: 3 additions & 12 deletions .buildkite/pipeline.full.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
agents:
queue: macos-12-arm

steps:
#
# Build Plugins
Expand All @@ -23,8 +26,6 @@ steps:

# UE 4.26
- label: 'Build Plugin - 4.26 Mac'
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "4.26"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand All @@ -41,8 +42,6 @@ steps:

# UE 5.0
- label: 'Build Plugin - 5.0 Mac'
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "5.0"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand All @@ -64,8 +63,6 @@ steps:
# UE 5.0EA
- name: ':android: Build E2E - 5.0 Android'
depends_on: plugin_5_0
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "5.0"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand All @@ -84,8 +81,6 @@ steps:

- name: ':ios: Build E2E - 5.0 iOS'
depends_on: plugin_5_0
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "5.0"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand All @@ -104,8 +99,6 @@ steps:

- name: ':mac: Build E2E - 5.0 Mac'
depends_on: plugin_5_0
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "5.0"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand Down Expand Up @@ -209,8 +202,6 @@ steps:
- label: 'E2E Tests - 5.0 macOS 12'
depends_on: mac_fixture_5_0
timeout_in_minutes: 10
agents:
queue: opensource-arm-mac-cocoa-12
plugins:
artifacts#v1.5.0:
download:
Expand Down
15 changes: 4 additions & 11 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
agents:
queue: macos-12-arm

steps:
#
# Build Plugins
Expand All @@ -24,8 +27,6 @@ steps:

# UE 4.27
- label: 'Build Plugin - 4.27 Mac'
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "4.27"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand Down Expand Up @@ -56,11 +57,9 @@ steps:
# UE 4.27
- name: ':android: Build E2E - 4.27 Android'
depends_on: plugin_4_27
agents:
queue: opensource-mac-cocoa-10.15
env:
UE_VERSION: "4.27"
DEVELOPER_DIR: "/Applications/Xcode12.app"
DEVELOPER_DIR: "/Applications/Xcode13.app"
plugins:
artifacts#v1.5.0:
download: Build/Plugin/Bugsnag-*-UE_4.27-macOS.zip
Expand All @@ -76,8 +75,6 @@ steps:

- name: ':ios: Build E2E - 4.27 iOS'
depends_on: plugin_4_27
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "4.27"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand All @@ -96,8 +93,6 @@ steps:

- name: ':mac: Build E2E - 4.27 Mac'
depends_on: plugin_4_27
agents:
queue: opensource-arm-mac-cocoa-12
env:
UE_VERSION: "4.27"
DEVELOPER_DIR: "/Applications/Xcode13.app"
Expand Down Expand Up @@ -174,8 +169,6 @@ steps:
- label: 'E2E Tests - 4.27 macOS 12'
depends_on: mac_fixture_4_27
timeout_in_minutes: 10
agents:
queue: opensource-arm-mac-cocoa-12
plugins:
artifacts#v1.5.0:
download:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

## 1.4.0 (2022-05-11)

* Adds official support for Unreal Engine 5.0 🚀
* Fixes improper use of `TCHAR_TO_UTF8()` that could result in use-after-free on Android.
[#157](https://github.com/bugsnag/bugsnag-unreal/pull/157)
* Updates the bugsnag-android dependency from v5.22.0 to [v5.22.1](https://github.com/bugsnag/bugsnag-android/blob/master/CHANGELOG.md#5221-2022-04-28)
* Updates the bugsnag-cocoa dependency from v6.16.6 to [v6.16.8](https://github.com/bugsnag/bugsnag-cocoa/blob/master/CHANGELOG.md#6168-2022-05-04)

## 1.3.1 (2022-04-26)

* Fixes `java.lang.ClassNotFoundException` in minified Android builds.
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ UE_VERSION?=4.27
UE_HOME?=/Users/Shared/Epic Games/UE_$(UE_VERSION)
UE_BUILD=$(UE_HOME)/Engine/Build/BatchFiles/Mac/Build.sh
UE_RUNUAT=$(UE_HOME)/Engine/Build/BatchFiles/RunUAT.sh
ifeq ($(findstring 5.,$(UE_VERSION)),5.)
UE_EDITOR=$(UE_HOME)/Engine/Binaries/Mac/UnrealEditor.app/Contents/MacOS/UnrealEditor
else
UE_EDITOR=$(UE_HOME)/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor
endif
UE_BUILDCOOK_ARGS=BuildCookRun -nocompileeditor -nop4 -stage -package \
-clientconfig=Shipping -compressed -pak -prereqs \
-build -utf8output -cook -distribution
-build -utf8output -cook

UPROJECT=$(PWD)/BugsnagExample.uproject
EXAMPLE_MAC_LIB=Binaries/Mac/UE4Editor-BugsnagExample.dylib
Expand Down Expand Up @@ -134,7 +138,7 @@ e2e_mac: $(TEST_MAC_APP)

.PHONY: build_example_android
build_example_android: $(EXAMPLE_MAC_LIB)
"$(UE_RUNUAT)" $(UE_BUILDCOOK_ARGS) -project="$(UPROJECT)" -targetplatform=Android
"$(UE_RUNUAT)" $(UE_BUILDCOOK_ARGS) -project="$(UPROJECT)" -targetplatform=Android -distribution

.PHONY: install_example_android
install_example_android: build_example_android
Expand Down Expand Up @@ -177,7 +181,7 @@ $(EXAMPLE_MAC_LIB): $(shell find Plugins/Bugsnag/Source Source -type f)
#-------------------------------------------------------------------------------

$(TEST_ANDROID_APP): $(TEST_MAC_LIB)
"$(UE_RUNUAT)" $(UE_BUILDCOOK_ARGS) -project="$(TESTPROJ)" -targetplatform=Android
"$(UE_RUNUAT)" $(UE_BUILDCOOK_ARGS) -project="$(TESTPROJ)" -targetplatform=Android -distribution

$(TEST_IOS_APP): $(TEST_MAC_LIB)
"$(UE_RUNUAT)" $(UE_BUILDCOOK_ARGS) -project="$(TESTPROJ)" -targetplatform=IOS
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": 7,
"VersionName": "1.3.1",
"Version": 8,
"VersionName": "1.4.0",
"FriendlyName": "Bugsnag",
"Description": "Bugsnag is an error monitoring and application stability management solution.",
"Category": "Developer",
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Bugsnag/Source/Bugsnag/Bugsnag_UPL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
<insertValue value="repository $S(PluginDir)/../ThirdParty/Android/lib"/>
<insertNewline/>
<insert>
com.bugsnag,bugsnag-plugin-android-unreal,1.3.1
com.bugsnag,bugsnag-android,5.22.0
com.bugsnag,bugsnag-plugin-android-unreal,1.4.0
com.bugsnag,bugsnag-android,5.22.1
</insert>
<insertNewline/>
</AARImports>
Expand Down
13 changes: 4 additions & 9 deletions Plugins/Bugsnag/Source/Bugsnag/Private/Android/JNIUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,17 +376,12 @@ bool FAndroidPlatformJNI::LoadReferenceCache(JNIEnv* env, JNIReferenceCache* cac

jstring FAndroidPlatformJNI::ParseFString(JNIEnv* Env, const FString& Text)
{
const char* rawText = TCHAR_TO_UTF8(*Text);
if (rawText)
jstring jText = (*Env).NewStringUTF(TCHAR_TO_UTF8(*Text));
if (FAndroidPlatformJNI::CheckAndClearException(Env))
{
jstring jText = (*Env).NewStringUTF(rawText);
if (FAndroidPlatformJNI::CheckAndClearException(Env))
{
return NULL;
}
return jText;
return NULL;
}
return NULL;
return jText;
}

FString FAndroidPlatformJNI::ParseJavaString(JNIEnv* Env, const JNIReferenceCache* Cache, jobject Value)
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.3.1"
#define BUGSNAG_UNREAL_VERSION_STRING "1.4.0"
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.4.0
2 changes: 1 addition & 1 deletion deps/bugsnag-cocoa
Submodule bugsnag-cocoa updated 54 files
+1 −1 .buildkite/pipeline.yml
+2 −2 .jazzy.yaml
+1 −1 BUGSNAG-PLUGIN.md
+3 −3 Bugsnag.podspec.json
+2 −4 Bugsnag.xcodeproj/project.pbxproj
+3 −8 Bugsnag/BugsnagSessionTracker.h
+15 −42 Bugsnag/BugsnagSessionTracker.m
+4 −0 Bugsnag/BugsnagSystemState.h
+4 −8 Bugsnag/BugsnagSystemState.m
+0 −12 Bugsnag/Client/BugsnagClient+Private.h
+34 −45 Bugsnag/Client/BugsnagClient.m
+14 −2 Bugsnag/Delivery/BSGSessionUploader.m
+4 −0 Bugsnag/Helpers/BSGKeys.h
+0 −2 Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSCrashReport.c
+0 −1 Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSCrashReportFields.h
+0 −1 Bugsnag/KSCrash/Source/KSCrash/Recording/BSG_KSSystemInfo.m
+0 −11 Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.c
+0 −6 Bugsnag/KSCrash/Source/KSCrash/Recording/Tools/BSG_KSMach.h
+1 −1 Bugsnag/Payload/BugsnagApp+Private.h
+1 −1 Bugsnag/Payload/BugsnagDevice+Private.h
+1 −1 Bugsnag/Payload/BugsnagDevice.m
+6 −18 Bugsnag/Payload/BugsnagEvent.m
+1 −1 Bugsnag/Payload/BugsnagNotifier.m
+11 −24 Bugsnag/Payload/BugsnagSession+Private.h
+62 −114 Bugsnag/Payload/BugsnagSession.m
+2 −8 Bugsnag/Storage/BugsnagSessionFileStore.m
+4 −4 BugsnagNetworkRequestPlugin.podspec.json
+6 −14 BugsnagNetworkRequestPlugin/BugsnagNetworkRequestPlugin.xcodeproj/project.pbxproj
+1 −1 BugsnagNetworkRequestPlugin/README.md
+20 −0 CHANGELOG.md
+1 −1 Framework/Info.plist
+3 −1 Makefile
+1 −1 Package.swift
+1 −1 README.md
+0 −6 Tests/BugsnagTests/BugsnagClientMirrorTest.m
+2 −2 Tests/BugsnagTests/BugsnagConfigurationTests.m
+1 −1 Tests/BugsnagTests/BugsnagDeviceTest.m
+1 −2 Tests/BugsnagTests/BugsnagEventTests.m
+5 −6 Tests/BugsnagTests/BugsnagSessionTest.m
+1 −3 Tests/BugsnagTests/BugsnagSessionTrackerStopTest.m
+3 −13 Tests/BugsnagTests/BugsnagSessionTrackerTest.m
+1 −1 Tests/BugsnagTests/Info.plist
+0 −6 Tests/KSCrashTests/BSG_KSMachTests.m
+1 −1 Tests/TestHost-iOS/Info.plist
+1 −1 VERSION
+1 −1 examples/objective-c-ios/Podfile
+2 −2 examples/objective-c-ios/objective-c-ios.xcodeproj/project.pbxproj
+1 −1 examples/swift-ios/Podfile
+4 −4 examples/swift-ios/swift-ios.xcodeproj/project.pbxproj
+2 −0 features/delivery.feature
+2 −0 features/event_callbacks.feature
+2 −2 features/fixtures/ios/iOSTestApp.xcodeproj/project.pbxproj
+21 −0 features/fixtures/shared/scenarios/LastRunInfoScenario.swift
+14 −0 features/steps/cocoa_steps.rb
4 changes: 2 additions & 2 deletions deps/bugsnag-plugin-android-unreal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {
}

dependencies {
api "com.bugsnag:bugsnag-android-core:5.22.0"
api "com.bugsnag:bugsnag-android-core:5.22.1"
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test:rules:1.4.0'
androidTestImplementation 'junit:junit:4.12'
Expand All @@ -40,7 +40,7 @@ task generatePom {
pom {
project {
groupId 'com.bugsnag'
version '1.3.1'
version '1.4.0'
packaging 'aar'
}
}.writeTo("$buildDir/outputs/aar/bugsnag-plugin-android-unreal-release.pom")
Expand Down
Binary file modified features/fixtures/generic/Content/MainWidget.uasset
Binary file not shown.
92 changes: 92 additions & 0 deletions features/fixtures/generic/Source/TestFixture/MainWidgetBase.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Copyright 2022 Bugsnag. All Rights Reserved.

#include "MainWidgetBase.h"

#include "CoreMinimal.h"
#include "Http.h"
#include "Json.h"
#include "Kismet/GameplayStatics.h"
#include "Serialization/LargeMemoryReader.h"

#include "LogTestFixture.h"
#include "ScenarioNames.h"
#include "Scenarios/Scenario.h"

#if PLATFORM_ANDROID || PLATFORM_IOS
#define MAZE_RUNNER_URL_BASE "http:https://bs-local.com:9339"
#else
#define MAZE_RUNNER_URL_BASE "http:https://localhost:9339"
#endif

void UMainWidgetBase::NativeOnInitialized()
{
UUserWidget::NativeOnInitialized();

#if PLATFORM_MAC
UGameplayStatics::GetPlayerController(GetWorld(), 0)->SetShowMouseCursor(true);

if (FApp::IsGame())
{
// Wait for map loading to prevent unexpected breadcrumbs when running scenarios.
FCoreUObjectDelegates::PostLoadMapWithWorld.AddLambda([this](UWorld* World)
{
static bool once;
if (!once)
{
once = true;
ExecuteMazeRunnerCommand();
}
});
}
#endif
}

void UMainWidgetBase::ExecuteMazeRunnerCommand()
{
TSharedRef<IHttpRequest, ESPMode::ThreadSafe> HttpRequest = FHttpModule::Get().CreateRequest();
HttpRequest->SetVerb("GET");
HttpRequest->SetURL(TEXT(MAZE_RUNNER_URL_BASE "/command"));
HttpRequest->OnProcessRequestComplete().BindLambda([](FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bConnectedSuccessfully)
{
if (!bConnectedSuccessfully || !HttpResponse.IsValid())
{
UE_LOG(LogTestFixture, Error, TEXT("ExecuteMazeRunnerCommand: no response"));
return;
}

int32 StatusCode = HttpResponse->GetResponseCode();
if (StatusCode != 200)
{
UE_LOG(LogTestFixture, Error, TEXT("ExecuteMazeRunnerCommand: status code %d"), StatusCode);
return;
}

UE_LOG(LogTestFixture, Display, TEXT("ExecuteMazeRunnerCommand: %s"), *(HttpResponse->GetContentAsString()));

TSharedPtr<FJsonObject> JsonObject;
const TArray<uint8>& Content = HttpResponse->GetContent();
FLargeMemoryReader Archive((const uint8*)Content.GetData(), Content.Num());
if (!FJsonSerializer::Deserialize(TJsonReaderFactory<char>::Create(&Archive), JsonObject))
{
UE_LOG(LogTestFixture, Error, TEXT("ExecuteMazeRunnerCommand: Could not deserialize Maze Runner command"));
return;
}

const FString& Action = JsonObject->GetStringField(TEXT("action"));
const FString& ScenarioName = JsonObject->GetStringField(TEXT("scenario_name"));

if (Action == TEXT("run_scenario"))
{
Scenario::Run(ScenarioName);
}
else if (Action == TEXT("start_bugsnag"))
{
Scenario::Start(ScenarioName);
}
else
{
UE_LOG(LogTestFixture, Error, TEXT("ExecuteMazeRunnerCommand: bad action: \"%s\""), *Action);
}
});
HttpRequest->ProcessRequest();
}
17 changes: 17 additions & 0 deletions features/fixtures/generic/Source/TestFixture/MainWidgetBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright 2022 Bugsnag. All Rights Reserved.

#pragma once

#include "Blueprint/UserWidget.h"
#include "MainWidgetBase.generated.h"

UCLASS()
class TESTFIXTURE_API UMainWidgetBase : public UUserWidget
{
GENERATED_BODY()

void NativeOnInitialized() override;

UFUNCTION(BlueprintCallable)
void ExecuteMazeRunnerCommand();
};
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,18 @@ class NotifyScenario : public Scenario
return true;
});

UBugsnagFunctionLibrary::SetContext("pause menu");
// Check that a large (> 128 byte) string can be safely handled without crashing
UBugsnagFunctionLibrary::SetContext(TEXT(/* spell-checker: disable */
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque gravida sodales"
" nisl, at scelerisque lectus ullamcorper vitae. Integer congue nunc sed gravida "
"ultricies. Donec posuere erat tellus, vel tempus nisl sodales at. Sed nibh turpi"
"s, mollis nec turpis a, cursus tincidunt ipsum. Donec nec sagittis magna. Aliqua"
"m sit amet tellus maximus, vehicula enim ac, tincidunt tortor. Sed eu enim et ma"
"ssa volutpat auctor. Praesent facilisis diam ultricies pharetra dapibus. Pellent"
"esque sit amet ex congue, pharetra felis eu, mollis ligula. Etiam non turpis a t"
"urpis maximus facilisis sed vitae nisi. Curabitur scelerisque ultrices scelerisq"
"ue. Integer semper leo volutpat, venenatis orci ac, facilisis mauris. Curabitur "
"luctus urna a orci lacinia ornare."));

UBugsnagFunctionLibrary::AddFeatureFlag(TEXT("Bugsnag"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public TestFixture(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "SlateCore", "Json" });
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "Http", "SlateCore", "Json" });

PrivateDependencyModuleNames.AddRange(new string[] { "Bugsnag" });
}
Expand Down
Loading

0 comments on commit 0f3d38e

Please sign in to comment.