{"record":{"id":"f776e2be17cf22a4","repo":"Devolutions/UniGetUI","slug":"the-bundle-selection-mode-selection-is-not-sup","errorCode":null,"errorMessage":"The bundle selection mode \"{selection}\" is not supported.","messagePattern":"The bundle selection mode \"(.+?)\" is not supported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcBundleApi.cs","lineNumber":551,"sourceCode":"            null or \"\" or \"ubundle\" => BundleFormatType.UBUNDLE,\n            \"json\" => BundleFormatType.JSON,\n            \"yaml\" or \"yml\" => BundleFormatType.YAML,\n            \"xml\" => BundleFormatType.XML,\n            _ => throw new InvalidOperationException(\n                $\"The bundle format \\\"{format}\\\" is not supported.\"\n            ),\n        };\n    }\n\n    private static IpcPackageLookupMode ParseLookupMode(string? selection)\n    {\n        return selection?.Trim().ToLowerInvariant() switch\n        {\n            null or \"\" or \"search\" => IpcPackageLookupMode.Search,\n            \"installed\" => IpcPackageLookupMode.Installed,\n            \"updates\" or \"upgradable\" => IpcPackageLookupMode.Upgradable,\n            \"auto\" => IpcPackageLookupMode.Any,\n            _ => throw new InvalidOperationException(\n                $\"The bundle selection mode \\\"{selection}\\\" is not supported.\"\n            ),\n        };\n    }\n\n    internal static async Task<string> CreateBundleAsync(IReadOnlyList<IPackage> unsortedPackages)\n    {\n        var exportableData = new SerializableBundle();\n        var packages = unsortedPackages.ToList();\n        packages.Sort((x, y) =>\n        {\n            if (x.Id != y.Id)\n            {\n                return string.Compare(x.Id, y.Id, StringComparison.Ordinal);\n            }\n\n            if (x.Name != y.Name)\n            {","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcBundleApi.cs#L533-L569","documentation":"Thrown by IpcBundleApi.ParseLookupMode when the package selection/lookup mode string is not one of search/installed/updates/upgradable/auto (or empty, which defaults to Search). This mode controls how a bundle-add package request resolves an ambiguous package id across installed, upgradable, and search result sets.","triggerScenarios":"Calling the bundle package-add endpoint (CLI 'bundle add') with '--selection all', '--selection everything', or any token outside the allowed set. The Selection field on IpcBundlePackageRequest is forwarded verbatim into ParseLookupMode.","commonSituations":"A user guessing the flag value ('--selection any' instead of '--selection auto'). Mixing up this selector with another API's vocabulary. Passing 'upgrade' (singular) instead of 'updates'.","solutions":["Use one of: search (default), installed, updates, upgradable, or auto.","Omit --selection entirely to accept the Search default.","Check the CLI help text for the bundle add command for the current token list before scripting."],"exampleFix":"// before\nunigetui bundle add --package-id git --manager winget --selection any\n// after\nunigetui bundle add --package-id git --manager winget --selection auto","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> s_modes = new(StringComparer.OrdinalIgnoreCase)\n    { \"search\", \"installed\", \"updates\", \"upgradable\", \"auto\" };\n\nstatic bool IsValidSelection(string? s) =>\n    string.IsNullOrWhiteSpace(s) || s_modes.Contains(s.Trim().ToLowerInvariant());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Constrain the selection dropdown/argument to the five allowed tokens.","Treat empty selection as 'search' (the server default) rather than sending a placeholder."],"tags":["ipc","bundle","input-validation","enum"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}