Add CallbackHelper lifecycle handling and fix unit test execution#1276
Open
OswaldoApexSystems wants to merge 16 commits into
Open
Add CallbackHelper lifecycle handling and fix unit test execution#1276OswaldoApexSystems wants to merge 16 commits into
OswaldoApexSystems wants to merge 16 commits into
Conversation
-Introduced a new CallbackHelper class to centralize notification callback lifecycle management and prevent stale callback collisions when the EOS Platform is recreated. -Updated EOSManager and FriendTest to correctly integrate with the new callback lifecycle behavior, ensuring callbacks are cleared at the proper time during test teardown and platform shutdown. -These changes fix failures encountered when running the full unit test suite by ensuring isolation between tests and preventing leftover EOS notification state from leaking across test runs.
…ssionsManagerTests.cs
matt-clarke
requested changes
Apr 22, 2026
…lback disposal Uncommented EOS_DO_NOT_UNLOAD_SDK_ON_SHUTDOWN to prevent unloading the EOS SDK in the Unity Editor, in line with the official EOS documentation. This change resolves the unit test failures by avoiding PlatformInterface.Shutdown() during editor test runs, which was corrupting internal SDK state across multiple test suites.
matt-clarke
requested changes
Apr 23, 2026
| // On macOS and Linux, there isn't a known reliable way to unload shared libraries, therefore this is the default behavior. | ||
| #if (UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX) | ||
| #define EOS_DO_NOT_UNLOAD_SDK_ON_SHUTDOWN | ||
| #endif |
Contributor
There was a problem hiding this comment.
This docs file covers a couple of points which are a bit of a concern:
"It is not the default because if it were, then any edits to the EOSConfig file would require a reboot of the Unity Editor"- Can you check if this is accurate?
- If it is then we would need to think of a solution to this, perhaps when you save the EOSConfig it prompts you to restart the Editor (after checking the new define mentioned in the comment below)
- I suspect we also need a Unity hook to check if the file was modified outside of Unity (user could've edited it by hand, or pulled latest changes from their repo)
"In the past, not unloading the EOS SDK could also cause issues with state from the previous Unity run not being properly cleaned up."- This is the opposite of what we're seeing right? I'm wary that there's some edge case issues that we haven't seen with this initial testing. It could definitely be a misunderstanding though
- The commit message where it was added also says the same, so it doesn't appear to just be a mistake in the docs (
It also carries with it the potential for "leaked" EOS State to carry over between play in editor runs.)
| #if (UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX) | ||
| #define EOS_DO_NOT_UNLOAD_SDK_ON_SHUTDOWN | ||
| #endif | ||
|
|
Contributor
There was a problem hiding this comment.
With this change to always define EOS_DO_NOT_UNLOAD_SDK_ON_SHUTDOWN in Editor this means that this docs file is out of date.
The change above also removes the ability for developers to control whether it's enabled in Editor or not for Windows.
One option would be to change the above code to this, and update the docs to refer to this define instead:
#if UNITY_EDITOR && (!UNITY_EDITOR_WIN || !EOS_UNLOAD_SDK_ON_SHUTDOWN)
#define EOS_DO_NOT_UNLOAD_SDK_ON_SHUTDOWN
#endif
Contributor
There was a problem hiding this comment.
Honestly it would be nice to update these defines whilst we're here:
EOS_DO_NOT_UNLOAD_SDK_ON_SHUTDOWN_IN_EDITOREOS_UNLOAD_SDK_ON_SHUTDOWN_IN_WIN_EDITOR
Contributor
There was a problem hiding this comment.
Keeping this comment active because this docs file needs updating with the new define
The shutdown/unload logic is now Editor‑only, runtime behavior is protected, the hardcoded define was removed, and Windows Editor behavior is aligned with macOS/Linux and Epic documentation.
matt-clarke
reviewed
Apr 24, 2026
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
…ssionsManagerTests.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EOSU-1013


-Introduced a new CallbackHelper class to centralize notification callback lifecycle management and prevent stale callback collisions when the EOS Platform is recreated.
-Updated EOSManager and FriendTest to correctly integrate with the new callback lifecycle behavior, ensuring callbacks are cleared at the proper time during test teardown and platform shutdown.
-These changes fix failures encountered when running the full unit test suite by ensuring isolation between tests and preventing leftover EOS notification state from leaking across test runs.