Skip to content

Support Unity 6.5/6.6 (EntityId migration) + timezone regression tests - #488

Merged
kirre-bylund merged 2 commits into
release/v8.2.0from
1722-support-unity-6-and-latest-ue
Sep 22, 2026
Merged

kirre-bylund merged 2 commits into
release/v8.2.0from
1722-support-unity-6-and-latest-ue

Conversation

@kirre-bylund

Copy link
Copy Markdown
Contributor

Summary

  • Fixes the compile error reported in lootlocker/index#1722: Unity 6.5+ obsoletes Object.GetInstanceID() (error CS0619, "Use GetEntityId instead"), which broke the SDK on Unity 6.5/6.6.
    • LootLockerLifecycleManager now stores the instance id as EntityId and uses GetEntityId() when compiling against Unity 6.5+, and keeps GetInstanceID()/int on older versions (guarded by UNITY_6000_5_OR_NEWER), so the minimum supported editor (2019.2) is unchanged.
  • Adds TimezoneConverterTests locking in the exact IANA timezone strings (Etc/GMT+X, Etc/GMT-X, Etc/UTC) produced by LootLockerTimezoneConverter. This guards against the casing/sign class of bug reported by a customer against the Unreal sample (ETC/GMT is invalid; must be Etc/GMT).

Testing

  • Compile against Unity 6.6 — CS0619 at LootLockerLifecycleManager.cs(118,31) is gone.
  • Compile against an older supported editor (e.g. 2021 LTS) — no regression.
  • Run the new TimezoneConverterTests (LootLockerCIFast).

Ref: lootlocker/index#1722

Copilot AI lite review requested due to automatic review settings September 22, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new tests are missing the LootLockerCI category and include clamping assertions that will fail on older supported Unity versions where clamping is not compiled in.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
What changed in this PR

Updates the SDK to compile on Unity 6.5/6.6 by replacing deprecated Object.GetInstanceID() usage in LootLockerLifecycleManager, and adds regression tests to lock in the exact IANA timezone strings emitted by LootLockerTimezoneConverter.

Changes:

  • Store lifecycle-manager identity using EntityId + GetEntityId() on Unity 6.5+ while keeping GetInstanceID() on older editors via UNITY_6000_5_OR_NEWER.
  • Add TimezoneConverterTests to validate casing/sign conventions and conversion/fallback behavior for IANA timezone strings.
  • Add the corresponding Unity .meta file for the new test.
File Description
Runtime/​Client/​LootLockerLifecycleManager.cs Uses EntityId/GetEntityId() behind UNITY_6000_5_OR_NEWER to fix Unity 6.5+ compile errors while preserving older-editor behavior.
Tests/​LootLockerTests/​PlayMode/​TimezoneConverterTests.cs Adds regression coverage for timezone conversion outputs (IANA casing, sign convention, Windows/IANA passthrough, fallbacks).
Tests/​LootLockerTests/​PlayMode/​TimezoneConverterTests.cs.meta Unity asset metadata for the new test file.
Files not reviewed (1)
  • Tests/LootLockerTests/PlayMode/TimezoneConverterTests.cs.meta: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +20 to +22
// Out-of-range offsets are clamped
Assert.AreEqual("Etc/GMT+12", LootLockerTimezoneConverter.convertUTCOffsetToIanaTzString(-999));
Assert.AreEqual("Etc/GMT-14", LootLockerTimezoneConverter.convertUTCOffsetToIanaTzString(999));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — fixed in 21f2e81. The out-of-range clamping assertions are now wrapped in #if UNITY_2021_1_OR_NEWER to match the converter's own clamping guard, so they no longer assert on older supported editors (2019.2/2020) where clamping doesn't occur.

/// </summary>
public class TimezoneConverterTests
{
[Test, Category("LootLocker"), Category("LootLockerCIFast")]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 21f2e81 — all three tests now include the LootLockerCI category alongside LootLocker and LootLockerCIFast, matching JsonTests.cs. They'll run both on PRs to dev (LootLockerCIFast) and PRs to main (LootLockerCI).

@kirre-bylund

Copy link
Copy Markdown
Contributor Author

Note on the failing integration tests jobs: these fail identically on other PRs (eg #486) — the devenv dev-mysql container exits with code 1 during the "Launch devenv" step, so this is a pre-existing CI infrastructure issue unrelated to this change. All compile, playmode-test and standalone-build checks pass on all editor versions including Unity 6.

@kirre-bylund
kirre-bylund changed the base branch from dev to release/v8.2.0 September 22, 2026 18:09
kirre-bylund and others added 2 commits September 22, 2026 20:09
Unity 6.5+ obsoletes Object.GetInstanceID with a compile error (CS0619),
which broke the SDK on Unity 6.5/6.6. Guard the migration behind
UNITY_6000_5_OR_NEWER so older supported editors keep working.

Also add tests locking in the IANA timezone casing/sign convention
produced by LootLockerTimezoneConverter (Etc/GMT, not ETC/GMT).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Tag tests with the LootLockerCI category so they run on PRs targeting main.
- The out-of-range clamping assertions only hold from UNITY_2021_1_OR_NEWER,
  since the converter only clamps under that define; guard them accordingly.
@kirre-bylund
kirre-bylund force-pushed the 1722-support-unity-6-and-latest-ue branch from 21f2e81 to 0a1a363 Compare September 22, 2026 18:09
@kirre-bylund
kirre-bylund merged commit 63d279b into release/v8.2.0 Sep 22, 2026
@kirre-bylund
kirre-bylund deleted the 1722-support-unity-6-and-latest-ue branch September 22, 2026 18:09
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