feat: align SDKs with "better files" backend changes - #484
Merged
Conversation
- 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
kirre-bylund
requested review from
JohannesLoot
and
a lite review from Copilot
August 26, 2026 14:33
Contributor
There was a problem hiding this comment.
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
keysupport 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
keybeforeforPlayerWithUlidis a breaking change for positional callers. KeepforPlayerWithUlidas the first optional parameter and addkeyafter 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
forPlayerWithUlidbeforekeyfor 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 keepforPlayerWithUlidbeforekey. 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
keybeforeforPlayerWithUlidis a breaking change for positional callers. KeepforPlayerWithUlidbeforekey.
/// <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 keepforPlayerWithUlidbeforekey, 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.
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.
No description provided.