Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved onboarding flow based on blog spot #27

Merged
merged 8 commits into from
Sep 2, 2024
Merged

Conversation

pasotee
Copy link
Collaborator

@pasotee pasotee commented Aug 28, 2024

Describe the purpose of your pull request

  • Replace ensure with logs & prints to ensure the process does not hang
  • Added on-screen error for missing SDK key
  • Fixed compiling issue for blueprint-based project

@pasotee pasotee requested a review from a team as a code owner August 28, 2024 17:01
@@ -279,7 +284,12 @@ void UConfigCatSubsystem::Initialize(FSubsystemCollectionBase& Collection)
const UConfigCatSettings* ConfigCatSettings = GetDefault<UConfigCatSettings>();
if (!ConfigCatSettings || ConfigCatSettings->SdkKey.IsEmpty())
{
UE_LOG(LogConfigCat, Warning, TEXT("Empty SdkKey detected. Please set your SdkKey in the Project Settings."));
if(GEngine)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if(GEngine)
if (GEngine)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I ran the formatter now and uncovered more of these cases, they are now all part of this PR

{
return true;
}

UE_LOG(LogConfigCat, Warning, TEXT("Trying to access the ConfigCatClient before initialization or after shutdown."));
UE_LOG(LogConfigCat, Error, TEXT("Trying to access the ConfigCatClient before initialization or after shutdown."));
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please move the error message into a variable to avoid string duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's refactored now into a PrintError function for both cases.

UE_LOG(LogConfigCat, Warning, TEXT("Empty SdkKey detected. Please set your SdkKey in the Project Settings."));
if(GEngine)
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Red, TEXT("ConfigCat SdkKey missing. Please set your SdkKey in the Project Settings."));
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please move the error message into a variable to avoid string duplication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's refactored now into a PrintError function for both cases.

@pasotee pasotee requested a review from kp-cat August 31, 2024 06:51
@pasotee pasotee merged commit 51272db into main Sep 2, 2024
2 checks passed
@pasotee pasotee deleted the blogspot-fixes branch September 2, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants