{"record":{"id":"8caa33308175c500","repo":"ppy/osu","slug":"beatmap-submission-not-supported-in-this-configura","errorCode":null,"errorMessage":"Beatmap submission not supported in this configuration!","messagePattern":"Beatmap submission not supported in this configuration!","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"osu.Game/Online/API/Requests/PatchBeatmapPackageRequest.cs","lineNumber":19,"sourceCode":"// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.\r\n// See the LICENCE file in the repository root for full licence text.\r\n\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Net.Http;\r\nusing osu.Framework.IO.Network;\r\n\r\nnamespace osu.Game.Online.API.Requests\r\n{\r\n    public class PatchBeatmapPackageRequest : APIUploadRequest\r\n    {\r\n        protected override string Uri\r\n        {\r\n            get\r\n            {\r\n                // can be removed once the service has been successfully deployed to production\r\n                if (API!.Endpoints.BeatmapSubmissionServiceUrl == null)\r\n                    throw new NotSupportedException(\"Beatmap submission not supported in this configuration!\");\r\n\r\n                return $@\"{API!.Endpoints.BeatmapSubmissionServiceUrl!}/beatmapsets/{BeatmapSetID}\";\r\n            }\r\n        }\r\n\r\n        protected override string Target => throw new NotSupportedException();\r\n\r\n        public uint BeatmapSetID { get; }\r\n\r\n        public Dictionary<string, byte[]> FilesChanged { get; } = new Dictionary<string, byte[]>();\r\n\r\n        public HashSet<string> FilesDeleted { get; } = new HashSet<string>();\r\n\r\n        public PatchBeatmapPackageRequest(uint beatmapSetId)\r\n        {\r\n            BeatmapSetID = beatmapSetId;\r\n        }\r\n\r","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game/Online/API/Requests/PatchBeatmapPackageRequest.cs#L1-L37","documentation":"Thrown by PatchBeatmapPackageRequest.Uri getter when API.Endpoints.BeatmapSubmissionServiceUrl is null. The patch-upload endpoint is only valid when the submission service URL is configured; the comment notes this guard can be removed once the service is deployed to production. It is a NotSupportedException, signalling the feature is unavailable in the current client configuration.","triggerScenarios":"Constructing/accessing a PatchBeatmapPackageRequest (patching files of an existing beatmap set) while BeatmapSubmissionServiceUrl is not set in the API endpoints. The Uri getter is evaluated when the request is performed.","commonSituations":"A build/endpoint configuration where the submission service isn't enabled; a development environment without the service; the editor's beatmap submission flow invoked before the service is rolled out.","solutions":["Configure API.Endpoints.BeatmapSubmissionServiceUrl to the service base URL before enabling submission flows.","Gate the UI/flow that constructs PatchBeatmapPackageRequest on BeatmapSubmissionServiceUrl != null.","Once the service is in production, remove the guard as the comment instructs."],"exampleFix":"// before\nvar req = new PatchBeatmapPackageRequest(...);\napi.Perform(req); // throws NotSupportedException in Uri getter\n\n// after\nif (string.IsNullOrEmpty(api.Endpoints.BeatmapSubmissionServiceUrl))\n{\n    Notifications.Post(new SimpleNotification { Text = \"Beatmap submission is not available.\" });\n    return;\n}\nvar req = new PatchBeatmapPackageRequest(...);\napi.Perform(req);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(api.Endpoints.BeatmapSubmissionServiceUrl))\n{ /* disable patch-submission UI, notify user */ return; }\nvar req = new PatchBeatmapPackageRequest(...);","typeGuard":"static bool IsSubmissionEnabled(IAPIEndpointProvider endpoints)\n    => !string.IsNullOrWhiteSpace(endpoints.BeatmapSubmissionServiceUrl);","tryCatchPattern":"try { api.Perform(new PatchBeatmapPackageRequest(...)); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Beatmap submission\"))\n{ /* show 'feature unavailable in this build' */ }","preventionTips":["Gate all submission UI on BeatmapSubmissionServiceUrl != null at the feature level.","Keep endpoint config consistent across builds that advertise submission support.","Remove the guard once the service is production-deployed (per the inline comment)."],"tags":["api","beatmap-submission","configuration","network","endpoints"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}