{"record":{"id":"74d8261753f405c1","repo":"Jguer/yay","slug":"skip-menu-must-be-a-boolean","errorCode":null,"errorMessage":"skip_menu must be a boolean","messagePattern":"skip_menu must be a boolean","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/settings/lua/autocmd.go","lineNumber":398,"sourceCode":"\t\t\t}\n\n\t\t\tname := string(lname)\n\t\t\tif !validExcludes.Contains(name) {\n\t\t\t\tparseErr = fmt.Errorf(\"unknown upgrade exclusion %q\", name)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tresult.Exclude = append(result.Exclude, name)\n\t\t})\n\t\tif parseErr != nil {\n\t\t\treturn result, parseErr\n\t\t}\n\t}\n\n\tif skipMenuValue := tbl.RawGetString(\"skip_menu\"); skipMenuValue != glua.LNil {\n\t\tskipMenu, ok := skipMenuValue.(glua.LBool)\n\t\tif !ok {\n\t\t\treturn result, fmt.Errorf(\"skip_menu must be a boolean\")\n\t\t}\n\n\t\tresult.SkipMenu = bool(skipMenu)\n\t}\n\n\treturn result, nil\n}\n\nfunc (e *Engine) stringArray(values []string) *glua.LTable {\n\ttbl := e.L.NewTable()\n\tfor _, value := range values {\n\t\ttbl.Append(glua.LString(value))\n\t}\n\n\treturn tbl\n}\n\nfunc (e *Engine) RunPostInstall(event *PostInstallEvent) error {","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/pkg/settings/lua/autocmd.go#L380-L416","documentation":"The 'skip_menu' field of an UpgradeSelect callback result must be a Lua boolean; any other type (number, string, nil handled separately) yields 'skip_menu must be a boolean'. Thrown because SkipMenu directly controls whether yay shows the interactive upgrade menu.","triggerScenarios":"Callback returns { skip_menu = 1 }, { skip_menu = 'yes' }, or similar truthy non-boolean values.","commonSituations":"Users porting shell/env conventions (0/1, 'true'/'false' strings) into Lua; confusing Lua truthiness with strict typing enforced by the parser.","solutions":["Use true or false literals for skip_menu","Remove the skip_menu key if you want the default behavior","Replace skip_menu = 1 with skip_menu = true","Audit other hook results for the same 0/1 habit"],"exampleFix":"-- before\nreturn { skip_menu = 1 }\n-- after\nreturn { skip_menu = true }","handlingStrategy":"validation","validationCode":"if r.skip_menu ~= nil and type(r.skip_menu) ~= 'boolean' then error('skip_menu must be true or false') end","typeGuard":"local function hasBoolSkipMenu(r) return r == nil or r.skip_menu == nil or type(r.skip_menu) == 'boolean' end","tryCatchPattern":null,"preventionTips":["Use Lua boolean literals only; avoid 0/1 and 'yes'/'no'","Remember Lua treats any non-nil/non-false value as truthy but the parser requires strict booleans","Standardize a helper in your config that builds the result table"],"tags":["lua","validation","type-mismatch","upgrade"],"backgroundTag":"config-type-mismatch","analyzedSha":"328f4b4939fb35f38c2f7c7ce3b8638a839bafa5","analyzedAt":"2026-09-07T16:45:12.608Z","contentChangedAt":"2026-09-07T16:45:12.608Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}