Skip to content

feat: Add failed response error reporting using the feedback system#452

Merged
kirre-bylund merged 3 commits into
devfrom
feat/report-lootlocker-error
Apr 10, 2026
Merged

feat: Add failed response error reporting using the feedback system#452
kirre-bylund merged 3 commits into
devfrom
feat/report-lootlocker-error

Conversation

@kirre-bylund
Copy link
Copy Markdown
Contributor

Will result in a report like this:
image

Requires that the developer creates a game feedback category named exactly "lootlocker_request_failure", otherwise report sending won't work.

Added a LootLockerSDKManager. method and a convenience overload on the response itself to send the report. Example code (ignore logging/OutputText.text parts, that's my test game logging to screen):

void Start()
    {
        OutputText.text = "AutoReportTest Start";
        LootLockerSDKManager.StartGuestSession((response) =>
        {
            if (response.success)
            {
                OutputText.text = "StartGuestSession Success";
                LootLockerSDKManager.LootLockerPurchaseSingleCatalogItem("nonexsisting_wallet_id", "nonexsisting_item_id", 1, (purchaseResponse) =>
                {
                    if (purchaseResponse.success)
                    {
                        OutputText.text = "PurchaseSingleCatalogItem Success";
                    }
                    else
                    {
                        OutputText.text = "PurchaseSingleCatalogItem Failed: " + purchaseResponse.errorData;
                        if (AutoSendReport) {
                            OutputText.text += "\n Sending AutoReport...";
                            purchaseResponse.ReportFailure("This is the user's description of the error, or a custom string supplied by the developer.", (reportResponse) =>
                            {
                                if (reportResponse.success)
                                {
                                    OutputText.text += "\n AutoReport Success";
                                }
                                else
                                {
                                    OutputText.text += "\n AutoReport Failed: " + reportResponse.errorData;
                                }
                            });
                        }
                    }
                });
            }
            else
            {
                OutputText.text = "StartGuestSession Failed: " + response.errorData;
            }
        });
        
    }

How this works under the hood is that I generate "report objects" for each failed request and keep the latest 10. Then when a report is requested to send to lootlocker we simply match the id and send the pregenerated report.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an SDK-level “failed request report” flow that captures details from failed HTTP requests and allows developers to submit those details to LootLocker via the existing feedback system (category lootlocker_request_failure) for debugging/diagnostics.

Changes:

  • Added LootLockerSDKManager.SendLootLockerErrorReport(...) and LootLockerResponse.ReportFailure(...) convenience method to submit a captured failure report.
  • Extended response/request context plumbing to carry a client-generated request_id through responses.
  • Implemented failed-request history capture in LootLockerHTTPClient and category-id discovery for the failure feedback category.

Reviewed changes

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

File Description
Runtime/Game/LootLockerSDKManager.cs Adds a public API to send an error report for a previously failed request.
Runtime/Client/LootLockerResponse.cs Adds response convenience method and extends response factory to include request IDs in context.
Runtime/Client/LootLockerRequestContext.cs Extends request context to store a client-generated request ID.
Runtime/Client/LootLockerHTTPClient.cs Captures failed request details into a bounded history and fetches the feedback category ID for reporting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Runtime/Game/LootLockerSDKManager.cs Outdated
Comment thread Runtime/Client/LootLockerHTTPClient.cs
Comment thread Runtime/Client/LootLockerHTTPClient.cs Outdated
Comment thread Runtime/Client/LootLockerHTTPClient.cs Outdated
Comment thread Runtime/Client/LootLockerHTTPClient.cs
Comment thread Runtime/Client/LootLockerHTTPClient.cs
Comment thread Runtime/Client/LootLockerHTTPClient.cs
Comment thread Runtime/Client/LootLockerHTTPClient.cs
Comment thread Runtime/Client/LootLockerResponse.cs
Comment thread Runtime/Client/LootLockerRequestContext.cs
@kirre-bylund kirre-bylund force-pushed the feat/report-lootlocker-error branch from 9968b3c to fdf7742 Compare April 8, 2026 20:44
Copy link
Copy Markdown
Contributor

@JohannesLoot JohannesLoot left a comment

Choose a reason for hiding this comment

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

Really awesome feature!
Great work 👍
Merge it!

@kirre-bylund kirre-bylund merged commit 3007d83 into dev Apr 10, 2026
61 checks passed
@kirre-bylund kirre-bylund deleted the feat/report-lootlocker-error branch April 10, 2026 09:55
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.

3 participants