Surface upgrade suggestions on insufficient-balance downloads - #516
Merged
sanaderi merged 1 commit intoJul 18, 2026
Merged
Conversation
…e downloads Downloads previously returned a bare, untranslated "InsufficientBalance" error and silently dropped the upgrade suggestions GameService already computes, unlike the richer games/spends v2 response. Bring the download endpoint in line with that existing convention. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
🤖 AI Generated Review This review was generated automatically and does not replace human review. Review chunk 1/1SummaryThis pull request introduces a feature to provide upgrade suggestions when a download fails due to insufficient balance. Changes span several files, including adjustments to data transfer objects, services, and view models, as well as adding new resource files for localization. Potential Issues
Suggestions
Positive Feedback
|
sanaderi
approved these changes
Jul 18, 2026
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.
Summary
POST api/v1/downloadspreviously returned a bareOperationResult.Failedwith the messageLocalizer["InsufficientBalance"]on an insufficient-balance charge — that key had no resx entry anywhere in the repo, so it rendered literally as the stringInsufficientBalanceto callers.GameService.SpendPointsAsyncalready computesUpgradeSuggestions(up to 3 active plans that would cover the feature) on this same failure, matching whatgames/spendsv2 already exposes — butContentDeliveryService/DownloadContentResponseDtohad no field to carry it through, so it was silently dropped for downloads specifically.UpgradeSuggestionsthrough to the download response, so the frontend can drive the same "upgrade/top-up" UI on a denied download that it already can ongames/spends.Changes
src/Core/Resource/Application/GameService.resx(new): real text for theInsufficientBalancekey.DownloadContentResponseDto/DownloadContentResponseViewModel: addedUpgradeSuggestions; relaxedUrlfromrequiredto nullable (there's no URL on a failed/no-download response).ContentDeliveryService.DownloadContentAsync: forwardsUpgradeSuggestionson the insufficient-balance branch instead of discarding them.DownloadsController.Download: mapsUpgradeSuggestionsDTO → ViewModel using the same pattern already used bygames/spendsv2.docs/business/content-delivery.md: documents the new response field and the resx fix.Test plan
dotnet build(0 warnings/errors,TreatWarningsAsErrorson)