Skip to content

feat: align SDKs with "better files" backend changes - #484

Merged
kirre-bylund merged 3 commits into
devfrom
feat/better-files
Aug 28, 2026
Merged

feat: align SDKs with "better files" backend changes#484
kirre-bylund merged 3 commits into
devfrom
feat/better-files

Conversation

@kirre-bylund

Copy link
Copy Markdown
Contributor

No description provided.

- Add revision handling for files
- Add optional `key` parameter to FileStream upload overloads
- Add 19 PlayMode tests covering key-based upload/upsert, key-based lookup/delete, file revisions (by ID and by key), and response field verification

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.

Pull request overview

This PR updates the Unity SDK to match the “better files” backend by adding key-based player-file operations and file revision APIs, and adjusts remote-session leasing to support restricting identity providers.

Changes:

  • Added key support for player file upload (upsert behavior) and introduced new public SDK methods for key-based file lookup/delete and revision listing/get/promote.
  • Added new endpoints + request/response models for player file revisions and key-based file routes.
  • Expanded PlayMode coverage for player file workflows (upload with key, upsert, revisions by id/key, promote, delete-by-key) and adjusted remote session polling behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Tests/LootLockerTests/PlayMode/PlayerFilesTest.cs Adds comprehensive PlayMode integration tests for the new “better files” behaviors (keys + revisions).
Runtime/Game/Requests/RemoteSessionRequest.cs Adds provider restrictions to lease requests and switches polling waits to realtime waits; tightens cancellation behavior during in-flight polling.
Runtime/Game/Requests/PlayerRequest.cs Introduces new player-file revision/key response models and APIManager request methods for the new routes.
Runtime/Game/LootLockerSDKManager.cs Extends the public PlayerFiles API surface with key upload support and new revision/key methods that route through APIManager.
Runtime/Client/LootLockerEndPoints.cs Adds endpoint definitions for revisions and key-based player-file routes.
Suppressed comments (5)

Runtime/Game/LootLockerSDKManager.cs:4146

  • Same backward-compatibility issue here: inserting key before forPlayerWithUlid is a breaking change for positional callers. Keep forPlayerWithUlid as the first optional parameter and add key after it.
        /// <param name="key">Optional key for upsert behavior. If a file with this key already exists, it will be updated.</param>
        /// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
        public static void UploadPlayerFile(FileStream fileStream, string filePurpose, bool isPublic, Action<LootLockerPlayerFile> onComplete, string key = null, string forPlayerWithUlid = null)

Runtime/Game/LootLockerSDKManager.cs:4192

  • This overload also changed optional parameter ordering, which can silently break positional calls. Keep forPlayerWithUlid before key for backward compatibility.
        /// <param name="onComplete">onComplete Action for handling the response of type LootLockerPlayerFile</param>
        /// <param name="key">Optional key for upsert behavior. If a file with this key already exists, it will be updated.</param>
        /// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
        public static void UploadPlayerFile(FileStream fileStream, string filePurpose, Action<LootLockerPlayerFile> onComplete, string key = null, string forPlayerWithUlid = null)

Runtime/Game/LootLockerSDKManager.cs:4195

  • This forwarding call will pass arguments to the wrong parameters once UploadPlayerFile(FileStream, ...) is updated to keep forPlayerWithUlid before key. Use named arguments to keep the intent clear and avoid ordering issues.
        public static void UploadPlayerFile(FileStream fileStream, string filePurpose, Action<LootLockerPlayerFile> onComplete, string key = null, string forPlayerWithUlid = null)
        {
            UploadPlayerFile(fileStream, filePurpose, false, onComplete, key, forPlayerWithUlid);
        }

Runtime/Game/LootLockerSDKManager.cs:4208

  • Same backward-compatibility issue for the byte[] overload: inserting key before forPlayerWithUlid is a breaking change for positional callers. Keep forPlayerWithUlid before key.
        /// <param name="onComplete">onComplete Action for handling the response of type LootLockerPlayerFile</param>
        /// <param name="key">Optional key for upsert behavior. If a file with this key already exists, it will be updated.</param>
        /// <param name="forPlayerWithUlid">Optional : Execute the request for the specified player. If not supplied, the default player will be used.</param>
        public static void UploadPlayerFile(byte[] fileBytes, string fileName, string filePurpose, bool isPublic, Action<LootLockerPlayerFile> onComplete, string key = null, string forPlayerWithUlid = null)

Runtime/Game/LootLockerSDKManager.cs:4246

  • This forwarding call relies on the current parameter order of UploadPlayerFile(byte[], ...). If that overload is updated to keep forPlayerWithUlid before key, this call must be updated too; using named arguments avoids future ordering regressions.
        public static void UploadPlayerFile(byte[] fileBytes, string fileName, string filePurpose, Action<LootLockerPlayerFile> onComplete, string forPlayerWithUlid = null)
        {
            UploadPlayerFile(fileBytes, fileName, filePurpose, false, onComplete, null, forPlayerWithUlid);
        }

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

Comment thread Runtime/Game/Requests/PlayerRequest.cs Outdated
Comment thread Runtime/Game/LootLockerSDKManager.cs Outdated
Comment thread Runtime/Game/LootLockerSDKManager.cs Outdated
Comment thread Tests/LootLockerTests/PlayMode/PlayerFilesTest.cs
@kirre-bylund
kirre-bylund merged commit 5aada3f into dev Aug 28, 2026
50 of 56 checks passed
@kirre-bylund
kirre-bylund deleted the feat/better-files branch August 28, 2026 05:32
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