{"record":{"id":"b6f5a1fe1dd4d3c4","repo":"Mintplex-Labs/anything-llm","slug":"no-valid-updates-provided","errorCode":null,"errorMessage":"No valid updates provided.","messagePattern":"No valid updates provided\\.","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/endpoints/telegram.js","lineNumber":310,"sourceCode":"\n  app.post(\n    \"/telegram/update-config\",\n    [validatedRequest, isSingleUserMode],\n    async (request, response) => {\n      try {\n        const { voice_response_mode } = reqBody(request);\n        const updates = {};\n\n        if (\n          voice_response_mode &&\n          [\"text_only\", \"mirror\", \"always_voice\"].includes(voice_response_mode)\n        ) {\n          updates.voice_response_mode = voice_response_mode;\n        }\n\n        if (Object.keys(updates).length === 0) {\n          return response\n            .status(400)\n            .json({ success: false, error: \"No valid updates provided.\" });\n        }\n\n        const { error } = await ExternalCommunicationConnector.updateConfig(\n          \"telegram\",\n          updates\n        );\n        if (error) {\n          return response.status(500).json({ success: false, error });\n        }\n\n        // Update the running bot's config so changes take effect immediately\n        const service = new TelegramBotService();\n        if (service.isRunning) service.updateConfig(updates);\n\n        return response.status(200).json({ success: true });\n      } catch (e) {\n        console.error(e.message, e);","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/endpoints/telegram.js#L292-L328","documentation":"The 400 reply from POST /telegram/update-config when the request carries nothing the endpoint can apply. The only updatable field is voice_response_mode, and it is accepted solely when it is a truthy string equal to 'text_only', 'mirror', or 'always_voice'. Any other value, a missing field, or a differently-named key leaves the updates object empty and triggers this error before any database write.","triggerScenarios":"POST /telegram/update-config with voice_response_mode set to an unsupported value ('voice', 'always', 'TEXT_ONLY'), with a typo'd key (voiceResponseMode), or with an entirely empty body. The whitelist check is case-sensitive, so capitalization also fails.","commonSituations":"Frontend dropdown values drifting from the supported enum; client sending the whole config object instead of the single field; API consumers guessing the value names without reading the enum.","solutions":["Send exactly one of: {\"voice_response_mode\": \"text_only\" | \"mirror\" | \"always_voice\"} with Content-Type: application/json.","Check casing - the comparison is exact ('text_only', not 'TextOnly').","If you intended a different setting (workspace, approved users), use the dedicated endpoints; update-config only manages voice_response_mode."],"exampleFix":"// before\n{ \"voice_response_mode\": \"always\" }\n\n// after\n{ \"voice_response_mode\": \"always_voice\" }","handlingStrategy":"validation","validationCode":"const VOICE_MODES = [\"text_only\", \"mirror\", \"always_voice\"];\nfunction updateVoiceMode(mode) {\n  if (!VOICE_MODES.includes(mode)) throw new Error(`voice_response_mode must be one of ${VOICE_MODES.join(\" | \")}`);\n  return fetch(\"/api/telegram/update-config\", {\n    method: \"POST\", headers: { \"Content-Type\": \"application/json\" },\n    body: JSON.stringify({ voice_response_mode: mode }),\n  });\n}","typeGuard":"const isVoiceResponseMode = (v) =>\n  v === \"text_only\" || v === \"mirror\" || v === \"always_voice\";","tryCatchPattern":null,"preventionTips":["Bind UI dropdowns to the exact enum values so users cannot submit free text.","Remember update-config only accepts voice_response_mode - other settings have their own endpoints.","Values are case-sensitive lowercase with underscores."],"tags":["telegram","validation","enum","configuration"],"backgroundTag":"schema-validation-failed","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}